summaryrefslogtreecommitdiff
path: root/test/pacman/tests
diff options
context:
space:
mode:
Diffstat (limited to 'test/pacman/tests')
-rw-r--r--test/pacman/tests/database012.py8
-rw-r--r--test/pacman/tests/epoch001.py12
-rw-r--r--test/pacman/tests/epoch002.py12
-rw-r--r--test/pacman/tests/epoch003.py12
-rw-r--r--test/pacman/tests/epoch004.py16
-rw-r--r--test/pacman/tests/epoch010.py12
-rw-r--r--test/pacman/tests/epoch011.py12
-rw-r--r--test/pacman/tests/epoch012.py13
-rw-r--r--test/pacman/tests/ignore001.py2
-rw-r--r--test/pacman/tests/pacman005.py8
-rw-r--r--test/pacman/tests/remove002.py12
-rw-r--r--test/pacman/tests/smoke002.py19
-rw-r--r--test/pacman/tests/sync024.py23
-rw-r--r--test/pacman/tests/sync136.py5
-rw-r--r--test/pacman/tests/sync137.py3
-rw-r--r--test/pacman/tests/sync407.py38
-rw-r--r--test/pacman/tests/upgrade006.py18
17 files changed, 212 insertions, 13 deletions
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/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/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/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/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/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/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/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")