summaryrefslogtreecommitdiff
path: root/test/pacman/tests
diff options
context:
space:
mode:
Diffstat (limited to 'test/pacman/tests')
-rw-r--r--test/pacman/tests/ignore007.py2
-rw-r--r--test/pacman/tests/replace101.py25
-rw-r--r--test/pacman/tests/replace102.py27
-rw-r--r--test/pacman/tests/sign001.py9
-rw-r--r--test/pacman/tests/sign002.py10
-rw-r--r--test/pacman/tests/smoke002.py12
-rw-r--r--test/pacman/tests/smoke004.py11
-rw-r--r--test/pacman/tests/upgrade020.py1
-rw-r--r--test/pacman/tests/upgrade021.py1
-rw-r--r--test/pacman/tests/upgrade022.py1
-rw-r--r--test/pacman/tests/upgrade023.py1
-rw-r--r--test/pacman/tests/upgrade024.py1
-rw-r--r--test/pacman/tests/upgrade025.py1
-rw-r--r--test/pacman/tests/upgrade026.py1
-rw-r--r--test/pacman/tests/upgrade042.py1
-rw-r--r--test/pacman/tests/upgrade043.py1
-rw-r--r--test/pacman/tests/upgrade045.py1
17 files changed, 98 insertions, 8 deletions
diff --git a/test/pacman/tests/ignore007.py b/test/pacman/tests/ignore007.py
index 90ff4ef6..7670e770 100644
--- a/test/pacman/tests/ignore007.py
+++ b/test/pacman/tests/ignore007.py
@@ -18,4 +18,4 @@ self.args = "--ask=1 -S grp"
self.addrule("PACMAN_RETCODE=0")
self.addrule("!PKG_EXIST=%s" % pkg1.name)
self.addrule("PKG_EXIST=%s" % pkg2.name)
-self.addrule("PACMAN_OUTPUT=is in IgnorePkg")
+self.addrule("PKG_EXIST=%s" % pkg3.name)
diff --git a/test/pacman/tests/replace101.py b/test/pacman/tests/replace101.py
new file mode 100644
index 00000000..86c40ac6
--- /dev/null
+++ b/test/pacman/tests/replace101.py
@@ -0,0 +1,25 @@
+self.description = "Sysupgrade with a versioned replacement"
+
+sp1 = pmpkg("python2-yaml", "5-1")
+sp1.replaces = ["python-yaml<5"]
+sp1.conflicts = ["python-yaml<5"]
+sp1.files = ["lib/python2/file"]
+self.addpkg2db("sync", sp1)
+
+# the python3 version
+sp2 = pmpkg("python-yaml", "5-1")
+sp2.files = ["lib/python3/file"]
+self.addpkg2db("sync", sp2)
+
+lp1 = pmpkg("python-yaml", "4-1")
+lp1.files = ["lib/python2/file"]
+self.addpkg2db("local", lp1)
+
+self.args = "-Su"
+
+self.addrule("PACMAN_RETCODE=0")
+self.addrule("!PKG_EXIST=python-yaml")
+self.addrule("PKG_VERSION=python2-yaml|5-1")
+self.addrule("FILE_EXIST=lib/python2/file")
+
+self.expectfailure = True
diff --git a/test/pacman/tests/replace102.py b/test/pacman/tests/replace102.py
new file mode 100644
index 00000000..c6e2e5f0
--- /dev/null
+++ b/test/pacman/tests/replace102.py
@@ -0,0 +1,27 @@
+self.description = "Replace a package with a file in 'backup' (local modified)"
+# FS#24543
+
+lp = pmpkg("dummy")
+lp.files = ["etc/dummy.conf*", "bin/dummy"]
+lp.backup = ["etc/dummy.conf"]
+self.addpkg2db("local", lp)
+
+sp = pmpkg("replacement")
+sp.replaces = ["dummy"]
+sp.files = ["etc/dummy.conf", "bin/dummy*"]
+sp.backup = ["etc/dummy.conf"]
+self.addpkg2db("sync", sp)
+
+self.args = "-Su"
+
+self.addrule("!PKG_EXIST=dummy")
+self.addrule("PKG_EXIST=replacement")
+
+self.addrule("FILE_EXIST=etc/dummy.conf")
+self.addrule("!FILE_MODIFIED=etc/dummy.conf")
+self.addrule("!FILE_PACNEW=etc/dummy.conf")
+self.addrule("!FILE_PACSAVE=etc/dummy.conf")
+
+self.addrule("FILE_EXIST=bin/dummy")
+
+self.expectfailure = True
diff --git a/test/pacman/tests/sign001.py b/test/pacman/tests/sign001.py
new file mode 100644
index 00000000..14add09c
--- /dev/null
+++ b/test/pacman/tests/sign001.py
@@ -0,0 +1,9 @@
+self.description = "Add a bogus signature to a package DB"
+
+sp = pmpkg("pkg1")
+sp.pgpsig = "asdfasdfsdfasdfsdafasdfsdfasd"
+self.addpkg2db("sync+Optional", sp)
+
+self.args = "-Ss"
+
+self.addrule("PACMAN_RETCODE=0")
diff --git a/test/pacman/tests/sign002.py b/test/pacman/tests/sign002.py
new file mode 100644
index 00000000..b55f331e
--- /dev/null
+++ b/test/pacman/tests/sign002.py
@@ -0,0 +1,10 @@
+self.description = "Verify a signature in a sync DB (failure)"
+
+sp = pmpkg("pkg1")
+sp.pgpsig = "iEYEABECAAYFAkhMOggACgkQXC5GoPU6du2WVQCffVxF8GKXJIY4juJBIw/ljLrQxygAnj2QlvsUd7MdFekLX18+Ov/xzgZ1"
+self.addpkg2db("sync+Always", sp)
+
+self.args = "-S %s" % sp.name
+
+self.addrule("PACMAN_RETCODE=1")
+self.addrule("!PKG_EXIST=pkg1")
diff --git a/test/pacman/tests/smoke002.py b/test/pacman/tests/smoke002.py
index 44f2d0ec..8ff5cab7 100644
--- a/test/pacman/tests/smoke002.py
+++ b/test/pacman/tests/smoke002.py
@@ -10,10 +10,8 @@ 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)
+# We error out when fed a package with an invalid description; the second one
+# fits the bill in this case as the desc is > 512K
+self.addrule("PACMAN_RETCODE=1")
+self.addrule("!PKG_EXIST=pkg1")
+self.addrule("!PKG_EXIST=pkg1")
diff --git a/test/pacman/tests/smoke004.py b/test/pacman/tests/smoke004.py
new file mode 100644
index 00000000..1f9b883d
--- /dev/null
+++ b/test/pacman/tests/smoke004.py
@@ -0,0 +1,11 @@
+self.description = "Read a package DB with several PGP signatures"
+
+for i in range(1000):
+ sp = pmpkg("pkg%03d" % i)
+ sp.desc = "test description for package %d" % i
+ sp.pgpsig = "asdfasdfsdfasdfsdafasdfsdfasd"
+ self.addpkg2db("sync", sp)
+
+self.args = "-Ss"
+
+self.addrule("PACMAN_RETCODE=0")
diff --git a/test/pacman/tests/upgrade020.py b/test/pacman/tests/upgrade020.py
index 6a7994bb..8b2e4025 100644
--- a/test/pacman/tests/upgrade020.py
+++ b/test/pacman/tests/upgrade020.py
@@ -12,6 +12,7 @@ self.addpkg(p)
self.args = "-U %s" % p.filename()
+self.addrule("PACMAN_RETCODE=0")
self.addrule("PKG_VERSION=dummy|1.0-2")
self.addrule("FILE_MODIFIED=etc/dummy.conf")
self.addrule("!FILE_PACNEW=etc/dummy.conf")
diff --git a/test/pacman/tests/upgrade021.py b/test/pacman/tests/upgrade021.py
index b45ea18a..9c623c04 100644
--- a/test/pacman/tests/upgrade021.py
+++ b/test/pacman/tests/upgrade021.py
@@ -12,6 +12,7 @@ self.addpkg(p)
self.args = "-U %s" % p.filename()
+self.addrule("PACMAN_RETCODE=0")
self.addrule("PKG_VERSION=dummy|1.0-2")
self.addrule("!FILE_MODIFIED=etc/dummy.conf")
self.addrule("!FILE_PACNEW=etc/dummy.conf")
diff --git a/test/pacman/tests/upgrade022.py b/test/pacman/tests/upgrade022.py
index dcf7ae01..581a66ad 100644
--- a/test/pacman/tests/upgrade022.py
+++ b/test/pacman/tests/upgrade022.py
@@ -12,6 +12,7 @@ self.addpkg(p)
self.args = "-U %s" % p.filename()
+self.addrule("PACMAN_RETCODE=0")
self.addrule("PKG_VERSION=dummy|1.0-2")
self.addrule("!FILE_MODIFIED=etc/dummy.conf")
self.addrule("FILE_PACNEW=etc/dummy.conf")
diff --git a/test/pacman/tests/upgrade023.py b/test/pacman/tests/upgrade023.py
index d1d2e314..08afbb8f 100644
--- a/test/pacman/tests/upgrade023.py
+++ b/test/pacman/tests/upgrade023.py
@@ -11,6 +11,7 @@ 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_MODIFIED=etc/dummy.conf")
# Do we want this pacnew or not?
diff --git a/test/pacman/tests/upgrade024.py b/test/pacman/tests/upgrade024.py
index ec2f7623..0bacb76d 100644
--- a/test/pacman/tests/upgrade024.py
+++ b/test/pacman/tests/upgrade024.py
@@ -10,6 +10,7 @@ self.addpkg(p)
self.args = "-U %s" % p.filename()
+self.addrule("PACMAN_RETCODE=0")
self.addrule("PKG_VERSION=dummy|1.0-2")
self.addrule("FILE_PACSAVE=etc/dummy.conf")
self.addrule("!FILE_EXIST=etc/dummy.conf")
diff --git a/test/pacman/tests/upgrade025.py b/test/pacman/tests/upgrade025.py
index 2c9c06f3..0ef0d0d8 100644
--- a/test/pacman/tests/upgrade025.py
+++ b/test/pacman/tests/upgrade025.py
@@ -11,6 +11,7 @@ self.addpkg(p)
self.args = "-U %s" % p.filename()
+self.addrule("PACMAN_RETCODE=0")
self.addrule("PKG_VERSION=dummy|1.0-2")
self.addrule("FILE_PACSAVE=etc/dummy.conf")
self.addrule("!FILE_PACNEW=etc/dummy.conf")
diff --git a/test/pacman/tests/upgrade026.py b/test/pacman/tests/upgrade026.py
index 8e3ef239..7e91cbc9 100644
--- a/test/pacman/tests/upgrade026.py
+++ b/test/pacman/tests/upgrade026.py
@@ -11,6 +11,7 @@ self.addpkg(p)
self.args = "-U %s" % p.filename()
+self.addrule("PACMAN_RETCODE=0")
self.addrule("PKG_VERSION=dummy|1.0-2")
self.addrule("FILE_PACSAVE=etc/dummy.conf")
self.addrule("!FILE_PACNEW=etc/dummy.conf")
diff --git a/test/pacman/tests/upgrade042.py b/test/pacman/tests/upgrade042.py
index d6140d45..44754991 100644
--- a/test/pacman/tests/upgrade042.py
+++ b/test/pacman/tests/upgrade042.py
@@ -21,6 +21,7 @@ self.args = "-U %s" % " ".join([p.filename() for p in p1, p2])
self.filesystem = ["etc/profile"]
+self.addrule("PACMAN_RETCODE=0")
self.addrule("PKG_VERSION=bash|1.0-2")
self.addrule("PKG_VERSION=filesystem|1.0-2")
self.addrule("!FILE_PACSAVE=etc/profile")
diff --git a/test/pacman/tests/upgrade043.py b/test/pacman/tests/upgrade043.py
index e76dc463..f531cb82 100644
--- a/test/pacman/tests/upgrade043.py
+++ b/test/pacman/tests/upgrade043.py
@@ -21,6 +21,7 @@ self.args = "-U %s" % " ".join([p.filename() for p in p1, p2])
self.filesystem = ["etc/profile"]
+self.addrule("PACMAN_RETCODE=0")
self.addrule("PKG_VERSION=bash|1.0-2")
self.addrule("PKG_VERSION=filesystem|1.0-2")
self.addrule("!FILE_PACSAVE=etc/profile")
diff --git a/test/pacman/tests/upgrade045.py b/test/pacman/tests/upgrade045.py
index b2f81274..5d0ef2ff 100644
--- a/test/pacman/tests/upgrade045.py
+++ b/test/pacman/tests/upgrade045.py
@@ -12,5 +12,6 @@ self.addpkg(p1)
self.args = "-U %s" % p1.filename()
+self.addrule("PACMAN_RETCODE=0")
self.addrule("PKG_VERSION=foo|1.0-2")
self.addrule("FILE_EXIST=etc/foo.cfg")