diff options
Diffstat (limited to 'test/pacman')
-rwxr-xr-x | test/pacman/pactest.py | 2 | ||||
-rw-r--r-- | test/pacman/pmdb.py | 2 | ||||
-rw-r--r-- | test/pacman/pmenv.py | 2 | ||||
-rw-r--r-- | test/pacman/pmfile.py | 2 | ||||
-rw-r--r-- | test/pacman/pmpkg.py | 2 | ||||
-rw-r--r-- | test/pacman/pmrule.py | 9 | ||||
-rw-r--r-- | test/pacman/pmtest.py | 2 | ||||
-rw-r--r-- | test/pacman/tests/Makefile.am | 10 | ||||
-rw-r--r-- | test/pacman/tests/ignore008.py | 29 | ||||
-rw-r--r-- | test/pacman/tests/remove031.py | 11 | ||||
-rw-r--r-- | test/pacman/tests/sync139.py | 23 | ||||
-rw-r--r-- | test/pacman/tests/sync502.py | 17 | ||||
-rw-r--r-- | test/pacman/tests/sync503.py | 18 | ||||
-rw-r--r-- | test/pacman/tests/upgrade012.py | 2 | ||||
-rw-r--r-- | test/pacman/tests/upgrade014.py | 2 | ||||
-rw-r--r-- | test/pacman/tests/upgrade015.py | 2 | ||||
-rw-r--r-- | test/pacman/tests/upgrade016.py | 2 | ||||
-rw-r--r-- | test/pacman/tests/upgrade046.py | 2 | ||||
-rw-r--r-- | test/pacman/util.py | 2 |
19 files changed, 120 insertions, 21 deletions
diff --git a/test/pacman/pactest.py b/test/pacman/pactest.py index bb198eb4..2fb64edc 100755 --- a/test/pacman/pactest.py +++ b/test/pacman/pactest.py @@ -1,4 +1,4 @@ -#! /usr/bin/python +#! /usr/bin/python2 # # pactest : run automated testing on the pacman binary # diff --git a/test/pacman/pmdb.py b/test/pacman/pmdb.py index b94c6cf6..285c3151 100644 --- a/test/pacman/pmdb.py +++ b/test/pacman/pmdb.py @@ -1,4 +1,4 @@ -#! /usr/bin/python +#! /usr/bin/python2 # # Copyright (c) 2006 by Aurelien Foret <orelien@chez.com> # diff --git a/test/pacman/pmenv.py b/test/pacman/pmenv.py index 04aecd9a..0e455cee 100644 --- a/test/pacman/pmenv.py +++ b/test/pacman/pmenv.py @@ -1,4 +1,4 @@ -#! /usr/bin/python +#! /usr/bin/python2 # # Copyright (c) 2006 by Aurelien Foret <orelien@chez.com> # diff --git a/test/pacman/pmfile.py b/test/pacman/pmfile.py index cdcc7715..d5aa1a11 100644 --- a/test/pacman/pmfile.py +++ b/test/pacman/pmfile.py @@ -1,4 +1,4 @@ -#! /usr/bin/python +#! /usr/bin/python2 # # Copyright (c) 2006 by Aurelien Foret <orelien@chez.com> # diff --git a/test/pacman/pmpkg.py b/test/pacman/pmpkg.py index 00f345c0..bfc93dd6 100644 --- a/test/pacman/pmpkg.py +++ b/test/pacman/pmpkg.py @@ -1,4 +1,4 @@ -#! /usr/bin/python +#! /usr/bin/python2 # # Copyright (c) 2006 by Aurelien Foret <orelien@chez.com> # diff --git a/test/pacman/pmrule.py b/test/pacman/pmrule.py index 70c8838e..778b6aac 100644 --- a/test/pacman/pmrule.py +++ b/test/pacman/pmrule.py @@ -1,4 +1,4 @@ -#! /usr/bin/python +#! /usr/bin/python2 # # Copyright (c) 2006 by Aurelien Foret <orelien@chez.com> # @@ -87,8 +87,11 @@ class pmrule(object): if not value in newpkg.depends: success = 0 elif case == "OPTDEPENDS": - if not value in newpkg.optdepends: - success = 0 + success = 0 + for optdep in newpkg.optdepends: + if value == optdep.split(':', 1)[0]: + success = 1 + break elif case == "REASON": if newpkg.reason != int(value): success = 0 diff --git a/test/pacman/pmtest.py b/test/pacman/pmtest.py index 4e1ecd0b..1a026864 100644 --- a/test/pacman/pmtest.py +++ b/test/pacman/pmtest.py @@ -1,4 +1,4 @@ -#! /usr/bin/python +#! /usr/bin/python2 # # Copyright (c) 2006 by Aurelien Foret <orelien@chez.com> # diff --git a/test/pacman/tests/Makefile.am b/test/pacman/tests/Makefile.am index 508534ac..9ab0c777 100644 --- a/test/pacman/tests/Makefile.am +++ b/test/pacman/tests/Makefile.am @@ -17,11 +17,9 @@ edit = sed \ $(CONFTESTS): Makefile - @echo ' ' GEN $@; - @$(RM) $@ $@.tmp - @test -f $(srcdir)/$@.in && $(edit) $(srcdir)/$@.in >$@.tmp || true - @test -f $@.tmp || false - @chmod a-w $@.tmp - @mv $@.tmp $@ + $(AM_V_at)$(RM) $@ $@.tmp + $(AM_V_GEN)test -f $(srcdir)/$@.in && $(edit) $(srcdir)/$@.in >$@.tmp || true + $(AM_V_at)chmod a-w $@.tmp + $(AM_V_at)mv $@.tmp $@ # vim:set ts=2 sw=2 noet: diff --git a/test/pacman/tests/ignore008.py b/test/pacman/tests/ignore008.py new file mode 100644 index 00000000..12416ad9 --- /dev/null +++ b/test/pacman/tests/ignore008.py @@ -0,0 +1,29 @@ +self.description = "Sync with relevant ignored fnmatched packages" + +package1 = pmpkg("foopkg", "1.0-1") +self.addpkg2db("local", package1) + +package2 = pmpkg("barpkg", "2.0-1") +self.addpkg2db("local", package2) + +package3 = pmpkg("bazpkg", "3.0-1") +self.addpkg2db("local", package3) + + +package1up = pmpkg("foopkg", "2.0-1") +self.addpkg2db("sync", package1up) + +package2up = pmpkg("barpkg", "3.0-1") +self.addpkg2db("sync", package2up) + +package3up = pmpkg("bazpkg", "4.0-1") +self.addpkg2db("sync", package3up) + +self.option["IgnorePkg"] = ["foo*", "ba?pkg"] +self.args = "-Su" + + +self.addrule("PACMAN_RETCODE=0") +self.addrule("PKG_VERSION=foopkg|1.0-1") +self.addrule("PKG_VERSION=barpkg|2.0-1") +self.addrule("PKG_VERSION=bazpkg|3.0-1") diff --git a/test/pacman/tests/remove031.py b/test/pacman/tests/remove031.py new file mode 100644 index 00000000..0ea09c87 --- /dev/null +++ b/test/pacman/tests/remove031.py @@ -0,0 +1,11 @@ +self.description = "Remove a package in HoldPkg" + +p1 = pmpkg("foopkg") +self.addpkg2db("local", p1) + +self.option["HoldPkg"] = ["???pkg"] + +self.args = "-R %s" % p1.name + +self.addrule("PACMAN_RETCODE=1") +self.addrule("PKG_EXIST=foopkg") diff --git a/test/pacman/tests/sync139.py b/test/pacman/tests/sync139.py new file mode 100644 index 00000000..0b0526d8 --- /dev/null +++ b/test/pacman/tests/sync139.py @@ -0,0 +1,23 @@ +self.description = "Sysupgrade of packages in fnmatch'd IgnoreGroup" + +sp1 = pmpkg("pkg1", "1.0-2") +sp1.groups = ["grp"] +sp2 = pmpkg("pkg2", "1.0-2") +sp2.groups = ["grp2"] + +for p in sp1, sp2: + self.addpkg2db("sync", p) + +lp1 = pmpkg("pkg1", "1.0-1") +lp2 = pmpkg("pkg2", "1.0-1") + +for p in lp1, lp2: + self.addpkg2db("local", p) + +self.option["IgnoreGroup"] = ["grp"] + +self.args = "-Su" + +self.addrule("PACMAN_RETCODE=0") +self.addrule("PKG_VERSION=pkg1|1.0-1") +self.addrule("PKG_VERSION=pkg2|1.0-2") diff --git a/test/pacman/tests/sync502.py b/test/pacman/tests/sync502.py new file mode 100644 index 00000000..5cc42c9f --- /dev/null +++ b/test/pacman/tests/sync502.py @@ -0,0 +1,17 @@ +self.description = "Install a package from a sync db with fnmatch'ed NoExtract" + +sp = pmpkg("dummy") +sp.files = ["bin/dummy", + "usr/share/man/man8", + "usr/share/man/man1/dummy.1"] +self.addpkg2db("sync", sp) + +self.option["NoExtract"] = ["usr/share/man/*"] + +self.args = "-S %s" % sp.name + +self.addrule("PACMAN_RETCODE=0") +self.addrule("PKG_EXIST=dummy") +self.addrule("FILE_EXIST=bin/dummy") +self.addrule("!FILE_EXIST=usr/share/man/man8") +self.addrule("!FILE_EXIST=usr/share/man/man1/dummy.1") diff --git a/test/pacman/tests/sync503.py b/test/pacman/tests/sync503.py new file mode 100644 index 00000000..9d24f00d --- /dev/null +++ b/test/pacman/tests/sync503.py @@ -0,0 +1,18 @@ +self.description = "Upgrade a package, with a fnmatch in NoUpgrade" + +sp = pmpkg("dummy", "1.0-2") +sp.files = ["etc/dummy.conf"] +self.addpkg2db("sync", sp) + +lp = pmpkg("dummy") +lp.files = ["etc/dummy.conf"] +self.addpkg2db("local", lp) + +self.option["NoUpgrade"] = ["etc/dummy.*"] + +self.args = "-S %s" % sp.name + +self.addrule("PKG_VERSION=dummy|1.0-2") +self.addrule("!FILE_MODIFIED=etc/dummy.conf") +self.addrule("FILE_PACNEW=etc/dummy.conf") +self.addrule("!FILE_PACSAVE=etc/dummy.conf") diff --git a/test/pacman/tests/upgrade012.py b/test/pacman/tests/upgrade012.py index dba8dc18..4d9f0cd1 100644 --- a/test/pacman/tests/upgrade012.py +++ b/test/pacman/tests/upgrade012.py @@ -6,7 +6,7 @@ self.addpkg(p) self.filesystem = ["bin/dummy"] -self.args = "-Uf %s" % p.filename() +self.args = "-U --force %s" % p.filename() self.addrule("PACMAN_RETCODE=0") self.addrule("PKG_EXIST=dummy") diff --git a/test/pacman/tests/upgrade014.py b/test/pacman/tests/upgrade014.py index 1632dd36..93c2fe2b 100644 --- a/test/pacman/tests/upgrade014.py +++ b/test/pacman/tests/upgrade014.py @@ -13,7 +13,7 @@ p2.files = ["bin/foobar", for p in p1, p2: self.addpkg(p) -self.args = "-Uf %s" % " ".join([p.filename() for p in p1, p2]) +self.args = "-U --force %s" % " ".join([p.filename() for p in p1, p2]) self.addrule("PACMAN_RETCODE=0") for p in p1, p2: diff --git a/test/pacman/tests/upgrade015.py b/test/pacman/tests/upgrade015.py index 22f7c36b..ea6046cb 100644 --- a/test/pacman/tests/upgrade015.py +++ b/test/pacman/tests/upgrade015.py @@ -6,7 +6,7 @@ self.addpkg(p) self.filesystem = ["etc/dummy.conf"] -self.args = "-Uf %s" % p.filename() +self.args = "-U --force %s" % p.filename() self.addrule("PACMAN_RETCODE=0") self.addrule("PKG_EXIST=dummy") diff --git a/test/pacman/tests/upgrade016.py b/test/pacman/tests/upgrade016.py index dd31c9ab..b6b3f3ae 100644 --- a/test/pacman/tests/upgrade016.py +++ b/test/pacman/tests/upgrade016.py @@ -7,7 +7,7 @@ self.addpkg(p) self.filesystem = ["etc/dummy.conf"] -self.args = "-Uf %s" % p.filename() +self.args = "-U --force %s" % p.filename() self.addrule("PACMAN_RETCODE=0") self.addrule("PKG_EXIST=dummy") diff --git a/test/pacman/tests/upgrade046.py b/test/pacman/tests/upgrade046.py index 12390647..a02a7132 100644 --- a/test/pacman/tests/upgrade046.py +++ b/test/pacman/tests/upgrade046.py @@ -20,7 +20,7 @@ p2.files = ["bin/foobar"] for p in p1, p2: self.addpkg(p) -self.args = "-Uf %s" % " ".join([p.filename() for p in p1, p2]) +self.args = "-U --force %s" % " ".join([p.filename() for p in p1, p2]) self.addrule("PACMAN_RETCODE=0") for p in p1, p2: diff --git a/test/pacman/util.py b/test/pacman/util.py index 81dcc906..d40612dc 100644 --- a/test/pacman/util.py +++ b/test/pacman/util.py @@ -1,4 +1,4 @@ -#! /usr/bin/python +#! /usr/bin/python2 # # Copyright (c) 2006 by Aurelien Foret <orelien@chez.com> # |