1
0
mirror of https://github.com/moparisthebest/pacman synced 2024-08-13 17:03:46 -04:00

Add the unit tests for -Qk and -Qkk that are possible now.

The -Qk test (001) validates the existence of the package files (which
were installed to the filesystem by the framework because the package
was added to the "local" db).

The -Qkk test (002) does not validate any file's properties - it can
only check that the pacman run produces the expected warning message
saying that the package lacks an mtree.

Further tests will require modifications to the testing framework to
allow intentional damage to the filesystem and generating an mtree.

Signed-off-by: Jeremy Heiner <ScalaProtractor at gmail.com>

[Allan] Make warning message detection more specific
Signed-off-by: Allan McRae <allan@archlinux.org>
This commit is contained in:
Jeremy Heiner 2013-11-11 06:47:43 -05:00 committed by Allan McRae
parent 6f468c2465
commit 19445e42e6
3 changed files with 32 additions and 0 deletions

View File

@ -88,6 +88,8 @@ TESTS += test/pacman/tests/query007.py
TESTS += test/pacman/tests/query010.py
TESTS += test/pacman/tests/query011.py
TESTS += test/pacman/tests/query012.py
TESTS += test/pacman/tests/querycheck001.py
TESTS += test/pacman/tests/querycheck002.py
TESTS += test/pacman/tests/reason001.py
TESTS += test/pacman/tests/remove001.py
TESTS += test/pacman/tests/remove002.py

View File

@ -0,0 +1,15 @@
self.description = "Query--check files, all there"
pkg = pmpkg("dummy")
pkg.files = [
"usr/lib/libdummy.so.0",
"usr/lib/libdummy.so -> libdummy.so.0",
"usr/share/dummy/C/",
"usr/share/dummy/C/msgs",
"usr/share/dummy/en -> C"]
self.addpkg2db("local",pkg)
self.args = "-Qk"
self.addrule("PACMAN_RETCODE=0")
self.addrule("!PACMAN_OUTPUT=warning.*(No such file or directory)")

View File

@ -0,0 +1,15 @@
self.description = "Query--check mtree, no mtree"
pkg = pmpkg("dummy")
pkg.files = [
"usr/lib/libdummy.so.0",
"usr/lib/libdummy.so -> libdummy.so.0",
"usr/share/dummy/C/",
"usr/share/dummy/C/msgs",
"usr/share/dummy/en -> C"]
self.addpkg2db("local",pkg)
self.args = "-Qkk"
self.addrule("PACMAN_RETCODE=0")
self.addrule("PACMAN_OUTPUT=dummy: no mtree file")