diff options
Diffstat (limited to 'test/pacman/tests')
48 files changed, 545 insertions, 34 deletions
diff --git a/test/pacman/tests/clean001.py b/test/pacman/tests/clean001.py new file mode 100644 index 00000000..ad86250a --- /dev/null +++ b/test/pacman/tests/clean001.py @@ -0,0 +1,26 @@ +self.description = "CleanMethod = KeepInstalled" + +sp = pmpkg("dummy", "2.0-1") +self.addpkg2db("sync", sp) + +sp = pmpkg("bar", "2.0-1") +self.addpkg2db("sync", sp) + +sp = pmpkg("baz", "2.0-1") +self.addpkg2db("sync", sp) + +lp = pmpkg("dummy", "1.0-1") +self.addpkg2db("local", lp) + +lp = pmpkg("bar", "2.0-1") +self.addpkg2db("local", lp) + +self.args = "-Sc" +self.option['CleanMethod'] = ['KeepInstalled'] +self.createlocalpkgs = True + +self.addrule("PACMAN_RETCODE=0") +self.addrule("!CACHE_EXISTS=dummy|2.0-1") +self.addrule("CACHE_EXISTS=dummy|1.0-1") +self.addrule("CACHE_EXISTS=bar|2.0-1") +self.addrule("!CACHE_EXISTS=baz|2.0-1") diff --git a/test/pacman/tests/clean002.py b/test/pacman/tests/clean002.py new file mode 100644 index 00000000..5dddbc53 --- /dev/null +++ b/test/pacman/tests/clean002.py @@ -0,0 +1,26 @@ +self.description = "CleanMethod = KeepCurrent" + +sp = pmpkg("dummy", "2.0-1") +self.addpkg2db("sync", sp) + +sp = pmpkg("bar", "2.0-1") +self.addpkg2db("sync", sp) + +sp = pmpkg("baz", "2.0-1") +self.addpkg2db("sync", sp) + +lp = pmpkg("dummy", "1.0-1") +self.addpkg2db("local", lp) + +lp = pmpkg("bar", "2.0-1") +self.addpkg2db("local", lp) + +self.args = "-Sc" +self.option['CleanMethod'] = ['KeepCurrent'] +self.createlocalpkgs = True + +self.addrule("PACMAN_RETCODE=0") +self.addrule("CACHE_EXISTS=dummy|2.0-1") +self.addrule("!CACHE_EXISTS=dummy|1.0-1") +self.addrule("CACHE_EXISTS=bar|2.0-1") +self.addrule("CACHE_EXISTS=baz|2.0-1") diff --git a/test/pacman/tests/clean003.py b/test/pacman/tests/clean003.py new file mode 100644 index 00000000..0d3f451f --- /dev/null +++ b/test/pacman/tests/clean003.py @@ -0,0 +1,16 @@ +self.description = "CleanMethod = KeepInstalled with IgnorePkg (FS#22653)" + +sp = pmpkg("dummy", "2.0-1") +self.addpkg2db("sync", sp) + +lp = pmpkg("dummy", "1.0-1") +self.addpkg2db("local", lp) + +self.args = "-Sc" +self.option['CleanMethod'] = ['KeepInstalled'] +self.option['IgnorePkg'] = ['dummy'] +self.createlocalpkgs = True + +self.addrule("PACMAN_RETCODE=0") +self.addrule("!CACHE_EXISTS=dummy|2.0-1") +self.addrule("CACHE_EXISTS=dummy|1.0-1") diff --git a/test/pacman/tests/clean004.py b/test/pacman/tests/clean004.py new file mode 100644 index 00000000..09137f39 --- /dev/null +++ b/test/pacman/tests/clean004.py @@ -0,0 +1,30 @@ +self.description = "CleanMethod = KeepInstalled KeepCurrent" + +sp = pmpkg("dummy", "2.0-1") +self.addpkg2db("sync", sp) + +sp = pmpkg("bar", "2.0-1") +self.addpkg2db("sync", sp) + +sp = pmpkg("baz", "2.0-1") +self.addpkg2db("sync", sp) + +lp = pmpkg("dummy", "1.0-1") +self.addpkg2db("local", lp) + +lp = pmpkg("bar", "2.0-1") +self.addpkg2db("local", lp) + +op = pmpkg("foo", "2.0-1") +self.addpkg(op) + +self.args = "-Sc" +self.option['CleanMethod'] = ['KeepInstalled KeepCurrent'] +self.createlocalpkgs = True + +self.addrule("PACMAN_RETCODE=0") +self.addrule("CACHE_EXISTS=dummy|2.0-1") +self.addrule("CACHE_EXISTS=dummy|1.0-1") +self.addrule("CACHE_EXISTS=bar|2.0-1") +self.addrule("CACHE_EXISTS=baz|2.0-1") +self.addrule("!CACHE_EXISTS=foo|2.0-1") diff --git a/test/pacman/tests/clean005.py b/test/pacman/tests/clean005.py new file mode 100644 index 00000000..f85248ef --- /dev/null +++ b/test/pacman/tests/clean005.py @@ -0,0 +1,29 @@ +self.description = "CleanMethod = unspecified" + +sp = pmpkg("dummy", "2.0-1") +self.addpkg2db("sync", sp) + +sp = pmpkg("bar", "2.0-1") +self.addpkg2db("sync", sp) + +sp = pmpkg("baz", "2.0-1") +self.addpkg2db("sync", sp) + +lp = pmpkg("dummy", "1.0-1") +self.addpkg2db("local", lp) + +lp = pmpkg("bar", "2.0-1") +self.addpkg2db("local", lp) + +op = pmpkg("foo", "2.0-1") +self.addpkg(op) + +self.args = "-Sc" +self.createlocalpkgs = True + +self.addrule("PACMAN_RETCODE=0") +self.addrule("!CACHE_EXISTS=dummy|2.0-1") +self.addrule("CACHE_EXISTS=dummy|1.0-1") +self.addrule("CACHE_EXISTS=bar|2.0-1") +self.addrule("!CACHE_EXISTS=baz|2.0-1") +self.addrule("!CACHE_EXISTS=foo|2.0-1") diff --git a/test/pacman/tests/database012.py b/test/pacman/tests/database012.py index a1f86980..52813ec6 100644 --- a/test/pacman/tests/database012.py +++ b/test/pacman/tests/database012.py @@ -21,11 +21,5 @@ self.addrule("PACMAN_RETCODE=0") self.addrule("PKG_EXIST=dummy") self.addrule("PKG_VERSION=dummy|2.0-1") for f in lp.files: - self.addrule("!FILE_EXIST=%s" % f) -# TODO: I honestly think the above should NOT delete the original files, it -# should upgrade the DB entry without touching anything on the file system. -# E.g. this test should be the same as: -# pacman -R --dbonly dummy && pacman -U --dbonly dummy.pkg.tar.gz -#for f in lp.files: -# self.addrule("FILE_EXIST=%s" % f) + self.addrule("FILE_EXIST=%s" % f) self.addrule("!FILE_EXIST=bin/dummy2") diff --git a/test/pacman/tests/epoch001.py b/test/pacman/tests/epoch001.py new file mode 100644 index 00000000..ac6c41a6 --- /dev/null +++ b/test/pacman/tests/epoch001.py @@ -0,0 +1,12 @@ +self.description = "Sysupgrade with a sync package having higher epoch" + +sp = pmpkg("dummy", "1:1.0-1") +self.addpkg2db("sync", sp) + +lp = pmpkg("dummy", "1.1-1") +self.addpkg2db("local", lp) + +self.args = "-Su" + +self.addrule("PACMAN_RETCODE=0") +self.addrule("PKG_VERSION=dummy|1:1.0-1") diff --git a/test/pacman/tests/epoch002.py b/test/pacman/tests/epoch002.py new file mode 100644 index 00000000..8ca4afc6 --- /dev/null +++ b/test/pacman/tests/epoch002.py @@ -0,0 +1,12 @@ +self.description = "Sysupgrade with an epoch and ignore on same package" + +lp = pmpkg("dummy", "1.0-1") +self.addpkg2db("local", lp) + +sp = pmpkg("dummy", "1:1.0-2") +self.addpkg2db("sync", sp) + +self.args = "-Su --ignore %s" % lp.name + +self.addrule("PACMAN_RETCODE=0") +self.addrule("PKG_VERSION=dummy|1.0-1") diff --git a/test/pacman/tests/epoch003.py b/test/pacman/tests/epoch003.py new file mode 100644 index 00000000..ac395e30 --- /dev/null +++ b/test/pacman/tests/epoch003.py @@ -0,0 +1,12 @@ +self.description = "Sysupgrade with an epoch package overriding a force package" + +sp = pmpkg("dummy", "2:1.4-1") +self.addpkg2db("sync", sp) + +lp = pmpkg("dummy", "1:2.0-1") +self.addpkg2db("local", lp) + +self.args = "-Su" + +self.addrule("PACMAN_RETCODE=0") +self.addrule("PKG_VERSION=dummy|2:1.4-1") diff --git a/test/pacman/tests/epoch004.py b/test/pacman/tests/epoch004.py new file mode 100644 index 00000000..74b00c2b --- /dev/null +++ b/test/pacman/tests/epoch004.py @@ -0,0 +1,16 @@ +self.description = "Sysupgrade with same version, different epochs" + +sp = pmpkg("dummy", "2:2.0-1") +sp.files = ["bin/dummynew"] +self.addpkg2db("sync", sp) + +lp = pmpkg("dummy", "1:2.0-1") +lp.files = ["bin/dummyold"] +self.addpkg2db("local", lp) + +self.args = "-Su" + +self.addrule("PACMAN_RETCODE=0") +self.addrule("PKG_VERSION=dummy|2:2.0-1") +self.addrule("FILE_EXIST=bin/dummynew") +self.addrule("!FILE_EXIST=bin/dummyold") diff --git a/test/pacman/tests/epoch010.py b/test/pacman/tests/epoch010.py new file mode 100644 index 00000000..03bba273 --- /dev/null +++ b/test/pacman/tests/epoch010.py @@ -0,0 +1,12 @@ +self.description = "usbutils case study: force in new package" + +sp = pmpkg("usbutils", "1:001-1") +self.addpkg2db("sync", sp) + +lp = pmpkg("usbutils", "0.91-4") +self.addpkg2db("local", lp) + +self.args = "-Su" + +self.addrule("PACMAN_RETCODE=0") +self.addrule("PKG_VERSION=usbutils|1:001-1") diff --git a/test/pacman/tests/epoch011.py b/test/pacman/tests/epoch011.py new file mode 100644 index 00000000..bc5ee619 --- /dev/null +++ b/test/pacman/tests/epoch011.py @@ -0,0 +1,12 @@ +self.description = "usbutils case study: force stays, epoch now in local db" + +sp = pmpkg("usbutils", "1:002-1") +self.addpkg2db("sync", sp) + +lp = pmpkg("usbutils", "1:001-1") +self.addpkg2db("local", lp) + +self.args = "-Su" + +self.addrule("PACMAN_RETCODE=0") +self.addrule("PKG_VERSION=usbutils|1:002-1") diff --git a/test/pacman/tests/epoch012.py b/test/pacman/tests/epoch012.py new file mode 100644 index 00000000..2a7a7ac2 --- /dev/null +++ b/test/pacman/tests/epoch012.py @@ -0,0 +1,13 @@ +self.description = "usbutils case study: maintainer screws up and removes force" + +sp = pmpkg("usbutils", "003-1") +self.addpkg2db("sync", sp) + +lp = pmpkg("usbutils", "1:002-1") +self.addpkg2db("local", lp) + +self.args = "-Su" + +self.addrule("PACMAN_RETCODE=0") +# remember, this is how we have to handle this- 003 will not be installed +self.addrule("PKG_VERSION=usbutils|1:002-1") diff --git a/test/pacman/tests/ignore001.py b/test/pacman/tests/ignore001.py index bb3fa59a..e9764bc9 100644 --- a/test/pacman/tests/ignore001.py +++ b/test/pacman/tests/ignore001.py @@ -9,7 +9,7 @@ self.addpkg2db("local", package2) package2up = pmpkg("package2", "2.0-1") self.addpkg2db("sync", package2up) -self.option["IgnorePkg"] = ["irrelavent"] +self.option["IgnorePkg"] = ["irrelevant"] self.args = "-Su" self.addrule("PACMAN_RETCODE=0") diff --git a/test/pacman/tests/ignore006.py b/test/pacman/tests/ignore006.py index 4c1c1cac..d80ff81f 100644 --- a/test/pacman/tests/ignore006.py +++ b/test/pacman/tests/ignore006.py @@ -6,5 +6,5 @@ self.addpkg2db("sync", pkg) self.option["IgnorePkg"] = ["package1"] self.args = "--ask=1 -S %s" % pkg.name -self.addrule("PACMAN_RETCODE=0") +self.addrule("PACMAN_RETCODE=1") self.addrule("!PKG_EXIST=package1") diff --git a/test/pacman/tests/pacman005.py b/test/pacman/tests/pacman005.py new file mode 100644 index 00000000..bb21ad4f --- /dev/null +++ b/test/pacman/tests/pacman005.py @@ -0,0 +1,8 @@ +self.description = "Test invalid combination of command line options (-Qy)" + +p = pmpkg("foobar") +self.addpkg2db("local", p) + +self.args = "-Qy" + +self.addrule("PACMAN_RETCODE=1") diff --git a/test/pacman/tests/provision002.py b/test/pacman/tests/provision002.py new file mode 100644 index 00000000..46deb1da --- /dev/null +++ b/test/pacman/tests/provision002.py @@ -0,0 +1,20 @@ +self.description = "-S provision, multiple providers, one installed" + +sp = pmpkg("pkg1", "1.0-2") +sp.provides = ["pkg-env"] +self.addpkg2db("sync", sp) + +sp = pmpkg("pkg2", "1.0-2") +sp.provides = ["pkg-env"] +self.addpkg2db("sync", sp) + +lp = pmpkg("pkg2") +lp.provides = ["pkg-env"] +self.addpkg2db("local", lp) + +self.args = "-S pkg-env" + +self.addrule("PACMAN_RETCODE=0") +self.addrule("!PKG_EXIST=pkg1") +self.addrule("PKG_EXIST=pkg2") +self.addrule("PKG_VERSION=pkg2|1.0-2") diff --git a/test/pacman/tests/provision003.py b/test/pacman/tests/provision003.py new file mode 100644 index 00000000..08647501 --- /dev/null +++ b/test/pacman/tests/provision003.py @@ -0,0 +1,21 @@ +self.description = "-S provision, multiple providers, one installed, different repos" + +sp = pmpkg("pkg1", "1.0-2") +sp.provides = ["pkg-env"] +self.addpkg2db("sync", sp) + +sp = pmpkg("pkg2", "1.0-2") +sp.provides = ["pkg-env"] +# this repo will be sorted second alphabetically +self.addpkg2db("sync2", sp) + +lp = pmpkg("pkg2") +lp.provides = ["pkg-env"] +self.addpkg2db("local", lp) + +self.args = "-S pkg-env" + +self.addrule("PACMAN_RETCODE=0") +self.addrule("!PKG_EXIST=pkg1") +self.addrule("PKG_EXIST=pkg2") +self.addrule("PKG_VERSION=pkg2|1.0-2") diff --git a/test/pacman/tests/provision004.py b/test/pacman/tests/provision004.py new file mode 100644 index 00000000..696fa79f --- /dev/null +++ b/test/pacman/tests/provision004.py @@ -0,0 +1,21 @@ +self.description = "-S literal with provision of same name installed" + +sp = pmpkg("provision", "1.0-2") +sp.provides = ["literal"] +sp.conflicts = ["literal"] +self.addpkg2db("sync", sp) + +sp = pmpkg("literal", "1.0-2") +self.addpkg2db("sync2", sp) + +lp = pmpkg("provision") +lp.provides = ["literal"] +lp.conflicts = ["literal"] +self.addpkg2db("local", lp) + +self.args = "-S literal --ask=4" + +self.addrule("PACMAN_RETCODE=0") +self.addrule("!PKG_EXIST=provision") +self.addrule("PKG_EXIST=literal") +self.addrule("PKG_VERSION=literal|1.0-2") diff --git a/test/pacman/tests/remove002.py b/test/pacman/tests/remove002.py new file mode 100644 index 00000000..1deffb0d --- /dev/null +++ b/test/pacman/tests/remove002.py @@ -0,0 +1,12 @@ +self.description = "Remove a package with several files" + +p = pmpkg("foo") +p.files = ["usr/share/file_%d" % n for n in range(1000)] +self.addpkg2db("local", p) + +self.args = "-R %s" % p.name + +self.addrule("PACMAN_RETCODE=0") +self.addrule("!PKG_EXIST=foo") +self.addrule("!FILE_EXIST=usr/share/file_0") +self.addrule("!FILE_EXIST=usr/share/file_999") diff --git a/test/pacman/tests/scriptlet001.py b/test/pacman/tests/scriptlet001.py index ff7fcd20..1cf9053b 100644 --- a/test/pacman/tests/scriptlet001.py +++ b/test/pacman/tests/scriptlet001.py @@ -15,6 +15,6 @@ self.addrule("PACMAN_RETCODE=0") self.addrule("PACMAN_OUTPUT=" + pre) self.addrule("PACMAN_OUTPUT=" + post) -fakechroot = which("fakechroot") +fakechroot = util.which("fakechroot") if not fakechroot: self.expectfailure = True diff --git a/test/pacman/tests/scriptlet002.py b/test/pacman/tests/scriptlet002.py index cc316a10..59f60427 100644 --- a/test/pacman/tests/scriptlet002.py +++ b/test/pacman/tests/scriptlet002.py @@ -15,6 +15,6 @@ self.addrule("PACMAN_RETCODE=0") self.addrule("PACMAN_OUTPUT=" + pre) self.addrule("PACMAN_OUTPUT=" + post) -fakechroot = which("fakechroot") +fakechroot = util.which("fakechroot") if not fakechroot: self.expectfailure = True diff --git a/test/pacman/tests/smoke001.py b/test/pacman/tests/smoke001.py index c6636391..16576b75 100644 --- a/test/pacman/tests/smoke001.py +++ b/test/pacman/tests/smoke001.py @@ -4,18 +4,17 @@ p = pmpkg("pkg1000") self.addpkg2db("local", p) -for i in range(1000): +for i in xrange(1000): p = pmpkg("pkg%03d" % i) p.depends = ["pkg%03d" % (i+1)] p.files = ["usr/share/pkg%03d" % i] self.addpkg(p) -_list = [] -[_list.append(p.filename()) for p in self.localpkgs] -self.args = "-U %s" % " ".join(_list) +pkglist = [p.filename() for p in self.localpkgs] +self.args = "-U %s" % " ".join(pkglist) self.addrule("PACMAN_RETCODE=0") -#for i in range(1000): +#for i in xrange(1000): # self.addrule("PKG_EXIST=pkg%03d" %i) # picked 3 random packages to test for, since the loop is too much to handle self.addrule("PKG_EXIST=pkg050") diff --git a/test/pacman/tests/smoke002.py b/test/pacman/tests/smoke002.py new file mode 100644 index 00000000..44f2d0ec --- /dev/null +++ b/test/pacman/tests/smoke002.py @@ -0,0 +1,19 @@ +self.description = "Install packages with huge descriptions" + +p1 = pmpkg("pkg1") +p1.desc = 'A' * 500 * 1024 +self.addpkg(p1) + +p2 = pmpkg("pkg2") +p2.desc = 'A' * 600 * 1024 +self.addpkg(p2) + +self.args = "-U %s %s" % (p1.filename(), p2.filename()) + +# Note that the current cutoff on line length is 512K, so the first package +# will succeed while the second one will fail to record the description. +self.addrule("PACMAN_RETCODE=0") +self.addrule("PKG_EXIST=pkg1") +self.addrule("PKG_DESC=pkg1|%s" % p1.desc) +self.addrule("PKG_EXIST=pkg1") +self.addrule("!PKG_DESC=pkg1|%s" % p2.desc) diff --git a/test/pacman/tests/smoke003.py b/test/pacman/tests/smoke003.py new file mode 100644 index 00000000..c2460fbf --- /dev/null +++ b/test/pacman/tests/smoke003.py @@ -0,0 +1,19 @@ +self.description = "Remove a thousand packages in a single transaction" + +for i in xrange(1000): + p = pmpkg("pkg%03dname" % i) + p.files = ["usr/share/pkg%03d/file" % i] + self.addpkg2db("local", p) + +pkglist = ["pkg%03dname" % i for i in xrange(100, 1000)] +self.args = "-R %s" % " ".join(pkglist) + +self.addrule("PACMAN_RETCODE=0") +# picked random packages to test for, since a loop is too much to handle +self.addrule("PKG_EXIST=pkg000name") +self.addrule("PKG_EXIST=pkg050name") +self.addrule("PKG_EXIST=pkg099name") +self.addrule("!PKG_EXIST=pkg100name") +self.addrule("!PKG_EXIST=pkg383name") +self.addrule("!PKG_EXIST=pkg674name") +self.addrule("!PKG_EXIST=pkg999name") diff --git a/test/pacman/tests/sync-nodepversion01.py b/test/pacman/tests/sync-nodepversion01.py new file mode 100644 index 00000000..5829b9ee --- /dev/null +++ b/test/pacman/tests/sync-nodepversion01.py @@ -0,0 +1,16 @@ +self.description = "nodepversion: -Sd works" + +p1 = pmpkg("pkg1", "1.0-2") +p1.depends = ["provision>1.0-1"] +self.addpkg2db("sync", p1) + +p2 = pmpkg("pkg2", "1.0-2") +p2.provides = ["provision=1.0-1"] +self.addpkg2db("sync", p2) + +self.args = "-Sd %s" % p1.name + +self.addrule("PACMAN_RETCODE=0") +self.addrule("PKG_EXIST=pkg1") +self.addrule("PKG_EXIST=pkg2") +self.addrule("PKG_DEPENDS=pkg1|provision>1.0-1") diff --git a/test/pacman/tests/sync-nodepversion02.py b/test/pacman/tests/sync-nodepversion02.py new file mode 100644 index 00000000..6ebbdb7a --- /dev/null +++ b/test/pacman/tests/sync-nodepversion02.py @@ -0,0 +1,15 @@ +self.description = "nodepversion: -S fails" + +p1 = pmpkg("pkg1", "1.0-2") +p1.depends = ["provision>=1.0-2"] +self.addpkg2db("sync", p1) + +p2 = pmpkg("pkg2", "1.0-2") +p2.provides = ["provision=1.0-1"] +self.addpkg2db("sync", p2) + +self.args = "-S %s" % p1.name + +self.addrule("PACMAN_RETCODE=1") +self.addrule("!PKG_EXIST=pkg1") +self.addrule("!PKG_EXIST=pkg2") diff --git a/test/pacman/tests/sync-nodepversion03.py b/test/pacman/tests/sync-nodepversion03.py new file mode 100644 index 00000000..378ff76a --- /dev/null +++ b/test/pacman/tests/sync-nodepversion03.py @@ -0,0 +1,15 @@ +self.description = "nodepversion: -Sdd works but no deps" + +p1 = pmpkg("pkg1", "1.0-2") +p1.depends = ["provision>=1.0-2"] +self.addpkg2db("sync", p1) + +p2 = pmpkg("pkg2", "1.0-2") +p2.provides = ["provision=1.0-1"] +self.addpkg2db("sync", p2) + +self.args = "-Sdd %s" % p1.name + +self.addrule("PACMAN_RETCODE=0") +self.addrule("PKG_EXIST=pkg1") +self.addrule("!PKG_EXIST=pkg2") diff --git a/test/pacman/tests/sync-nodepversion04.py b/test/pacman/tests/sync-nodepversion04.py new file mode 100644 index 00000000..2bf83bb2 --- /dev/null +++ b/test/pacman/tests/sync-nodepversion04.py @@ -0,0 +1,15 @@ +self.description = "nodepversion: provision does not exist" + +p1 = pmpkg("pkg1", "1.0-2") +p1.depends = ["invalid>=1.0-2"] +self.addpkg2db("sync", p1) + +p2 = pmpkg("pkg2", "1.0-2") +p2.provides = ["provision=1.0-1"] +self.addpkg2db("sync", p2) + +self.args = "-Sd %s" % p1.name + +self.addrule("PACMAN_RETCODE=1") +self.addrule("!PKG_EXIST=pkg1") +self.addrule("!PKG_EXIST=pkg2") diff --git a/test/pacman/tests/sync-nodepversion05.py b/test/pacman/tests/sync-nodepversion05.py new file mode 100644 index 00000000..bc048db6 --- /dev/null +++ b/test/pacman/tests/sync-nodepversion05.py @@ -0,0 +1,19 @@ +self.description = "nodepversion: -Sud works" + +p1 = pmpkg("pkg1", "1.0-1") +p1.depends = ["provision=1.0"] +self.addpkg2db("local", p1) + +p2 = pmpkg("pkg2", "1.0-1") +p2.provides = ["provision=1.0"] +self.addpkg2db("local", p2) + +sp2 = pmpkg("pkg2", "1.1-1") +sp2.provides = ["provision=1.1"] +self.addpkg2db("sync", sp2) + +self.args = "-Sud" + +self.addrule("PACMAN_RETCODE=0") +self.addrule("PKG_VERSION=pkg1|1.0-1") +self.addrule("PKG_VERSION=pkg2|1.1-1") diff --git a/test/pacman/tests/sync-nodepversion06.py b/test/pacman/tests/sync-nodepversion06.py new file mode 100644 index 00000000..139b87af --- /dev/null +++ b/test/pacman/tests/sync-nodepversion06.py @@ -0,0 +1,19 @@ +self.description = "nodepversion: -Su fails" + +p1 = pmpkg("pkg1", "1.0-1") +p1.depends = ["provision=1.0"] +self.addpkg2db("local", p1) + +p2 = pmpkg("pkg2", "1.0-1") +p2.provides = ["provision=1.0"] +self.addpkg2db("local", p2) + +sp2 = pmpkg("pkg2", "1.1-1") +sp2.provides = ["provision=1.1"] +self.addpkg2db("sync", sp2) + +self.args = "-Su" + +self.addrule("PACMAN_RETCODE=1") +self.addrule("PKG_VERSION=pkg1|1.0-1") +self.addrule("PKG_VERSION=pkg2|1.0-1") diff --git a/test/pacman/tests/sync023.py b/test/pacman/tests/sync023.py index 8233ab73..3644c9de 100644 --- a/test/pacman/tests/sync023.py +++ b/test/pacman/tests/sync023.py @@ -15,7 +15,8 @@ for p in lp1, lp2, lp3, sp1, sp2, sp3, newp1: for p in lp1, lp2, lp3: self.addpkg2db("local", p) -self.addpkg2db("testing", newp1); +# repos are sorted in alpha order +self.addpkg2db("atesting", newp1); for p in sp1, sp2, sp3: self.addpkg2db("sync", p); diff --git a/test/pacman/tests/sync024.py b/test/pacman/tests/sync024.py new file mode 100644 index 00000000..6d1192f0 --- /dev/null +++ b/test/pacman/tests/sync024.py @@ -0,0 +1,23 @@ +self.description = "Install a group from a sync db repo/group syntax" + +sp1 = pmpkg("pkg1") +sp2 = pmpkg("pkg2") +sp3 = pmpkg("pkg3") +newp1 = pmpkg("pkg1", "1.2-1") + +for p in sp1, sp2, sp3, newp1: + setattr(p, "groups", ["grp"]) + +self.addpkg2db("testing", newp1); + +for p in sp1, sp2, sp3: + self.addpkg2db("sync", p); + +self.args = "-S testing/grp" + +self.addrule("PACMAN_RETCODE=0") +for p in sp2, sp3: + self.addrule("!PKG_EXIST=%s" % p.name) +self.addrule("PKG_EXIST=%s" % newp1.name) +# The newer version should still be installed +self.addrule("PKG_VERSION=pkg1|1.2-1") diff --git a/test/pacman/tests/sync045.py b/test/pacman/tests/sync045.py index 574c0a52..6c31983c 100644 --- a/test/pacman/tests/sync045.py +++ b/test/pacman/tests/sync045.py @@ -1,4 +1,4 @@ -self.description = "Install a sync package conflicting with two local ones (-d)" +self.description = "Install a sync package conflicting with two local ones (-dd)" sp = pmpkg("pkg1") sp.conflicts = ["pkg2", "pkg3"] @@ -10,7 +10,7 @@ self.addpkg2db("local", lp1); lp2 = pmpkg("pkg3") self.addpkg2db("local", lp2); -self.args = "-Sd %s --ask=4" % sp.name +self.args = "-Sdd %s --ask=4" % sp.name self.addrule("PACMAN_RETCODE=0") self.addrule("PKG_EXIST=pkg1") diff --git a/test/pacman/tests/sync101.py b/test/pacman/tests/sync101.py index 5d39ecb9..a4bde3e2 100644 --- a/test/pacman/tests/sync101.py +++ b/test/pacman/tests/sync101.py @@ -1,7 +1,9 @@ self.description = "Sysupgrade with same version for local and sync packages" sp = pmpkg("dummy") +sp.files = ["bin/foo"] lp = pmpkg("dummy") +lp.files = ["bin/foo"] self.addpkg2db("sync", sp) self.addpkg2db("local", lp) @@ -9,4 +11,5 @@ self.addpkg2db("local", lp) self.args = "-Su" self.addrule("PACMAN_RETCODE=0") -self.addrule("!PKG_MODIFIED=dummy") +self.addrule("PKG_VERSION=dummy|1.0-1") +self.addrule("!FILE_MODIFIED=bin/foo") diff --git a/test/pacman/tests/sync102.py b/test/pacman/tests/sync102.py index 40a7ec99..bbd72147 100644 --- a/test/pacman/tests/sync102.py +++ b/test/pacman/tests/sync102.py @@ -1,7 +1,9 @@ self.description = "Sysupgrade with a newer local package" sp = pmpkg("dummy", "0.9-1") +sp.files = ["bin/foo", "bin/bar"] lp = pmpkg("dummy") +lp.files = ["bin/foo", "bin/baz"] self.addpkg2db("sync", sp) self.addpkg2db("local", lp) @@ -9,4 +11,7 @@ self.addpkg2db("local", lp) self.args = "-Su" self.addrule("PACMAN_RETCODE=0") -self.addrule("!PKG_MODIFIED=dummy") +self.addrule("PKG_VERSION=dummy|1.0-1") +self.addrule("FILE_EXIST=bin/foo") +self.addrule("FILE_EXIST=bin/baz") +self.addrule("!FILE_EXIST=bin/bar") diff --git a/test/pacman/tests/sync103.py b/test/pacman/tests/sync103.py index 15e7c8e1..b740294b 100644 --- a/test/pacman/tests/sync103.py +++ b/test/pacman/tests/sync103.py @@ -9,5 +9,5 @@ self.addpkg2db("local", lp) self.args = "-Su" self.addrule("PACMAN_RETCODE=0") -self.addrule("!PKG_MODIFIED=lpkg") +self.addrule("PKG_EXIST=lpkg") self.addrule("!PKG_EXIST=spkg") diff --git a/test/pacman/tests/sync120.py b/test/pacman/tests/sync120.py index 994e440e..d1ace800 100644 --- a/test/pacman/tests/sync120.py +++ b/test/pacman/tests/sync120.py @@ -18,4 +18,4 @@ self.args = "-Su" self.addrule("PACMAN_RETCODE=0") self.addrule("PKG_VERSION=pkg1|1.0-2") -self.addrule("!PKG_MODIFIED=pkg2") +self.addrule("PKG_VERSION=pkg2|1.0-1") diff --git a/test/pacman/tests/sync136.py b/test/pacman/tests/sync136.py index 58d08eb0..b31aae2c 100644 --- a/test/pacman/tests/sync136.py +++ b/test/pacman/tests/sync136.py @@ -1,7 +1,6 @@ self.description = "Sysupgrade with a sync package forcing a downgrade" -sp = pmpkg("dummy", "1.0-1") -sp.force = 1 +sp = pmpkg("dummy", "1:1.0-1") self.addpkg2db("sync", sp) @@ -12,4 +11,4 @@ self.addpkg2db("local", lp) self.args = "-Su" self.addrule("PACMAN_RETCODE=0") -self.addrule("PKG_VERSION=dummy|1.0-1") +self.addrule("PKG_VERSION=dummy|1:1.0-1") diff --git a/test/pacman/tests/sync137.py b/test/pacman/tests/sync137.py index 94caca70..d76ac49d 100644 --- a/test/pacman/tests/sync137.py +++ b/test/pacman/tests/sync137.py @@ -4,8 +4,7 @@ lp = pmpkg("dummy", "1.0-1") self.addpkg2db("local", lp) -sp = pmpkg("dummy", "1.0-2") -sp.force = 1 +sp = pmpkg("dummy", "1:1.0-2") self.addpkg2db("sync", sp) self.args = "-Su --ignore %s" % lp.name diff --git a/test/pacman/tests/sync138.py b/test/pacman/tests/sync138.py index e67c4f46..bef07683 100644 --- a/test/pacman/tests/sync138.py +++ b/test/pacman/tests/sync138.py @@ -19,4 +19,4 @@ self.args = "-Su" self.addrule("PACMAN_RETCODE=0") self.addrule("PKG_VERSION=pkg1|1.0-2") -self.addrule("!PKG_MODIFIED=pkg2") +self.addrule("PKG_VERSION=pkg2|1.0-1") diff --git a/test/pacman/tests/sync407.py b/test/pacman/tests/sync407.py new file mode 100644 index 00000000..a2d30299 --- /dev/null +++ b/test/pacman/tests/sync407.py @@ -0,0 +1,38 @@ +self.description = "FS#7524, versioned dependency resolving with conflict" + +sp1 = pmpkg("compiz-git", "20070626-1") +sp1.depends = ["cairo"] +sp1.groups = ["compiz-fusion"] +self.addpkg2db("sync", sp1) + +sp2 = pmpkg("ccsm-git", "20070626-1") +sp2.depends = ["pygtk"] +sp2.groups = ["compiz-fusion"] +self.addpkg2db("sync", sp2) + +sp3 = pmpkg("pygtk", "2.22.0-1") +sp3.depends = ["pycairo"] +self.addpkg2db("sync", sp3) + +sp4 = pmpkg("pycairo", "1.4.0-2") +sp4.depends = ["cairo>=1.4.6-2"] +self.addpkg2db("sync", sp4) + +sp5 = pmpkg("cairo", "1.4.6-2") +self.addpkg2db("sync", sp5) + +lp1 = pmpkg("cairo-lcd", "1.4.6-1") +lp1.provides = "cairo" +lp1.conflicts = ["cairo"] +self.addpkg2db("local", lp1) + +self.args = "-S compiz-fusion" + +self.addrule("PACMAN_RETCODE=1") +self.addrule("PKG_EXIST=cairo-lcd") +self.addrule("PKG_VERSION=cairo-lcd|1.4.6-1") +self.addrule("!PKG_EXIST=cairo") +self.addrule("!PKG_EXIST=compiz-git") +self.addrule("!PKG_EXIST=ccsm-git") +self.addrule("!PKG_EXIST=pygtk") +self.addrule("!PKG_EXIST=pycairo") diff --git a/test/pacman/tests/sync898.py b/test/pacman/tests/sync898.py index af16801d..8fd59f19 100644 --- a/test/pacman/tests/sync898.py +++ b/test/pacman/tests/sync898.py @@ -14,5 +14,5 @@ self.addpkg2db("local", lp1) self.args = "-S %s" % " ".join([p.name for p in sp1, sp2]) self.addrule("PACMAN_RETCODE=0") -self.addrule("PKG_MODIFIED=pkg1") +self.addrule("PKG_VERSION=pkg1|1.0-2") self.addrule("!PKG_EXIST=pkg2") diff --git a/test/pacman/tests/upgrade001.py b/test/pacman/tests/upgrade001.py index 2a9538e0..2e85ce67 100644 --- a/test/pacman/tests/upgrade001.py +++ b/test/pacman/tests/upgrade001.py @@ -12,7 +12,6 @@ self.addpkg(p) self.args = "-U %s" % p.filename() -self.addrule("PKG_MODIFIED=dummy") self.addrule("PKG_VERSION=dummy|1.0-2") for f in lp.files: self.addrule("FILE_MODIFIED=%s" % f) diff --git a/test/pacman/tests/upgrade002.py b/test/pacman/tests/upgrade002.py index d561d894..c7706efe 100644 --- a/test/pacman/tests/upgrade002.py +++ b/test/pacman/tests/upgrade002.py @@ -12,7 +12,6 @@ self.addpkg(p) self.args = "-U %s" % p.filename() -self.addrule("PKG_MODIFIED=dummy") self.addrule("PKG_VERSION=dummy|1.0-1") for f in lp.files: self.addrule("FILE_MODIFIED=%s" % f) diff --git a/test/pacman/tests/upgrade003.py b/test/pacman/tests/upgrade003.py index a67a2653..284c9f35 100644 --- a/test/pacman/tests/upgrade003.py +++ b/test/pacman/tests/upgrade003.py @@ -12,7 +12,6 @@ self.addpkg(p) self.args = "-U %s" % p.filename() -self.addrule("PKG_MODIFIED=dummy") self.addrule("PKG_VERSION=dummy|1.0-1") for f in lp.files: self.addrule("FILE_MODIFIED=%s" % f) diff --git a/test/pacman/tests/upgrade006.py b/test/pacman/tests/upgrade006.py new file mode 100644 index 00000000..5e5173b5 --- /dev/null +++ b/test/pacman/tests/upgrade006.py @@ -0,0 +1,18 @@ +self.description = "Upgrade a package with several files" + +lp = pmpkg("dummy") +lp.files = ["usr/share/file_%d" % n for n in range(250, 750)] +self.addpkg2db("local", lp) + +p = pmpkg("dummy", "1.1-1") +p.files = ["usr/share/file_%d" % n for n in range(600, 1000)] +self.addpkg(p) + +self.args = "-U %s" % p.filename() + +self.addrule("PACMAN_RETCODE=0") +self.addrule("PKG_VERSION=dummy|1.1-1") +self.addrule("!FILE_EXIST=usr/share/file_250") +self.addrule("!FILE_EXIST=usr/share/file_599") +self.addrule("FILE_EXIST=usr/share/file_600") +self.addrule("FILE_EXIST=usr/share/file_999") diff --git a/test/pacman/tests/upgrade072.py b/test/pacman/tests/upgrade072.py index f88e150c..116103b6 100644 --- a/test/pacman/tests/upgrade072.py +++ b/test/pacman/tests/upgrade072.py @@ -6,7 +6,7 @@ p.files = ["bin/dummy", p.depends = ["dep1"] self.addpkg(p) -self.args = "-Ud %s" % p.filename() +self.args = "-Udd %s" % p.filename() self.addrule("PACMAN_RETCODE=0") self.addrule("PKG_EXIST=dummy") |