1
0
mirror of https://github.com/moparisthebest/pacman synced 2024-12-22 15:58:50 -05:00

* 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
This commit is contained in:
Dan McGee 2007-02-23 06:50:42 +00:00
parent 2f32a02f9d
commit d9bd24c968
47 changed files with 127 additions and 61 deletions

View File

@ -100,7 +100,7 @@ class pmenv:
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))

View File

@ -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

View File

@ -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",

View File

@ -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",

View File

@ -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",

View File

@ -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.args = "-A %s" % " ".join([p.filename() for p in p1, p2, p3])
self.addrule("PACMAN_RETCODE=0")
self.addrule("PKG_VERSION=dummy|2.0-1")
for f in p2.files:
self.addrule("FILE_EXIST=%s" % f)

View File

@ -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"]

View File

@ -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*"]

View File

@ -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",

View File

@ -3,7 +3,7 @@ self.description = "Install a package with a missing dependency"
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()

View File

@ -19,11 +19,11 @@ self.args = "-A %s" % " ".join([p.filename() for p in p1, p2, p3])
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)

View File

@ -2,6 +2,7 @@ self.description = "Install a package with a file in NoUpgrade"
p = pmpkg("dummy")
p.files = ["etc/dummy.conf"]
p.backup = ["etc/dummy.conf"]
self.addpkg(p)
self.filesystem = ["etc/dummy.conf"]

View File

@ -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(p1)
#self.addpkg(p2)
self.args = "-U %s" % p1.filename()
self.addrule("PACMAN_RETCODE=0")

View File

@ -4,6 +4,7 @@ p = pmpkg("foobar")
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")

View File

@ -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")

View File

@ -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")

View File

@ -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")

View File

@ -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")

View File

@ -5,8 +5,9 @@ self.addpkg2db("local", p1)
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")

View File

@ -17,3 +17,7 @@ self.args = "-A %s" % " ".join(_list)
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")

View File

@ -5,8 +5,9 @@ sp.files = ["bin/dummy",
"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)

View File

@ -10,8 +10,9 @@ lp.files = ["bin/dummy",
"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)

View File

@ -7,6 +7,7 @@ self.addpkg2db("sync", sp)
self.filesystem = ["bin/dummy"]
self.args = "-S dummy"
self.args = "-S %s" % sp.name
self.addrule("PACMAN_RETCODE=1")
self.addrule("!PKG_EXIST=dummy")

View File

@ -5,8 +5,9 @@ sp.files = ["bin/dummy",
"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)

View File

@ -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 @@ sp3.files = ["bin/dep2"]
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")

View File

@ -12,7 +12,7 @@ sp3.groups = ["grp"]
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:

View File

@ -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"]

View File

@ -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 @@ sp2 = pmpkg("pkg2")
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:

View File

@ -9,7 +9,7 @@ sp2.conflicts = ["pkg1"]
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")

View File

@ -7,7 +7,7 @@ self.addpkg2db("sync", sp);
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")

View File

@ -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")

View File

@ -4,7 +4,8 @@ sp1 = pmpkg("pkg1")
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")

View File

@ -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")

View File

@ -1,4 +1,4 @@
self.description = "Synchronize database"
self.description = "Synchronize the local database"
sp1 = pmpkg("spkg1", "1.0-1")
sp1.depends = ["spkg2"]

View File

@ -12,7 +12,7 @@ lp2.conflicts = ["pkg3"]
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")

View File

@ -14,7 +14,7 @@ lp2.conflicts = ["pkg3"]
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")

View File

@ -16,7 +16,7 @@ lp2.conflicts = ["pkg3"]
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")

View File

@ -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 @@ self.addpkg2db("local", lp1)
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")

View File

@ -1,4 +1,4 @@
self.description = "System upgrade"
self.description = "System upgrade with package conflicts"
sp1 = pmpkg("pkg1", "1.0-2")
sp1.conflicts = ["pkg2"]

View File

@ -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 @@ self.addpkg2db("sync", sp2)
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")

View File

@ -12,7 +12,7 @@ sp3.provides = ["pkg2"]
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")

View File

@ -15,7 +15,7 @@ for p in sp1, sp2, sp3:
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")

View File

@ -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",

View File

@ -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"]

View File

@ -15,7 +15,6 @@ for p in p1, p2:
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")

View File

@ -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 @@ for p in p1, p2:
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")

View File

@ -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")