summaryrefslogtreecommitdiff
path: root/test/pacman/tests
diff options
context:
space:
mode:
Diffstat (limited to 'test/pacman/tests')
-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/smoke004.py11
5 files changed, 82 insertions, 0 deletions
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..0ae417b7
--- /dev/null
+++ b/test/pacman/tests/sign001.py
@@ -0,0 +1,9 @@
+self.description = "Add a signature to a package DB"
+
+sp = pmpkg("pkg1")
+sp.pgpsig = "asdfasdfsdfasdfsdafasdfsdfasd"
+self.addpkg2db("sync+Always", 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/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")