From d9bd24c968436f05838614b9069ef4f29645b74a Mon Sep 17 00:00:00 2001 From: Dan McGee Date: Fri, 23 Feb 2007 06:50:42 +0000 Subject: * Changes to quite a few of the tests, mostly minimal changes (better descriptions, additional rules, etc) * One new pactest test regarding file migration between packages. * Fix of a little output bug in pmenv.py --- pactest/pmenv.py | 2 +- pactest/tests/TESTS | 2 ++ pactest/tests/add001.py | 2 +- pactest/tests/add002.py | 2 +- pactest/tests/add003.py | 2 +- pactest/tests/add004.py | 8 +++++++- pactest/tests/add020.py | 2 +- pactest/tests/add021.py | 2 +- pactest/tests/add032.py | 2 +- pactest/tests/add040.py | 2 +- pactest/tests/add042.py | 8 ++++---- pactest/tests/add050.py | 1 + pactest/tests/dummy001.py | 4 +++- pactest/tests/query001.py | 3 ++- pactest/tests/remove010.py | 5 +++-- pactest/tests/remove011.py | 5 +++-- pactest/tests/remove020.py | 5 +++-- pactest/tests/remove021.py | 5 +++-- pactest/tests/remove030.py | 3 ++- pactest/tests/smoke001.py | 4 ++++ pactest/tests/sync001.py | 3 ++- pactest/tests/sync002.py | 3 ++- pactest/tests/sync003.py | 3 ++- pactest/tests/sync009.py | 3 ++- pactest/tests/sync010.py | 11 +++++++---- pactest/tests/sync020.py | 2 +- pactest/tests/sync021.py | 2 +- pactest/tests/sync040.py | 4 ++-- pactest/tests/sync041.py | 2 +- pactest/tests/sync042.py | 2 +- pactest/tests/sync043.py | 14 +++++++++----- pactest/tests/sync050.py | 3 ++- pactest/tests/sync103.py | 3 +-- pactest/tests/sync200.py | 2 +- pactest/tests/sync890.py | 2 +- pactest/tests/sync891.py | 2 +- pactest/tests/sync892.py | 2 +- pactest/tests/sync893.py | 4 ++-- pactest/tests/sync897.py | 2 +- pactest/tests/sync898.py | 4 ++-- pactest/tests/sync990.py | 2 +- pactest/tests/sync992.py | 2 +- pactest/tests/upgrade003.py | 2 +- pactest/tests/upgrade020.py | 2 +- pactest/tests/upgrade030.py | 1 - pactest/tests/upgrade040.py | 7 ++++++- pactest/tests/upgrade041.py | 30 ++++++++++++++++++++++++++++++ 47 files changed, 127 insertions(+), 61 deletions(-) create mode 100644 pactest/tests/upgrade041.py diff --git a/pactest/pmenv.py b/pactest/pmenv.py index 2fac5da5..9ea39676 100755 --- a/pactest/pmenv.py +++ b/pactest/pmenv.py @@ -100,7 +100,7 @@ def results(self): passed += 1 else: print "[FAILED]", - print test.name.strip(".py").ljust(33), + print test.name.replace(".py", "").ljust(33), print "Rules:", print "OK = %2u FAIL = %2u SKIP = %2u" % \ (success, fail, rules - (success + fail)) diff --git a/pactest/tests/TESTS b/pactest/tests/TESTS index 67343750..e09a78b9 100644 --- a/pactest/tests/TESTS +++ b/pactest/tests/TESTS @@ -1,3 +1,5 @@ +TODO: this is really outdated, needs regeneration (after we rename tests) + add001: Install a package add002: Install a package (already installed) add003: Install a set of packages diff --git a/pactest/tests/add001.py b/pactest/tests/add001.py index 159a54a3..3dde4061 100644 --- a/pactest/tests/add001.py +++ b/pactest/tests/add001.py @@ -1,4 +1,4 @@ -self.description = "Install a package" +self.description = "Install a simple package with two files" p = pmpkg("dummy") p.files = ["bin/dummy", diff --git a/pactest/tests/add002.py b/pactest/tests/add002.py index 2ec90644..f6bc91a2 100644 --- a/pactest/tests/add002.py +++ b/pactest/tests/add002.py @@ -1,4 +1,4 @@ -self.description = "Install a package (already installed)" +self.description = "Install an already-installed package" lp = pmpkg("dummy") lp.files = ["bin/dummy", diff --git a/pactest/tests/add003.py b/pactest/tests/add003.py index bde87649..4f8ae600 100644 --- a/pactest/tests/add003.py +++ b/pactest/tests/add003.py @@ -1,4 +1,4 @@ -self.description = "Install a set of packages" +self.description = "Install a set of three packages" p1 = pmpkg("pkg1") p1.files = ["bin/pkg1", diff --git a/pactest/tests/add004.py b/pactest/tests/add004.py index 59ba45c6..d0188563 100644 --- a/pactest/tests/add004.py +++ b/pactest/tests/add004.py @@ -1,8 +1,12 @@ -self.description = "Install a set of the same package at different versions" +self.description = "Install three of the same package at different versions" p1 = pmpkg("dummy", "1.0-2") +p1.files = ["bin/dummy"] p2 = pmpkg("dummy", "2.0-1") +p2.files = ["bin/dummy"] p3 = pmpkg("dummy") +p3.files = ["bin/dummy"] + for p in p1, p2, p3: self.addpkg(p) @@ -10,3 +14,5 @@ self.addrule("PACMAN_RETCODE=0") self.addrule("PKG_VERSION=dummy|2.0-1") +for f in p2.files: + self.addrule("FILE_EXIST=%s" % f) diff --git a/pactest/tests/add020.py b/pactest/tests/add020.py index b435ddde..8a2f4a71 100644 --- a/pactest/tests/add020.py +++ b/pactest/tests/add020.py @@ -1,4 +1,4 @@ -self.description = "Install a package with an existing file" +self.description = "Install a package with an existing file (--force)" p = pmpkg("dummy") p.files = ["etc/dummy.conf"] diff --git a/pactest/tests/add021.py b/pactest/tests/add021.py index ab96d156..a6dda963 100644 --- a/pactest/tests/add021.py +++ b/pactest/tests/add021.py @@ -1,4 +1,4 @@ -self.description = "Install a package with an existing file (new modified)" +self.description = "Install a package with an existing file (--force, new modified)" p = pmpkg("dummy") p.files = ["etc/dummy.conf*"] diff --git a/pactest/tests/add032.py b/pactest/tests/add032.py index 00d9a6d0..2c5a11fa 100644 --- a/pactest/tests/add032.py +++ b/pactest/tests/add032.py @@ -1,4 +1,4 @@ -self.description = "Freshen a package (installed is newer)" +self.description = "Freshen a package (installed is same)" lp = pmpkg("dummy") lp.files = ["bin/dummy", diff --git a/pactest/tests/add040.py b/pactest/tests/add040.py index 2bb7f91b..6d6da602 100644 --- a/pactest/tests/add040.py +++ b/pactest/tests/add040.py @@ -3,7 +3,7 @@ p = pmpkg("dummy") p.files = ["bin/dummy", "usr/man/man1/dummy.1"] -p.depends = ["missdep"] +p.depends = ["dep1"] self.addpkg(p) self.args = "-A %s" % p.filename() diff --git a/pactest/tests/add042.py b/pactest/tests/add042.py index a9b17c0f..48104b0c 100644 --- a/pactest/tests/add042.py +++ b/pactest/tests/add042.py @@ -19,11 +19,11 @@ self.addrule("PACMAN_RETCODE=0") self.addrule("PKG_VERSION=dummy|1.0-2") -for f in p1.files: - self.addrule("FILE_EXIST=%s" % f) -self.addrule("PKG_EXIST=dep1") -self.addrule("PKG_EXIST=dep2") self.addrule("PKG_DEPENDS=dummy|dep1") self.addrule("PKG_DEPENDS=dep1|dep2") self.addrule("PKG_REQUIREDBY=dep1|dummy") self.addrule("PKG_REQUIREDBY=dep2|dep1") +for p in p1, p2, p3: + self.addrule("PKG_EXIST=%s" % p.name) + for f in p.files: + self.addrule("FILE_EXIST=%s" % f) diff --git a/pactest/tests/add050.py b/pactest/tests/add050.py index f9b3b251..b48459ab 100644 --- a/pactest/tests/add050.py +++ b/pactest/tests/add050.py @@ -2,6 +2,7 @@ p = pmpkg("dummy") p.files = ["etc/dummy.conf"] +p.backup = ["etc/dummy.conf"] self.addpkg(p) self.filesystem = ["etc/dummy.conf"] diff --git a/pactest/tests/dummy001.py b/pactest/tests/dummy001.py index 79e2bd00..85a5d99c 100644 --- a/pactest/tests/dummy001.py +++ b/pactest/tests/dummy001.py @@ -1,4 +1,4 @@ -self.description = "dummy test case" +self.description = "Dummy test case (modify for own use)" p1 = pmpkg("dummy") p1.files = ["etc/dummy.conf*", @@ -17,3 +17,5 @@ #self.addpkg(p2) self.args = "-U %s" % p1.filename() + +self.addrule("PACMAN_RETCODE=0") diff --git a/pactest/tests/query001.py b/pactest/tests/query001.py index fe689104..315af84a 100644 --- a/pactest/tests/query001.py +++ b/pactest/tests/query001.py @@ -4,6 +4,7 @@ p.files = ["bin/foobar"] self.addpkg2db("local", p) -self.args = "-Q foobar" +self.args = "-Q %s" % p.name +self.addrule("PACMAN_RETCODE=0") self.addrule("PACMAN_OUTPUT=foobar") diff --git a/pactest/tests/remove010.py b/pactest/tests/remove010.py index aff46f0e..f818f5b3 100644 --- a/pactest/tests/remove010.py +++ b/pactest/tests/remove010.py @@ -1,12 +1,13 @@ -self.description = "Remove a package, with a file marked for backup" +self.description = "Remove a package with a file marked for backup" p1 = pmpkg("dummy") p1.files = ["etc/dummy.conf"] p1.backup = ["etc/dummy.conf"] self.addpkg2db("local", p1) -self.args = "-R dummy" +self.args = "-R %s" % p1.name +self.addrule("PACMAN_RETCODE=0") self.addrule("!PKG_EXIST=dummy") self.addrule("!FILE_EXIST=etc/dummy.conf") self.addrule("FILE_PACSAVE=etc/dummy.conf") diff --git a/pactest/tests/remove011.py b/pactest/tests/remove011.py index afc03d45..3e559bf9 100644 --- a/pactest/tests/remove011.py +++ b/pactest/tests/remove011.py @@ -1,12 +1,13 @@ -self.description = "Remove a package, with a modified file marked for backup" +self.description = "Remove a package with a modified file marked for backup" p1 = pmpkg("dummy") p1.files = ["etc/dummy.conf*"] p1.backup = ["etc/dummy.conf"] self.addpkg2db("local", p1) -self.args = "-R dummy" +self.args = "-R %s" % p1.name +self.addrule("PACMAN_RETCODE=0") self.addrule("!PKG_EXIST=dummy") self.addrule("!FILE_EXIST=etc/dummy.conf") self.addrule("FILE_PACSAVE=etc/dummy.conf") diff --git a/pactest/tests/remove020.py b/pactest/tests/remove020.py index 293ad1bd..246cb478 100644 --- a/pactest/tests/remove020.py +++ b/pactest/tests/remove020.py @@ -1,12 +1,13 @@ -self.description = "Remove a package, with a file marked for backup (--nosave)" +self.description = "Remove a package with a file marked for backup (--nosave)" p1 = pmpkg("dummy") p1.files = ["etc/dummy.conf"] p1.backup = ["etc/dummy.conf"] self.addpkg2db("local", p1) -self.args = "-Rn dummy" +self.args = "-R %s" % p1.name +self.addrule("PACMAN_RETCODE=0") self.addrule("!PKG_EXIST=dummy") self.addrule("!FILE_EXIST=etc/dummy.conf") self.addrule("!FILE_PACSAVE=etc/dummy.conf") diff --git a/pactest/tests/remove021.py b/pactest/tests/remove021.py index 388bf018..cdbbe3b1 100644 --- a/pactest/tests/remove021.py +++ b/pactest/tests/remove021.py @@ -1,12 +1,13 @@ -self.description = "Remove a package, with a modified file marked for backup (--nosave)" +self.description = "Remove a package with a modified file marked for backup (--nosave)" p1 = pmpkg("dummy") p1.files = ["etc/dummy.conf*"] p1.backup = ["etc/dummy.conf"] self.addpkg2db("local", p1) -self.args = "-Rn dummy" +self.args = "-R %s" % p1.name +self.addrule("PACMAN_RETCODE=0") self.addrule("!PKG_EXIST=dummy") self.addrule("!FILE_EXIST=etc/dummy.conf") self.addrule("!FILE_PACSAVE=etc/dummy.conf") diff --git a/pactest/tests/remove030.py b/pactest/tests/remove030.py index ff81a263..cc23f144 100644 --- a/pactest/tests/remove030.py +++ b/pactest/tests/remove030.py @@ -5,8 +5,9 @@ self.option["holdpkg"] = ["dummy"] -self.args = "-R dummy" +self.args = "-R %s" % p1.name +self.addrule("PACMAN_RETCODE=0") self.addrule("!PKG_EXIST=dummy") self.addrule("!FILE_EXIST=etc/dummy.conf") self.addrule("!FILE_PACSAVE=etc/dummy.conf") diff --git a/pactest/tests/smoke001.py b/pactest/tests/smoke001.py index 85ee782b..71a08d3f 100644 --- a/pactest/tests/smoke001.py +++ b/pactest/tests/smoke001.py @@ -17,3 +17,7 @@ self.addrule("PACMAN_RETCODE=0") #for i in range(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") +self.addrule("PKG_EXIST=pkg674") +self.addrule("PKG_EXIST=pkg999") diff --git a/pactest/tests/sync001.py b/pactest/tests/sync001.py index fc2015d4..0f5fdcfb 100644 --- a/pactest/tests/sync001.py +++ b/pactest/tests/sync001.py @@ -5,8 +5,9 @@ "usr/man/man1/dummy.1"] self.addpkg2db("sync", sp) -self.args = "-S dummy" +self.args = "-S %s" % sp.name +self.addrule("PACMAN_RETCODE=0") self.addrule("PKG_EXIST=dummy") for f in sp.files: self.addrule("FILE_EXIST=%s" % f) diff --git a/pactest/tests/sync002.py b/pactest/tests/sync002.py index 43c99fbd..a183f911 100644 --- a/pactest/tests/sync002.py +++ b/pactest/tests/sync002.py @@ -10,8 +10,9 @@ "usr/man/man1/dummy.1"] self.addpkg2db("local", lp) -self.args = "-S dummy" +self.args = "-S %s" % sp.name +self.addrule("PACMAN_RETCODE=0") self.addrule("PKG_VERSION=dummy|1.0-2") for f in lp.files: self.addrule("FILE_MODIFIED=%s" % f) diff --git a/pactest/tests/sync003.py b/pactest/tests/sync003.py index 3a480adf..b21cbcaa 100644 --- a/pactest/tests/sync003.py +++ b/pactest/tests/sync003.py @@ -7,6 +7,7 @@ self.filesystem = ["bin/dummy"] -self.args = "-S dummy" +self.args = "-S %s" % sp.name +self.addrule("PACMAN_RETCODE=1") self.addrule("!PKG_EXIST=dummy") diff --git a/pactest/tests/sync009.py b/pactest/tests/sync009.py index fc2015d4..0f5fdcfb 100644 --- a/pactest/tests/sync009.py +++ b/pactest/tests/sync009.py @@ -5,8 +5,9 @@ "usr/man/man1/dummy.1"] self.addpkg2db("sync", sp) -self.args = "-S dummy" +self.args = "-S %s" % sp.name +self.addrule("PACMAN_RETCODE=0") self.addrule("PKG_EXIST=dummy") for f in sp.files: self.addrule("FILE_EXIST=%s" % f) diff --git a/pactest/tests/sync010.py b/pactest/tests/sync010.py index 9e54eb62..7ddc1492 100644 --- a/pactest/tests/sync010.py +++ b/pactest/tests/sync010.py @@ -1,4 +1,4 @@ -self.description = "Install a package from a sync db, with its dependencies" +self.description = "Install a package from a sync db with cascaded dependencies" sp1 = pmpkg("dummy", "1.0-2") sp1.files = ["bin/dummy", @@ -15,12 +15,15 @@ for p in sp1, sp2, sp3: self.addpkg2db("sync", p); -self.args = "-S dummy" +self.args = "-S %s" % sp1.name +self.addrule("PACMAN_RETCODE=0") self.addrule("PKG_VERSION=dummy|1.0-2") self.addrule("PKG_DEPENDS=dummy|dep1") -for f in sp1.files: - self.addrule("FILE_EXIST=%s" % f) +for p in sp1, sp2, sp3: + self.addrule("PKG_EXIST=%s" % p.name) + for f in p.files: + self.addrule("FILE_EXIST=%s" % f) self.addrule("PKG_DEPENDS=dep1|dep2") self.addrule("PKG_REQUIREDBY=dep1|dummy") self.addrule("PKG_REQUIREDBY=dep2|dep1") diff --git a/pactest/tests/sync020.py b/pactest/tests/sync020.py index eae699fe..0f2a0413 100644 --- a/pactest/tests/sync020.py +++ b/pactest/tests/sync020.py @@ -12,7 +12,7 @@ for p in sp1, sp2, sp3: self.addpkg2db("sync", p); -self.args = "-S grp" +self.args = "-S %s" % "grp" self.addrule("PACMAN_RETCODE=0") for p in sp1, sp2, sp3: diff --git a/pactest/tests/sync021.py b/pactest/tests/sync021.py index d8a5475b..a4073eed 100644 --- a/pactest/tests/sync021.py +++ b/pactest/tests/sync021.py @@ -1,4 +1,4 @@ -self.description = "Install a group from a sync db, with a package in IgnorePkg" +self.description = "Install a group from a sync db with a package in IgnorePkg" sp1 = pmpkg("pkg1") sp1.groups = ["grp"] diff --git a/pactest/tests/sync040.py b/pactest/tests/sync040.py index 73f6ee63..e5641fe0 100644 --- a/pactest/tests/sync040.py +++ b/pactest/tests/sync040.py @@ -1,4 +1,4 @@ -self.description = "Install two targets with a conflict" +self.description = "Install two targets from a sync db with a conflict" sp1 = pmpkg("pkg1") sp1.conflicts = ["pkg2"] @@ -8,7 +8,7 @@ for p in sp1, sp2: self.addpkg2db("sync", p); -self.args = "-S pkg1 pkg2" +self.args = "-S %s" % " ".join([p.name for p in sp1, sp2]) self.addrule("PACMAN_RETCODE=1") for p in sp1, sp2: diff --git a/pactest/tests/sync041.py b/pactest/tests/sync041.py index a612e71f..328728e2 100644 --- a/pactest/tests/sync041.py +++ b/pactest/tests/sync041.py @@ -9,7 +9,7 @@ for p in sp1, sp2: self.addpkg2db("sync", p); -self.args = "-S pkg1 pkg2" +self.args = "-S %s" % " ".join([p.name for p in sp1, sp2]) self.addrule("PACMAN_RETCODE=1") self.addrule("!PKG_EXIST=pkg1") diff --git a/pactest/tests/sync042.py b/pactest/tests/sync042.py index 200626d3..0aa7e37b 100644 --- a/pactest/tests/sync042.py +++ b/pactest/tests/sync042.py @@ -7,7 +7,7 @@ lp = pmpkg("pkg2") self.addpkg2db("local", lp); -self.args = "-S pkg1" +self.args = "-S %s" % sp.name self.addrule("PACMAN_RETCODE=0") self.addrule("PKG_EXIST=pkg1") diff --git a/pactest/tests/sync043.py b/pactest/tests/sync043.py index 200626d3..1302bf04 100644 --- a/pactest/tests/sync043.py +++ b/pactest/tests/sync043.py @@ -1,14 +1,18 @@ -self.description = "Install a sync package conflicting with a local one" +self.description = "Install a sync package conflicting with two local ones" sp = pmpkg("pkg1") -sp.conflicts = ["pkg2"] +sp.conflicts = ["pkg2", "pkg3"] self.addpkg2db("sync", sp); -lp = pmpkg("pkg2") -self.addpkg2db("local", lp); +lp1 = pmpkg("pkg2") +self.addpkg2db("local", lp1); -self.args = "-S pkg1" +lp1 = pmpkg("pkg3") +self.addpkg2db("local", lp1); + +self.args = "-S %s" % sp.name self.addrule("PACMAN_RETCODE=0") self.addrule("PKG_EXIST=pkg1") self.addrule("!PKG_EXIST=pkg2") +self.addrule("!PKG_EXIST=pkg3") diff --git a/pactest/tests/sync050.py b/pactest/tests/sync050.py index 6c7619be..1ed697f3 100644 --- a/pactest/tests/sync050.py +++ b/pactest/tests/sync050.py @@ -4,7 +4,8 @@ sp1.provides = ["pkg2"] self.addpkg2db("sync", sp1); -self.args = "-S pkg2" +self.args = "-S %s" % sp1.name self.addrule("PACMAN_RETCODE=0") self.addrule("PKG_EXIST=pkg1") +self.addrule("!PKG_EXIST=pkg2") diff --git a/pactest/tests/sync103.py b/pactest/tests/sync103.py index 5d17790b..15e7c8e1 100644 --- a/pactest/tests/sync103.py +++ b/pactest/tests/sync103.py @@ -1,14 +1,13 @@ self.description = "Sysupgrade with a local package not existing in sync db" sp = pmpkg("spkg") - self.addpkg2db("sync", sp) lp = pmpkg("lpkg") - self.addpkg2db("local", lp) self.args = "-Su" self.addrule("PACMAN_RETCODE=0") self.addrule("!PKG_MODIFIED=lpkg") +self.addrule("!PKG_EXIST=spkg") diff --git a/pactest/tests/sync200.py b/pactest/tests/sync200.py index 82f30da1..9005bd3d 100644 --- a/pactest/tests/sync200.py +++ b/pactest/tests/sync200.py @@ -1,4 +1,4 @@ -self.description = "Synchronize database" +self.description = "Synchronize the local database" sp1 = pmpkg("spkg1", "1.0-1") sp1.depends = ["spkg2"] diff --git a/pactest/tests/sync890.py b/pactest/tests/sync890.py index 0613128e..75947e9a 100644 --- a/pactest/tests/sync890.py +++ b/pactest/tests/sync890.py @@ -12,7 +12,7 @@ for p in lp1, lp2: self.addpkg2db("local", p) -self.args = "-S pkg3" +self.args = "-S %s" % sp.name self.addrule("PACMAN_RETCODE=0") self.addrule("PKG_EXIST=pkg1") diff --git a/pactest/tests/sync891.py b/pactest/tests/sync891.py index 7810ac93..9b99e94a 100644 --- a/pactest/tests/sync891.py +++ b/pactest/tests/sync891.py @@ -14,7 +14,7 @@ for p in lp1, lp2: self.addpkg2db("local", p) -self.args = "-S pkg2 pkg3" +self.args = "-S %s" % " ".join([p.name for p in sp1, sp2]) self.addrule("PACMAN_RETCODE=0") self.addrule("PKG_EXIST=pkg1") diff --git a/pactest/tests/sync892.py b/pactest/tests/sync892.py index 9d37d682..04cc79c5 100644 --- a/pactest/tests/sync892.py +++ b/pactest/tests/sync892.py @@ -16,7 +16,7 @@ for p in lp1, lp2: self.addpkg2db("local", p) -self.args = "-S pkg2 pkg3" +self.args = "-S %s" % " ".join([p.name for p in sp1, sp2]) self.addrule("PACMAN_RETCODE=0") self.addrule("!PKG_EXIST=pkg1") diff --git a/pactest/tests/sync893.py b/pactest/tests/sync893.py index 7ab55383..9420b74c 100644 --- a/pactest/tests/sync893.py +++ b/pactest/tests/sync893.py @@ -1,4 +1,4 @@ -self.description = "conflict (bug)" +self.description = "conflict 'db vs db'" sp1 = pmpkg("pkg1", "1.0-2") sp1.conflicts = ["pkg2"] @@ -13,7 +13,7 @@ lp2 = pmpkg("pkg2") self.addpkg2db("local", lp2) -self.args = "-S pkg1 pkg2" +self.args = "-S %s" % " ".join([p.name for p in sp1, sp2]) self.addrule("PACMAN_RETCODE=0") self.addrule("PKG_EXIST=pkg1") diff --git a/pactest/tests/sync897.py b/pactest/tests/sync897.py index 0a5433cd..146e372b 100644 --- a/pactest/tests/sync897.py +++ b/pactest/tests/sync897.py @@ -1,4 +1,4 @@ -self.description = "System upgrade" +self.description = "System upgrade with package conflicts" sp1 = pmpkg("pkg1", "1.0-2") sp1.conflicts = ["pkg2"] diff --git a/pactest/tests/sync898.py b/pactest/tests/sync898.py index 5917e825..af16801d 100644 --- a/pactest/tests/sync898.py +++ b/pactest/tests/sync898.py @@ -1,4 +1,4 @@ -self.description = "System upgrade" +self.description = "System upgrade with conflicts and provides" sp1 = pmpkg("pkg1", "1.0-2") sp1.conflicts = ["pkg2"] @@ -11,7 +11,7 @@ lp1 = pmpkg("pkg1") self.addpkg2db("local", lp1) -self.args = "-S pkg1 pkg2" +self.args = "-S %s" % " ".join([p.name for p in sp1, sp2]) self.addrule("PACMAN_RETCODE=0") self.addrule("PKG_MODIFIED=pkg1") diff --git a/pactest/tests/sync990.py b/pactest/tests/sync990.py index 1bf532c5..ee6a590b 100644 --- a/pactest/tests/sync990.py +++ b/pactest/tests/sync990.py @@ -12,7 +12,7 @@ for p in sp1, sp2, sp3: self.addpkg2db("sync", p) -self.args = "-S pkg1 pkg2" +self.args = "-S %s" % " ".join([p.name for p in sp1, sp2]) self.addrule("PACMAN_RETCODE=0") self.addrule("PKG_EXIST=pkg1") diff --git a/pactest/tests/sync992.py b/pactest/tests/sync992.py index fc07f0cc..a7ad1110 100644 --- a/pactest/tests/sync992.py +++ b/pactest/tests/sync992.py @@ -15,7 +15,7 @@ lp1 = pmpkg("pkg2", "0.1-1") self.addpkg2db("local", lp1) -self.args = "-S pkg1 pkg2" +self.args = "-S %s" % " ".join([p.name for p in sp1, sp2]) self.addrule("PACMAN_RETCODE=0") self.addrule("PKG_EXIST=pkg1") diff --git a/pactest/tests/upgrade003.py b/pactest/tests/upgrade003.py index dac21e59..a67a2653 100644 --- a/pactest/tests/upgrade003.py +++ b/pactest/tests/upgrade003.py @@ -1,4 +1,4 @@ -self.description = "Upgrade a package (lesser version)" +self.description = "Upgrade a package (older version)" lp = pmpkg("dummy", "1.0-2") lp.files = ["bin/dummy", diff --git a/pactest/tests/upgrade020.py b/pactest/tests/upgrade020.py index bab00381..ab5fe225 100644 --- a/pactest/tests/upgrade020.py +++ b/pactest/tests/upgrade020.py @@ -1,4 +1,4 @@ -self.description = "Upgrade a package, with a file in 'backup' (new modified)" +self.description = "Upgrade a package, with a file in 'backup' (local unchanged, new modified)" lp = pmpkg("dummy") lp.files = ["etc/dummy.conf"] diff --git a/pactest/tests/upgrade030.py b/pactest/tests/upgrade030.py index 1082c32b..8a6c473b 100644 --- a/pactest/tests/upgrade030.py +++ b/pactest/tests/upgrade030.py @@ -15,7 +15,6 @@ self.addpkg(p) self.args = "-U %s" % " ".join([p.filename() for p in p1, p2]) -#self.args = "-Qi %s" % " ".join([p.name for p in lp1, lp2]) self.addrule("PACMAN_RETCODE=0") self.addrule("PKG_REASON=pkg1|0") diff --git a/pactest/tests/upgrade040.py b/pactest/tests/upgrade040.py index 6946882e..bc40f337 100644 --- a/pactest/tests/upgrade040.py +++ b/pactest/tests/upgrade040.py @@ -1,4 +1,4 @@ -self.description = "file relocation 1" +self.description = "File relocation between two packages" lp1 = pmpkg("dummy") lp1.files = ["bin/dummy", @@ -23,3 +23,8 @@ self.args = "-U %s" % " ".join([p.filename() for p in p1, p2]) self.addrule("PACMAN_RETCODE=0") +for p in p1, p2: + self.addrule("PKG_EXIST=%s" % p.name) +self.addrule("FILE_MODIFIED=bin/dummy") +self.addrule("FILE_MODIFIED=bin/foobar") +self.addrule("FILE_MODIFIED=usr/share/file") diff --git a/pactest/tests/upgrade041.py b/pactest/tests/upgrade041.py new file mode 100644 index 00000000..347c2c4b --- /dev/null +++ b/pactest/tests/upgrade041.py @@ -0,0 +1,30 @@ +self.description = "File relocation between two packages (reverse order)" + +lp1 = pmpkg("dummy") +lp1.files = ["bin/dummy"] + +lp2 = pmpkg("foobar") +lp2.files = ["bin/foobar" + "usr/share/file"] + +for p in lp1, lp2: + self.addpkg2db("local", p) + +p1 = pmpkg("dummy") +p1.files = ["bin/dummy", + "usr/share/file"] + +p2 = pmpkg("foobar") +p2.files = ["bin/foobar"] + +for p in p1, p2: + self.addpkg(p) + +self.args = "-U %s" % " ".join([p.filename() for p in p1, p2]) + +self.addrule("PACMAN_RETCODE=0") +for p in p1, p2: + self.addrule("PKG_EXIST=%s" % p.name) +self.addrule("FILE_MODIFIED=bin/dummy") +self.addrule("FILE_MODIFIED=bin/foobar") +self.addrule("FILE_MODIFIED=usr/share/file") -- cgit v1.2.3-54-g00ecf