summaryrefslogtreecommitdiff
path: root/test/pacman/tests
diff options
context:
space:
mode:
Diffstat (limited to 'test/pacman/tests')
-rw-r--r--test/pacman/tests/epoch005.py25
-rw-r--r--test/pacman/tests/fileconflict001.py3
-rw-r--r--test/pacman/tests/fileconflict002.py9
-rw-r--r--test/pacman/tests/fileconflict003.py2
-rw-r--r--test/pacman/tests/ignore007.py2
-rw-r--r--test/pacman/tests/remove070.py24
-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/upgrade027.py22
-rw-r--r--test/pacman/tests/upgrade028.py22
-rw-r--r--test/pacman/tests/upgrade029.py24
-rw-r--r--test/pacman/tests/upgrade042.py1
-rw-r--r--test/pacman/tests/upgrade043.py1
-rw-r--r--test/pacman/tests/upgrade045.py1
25 files changed, 218 insertions, 19 deletions
diff --git a/test/pacman/tests/epoch005.py b/test/pacman/tests/epoch005.py
new file mode 100644
index 00000000..4af8edfd
--- /dev/null
+++ b/test/pacman/tests/epoch005.py
@@ -0,0 +1,25 @@
+self.description = "Sysupgrade with sync packages having absurd epochs"
+
+versions = (
+ "1234327518932650063289125782697890:1.0-1",
+ "1234327518932650063289125782697891:0.9-1",
+ "1234327518932650063289125782697891:1.0-1",
+ "1234327518932650063289125782697891:1.1-1",
+ "1234327518932650063289125782697892:1.0-1",
+)
+
+pkgvers = [(n, versions[n]) for n in range(len(versions))]
+for k, v in pkgvers:
+ sp = pmpkg("pkg_%d" % k, v)
+ self.addpkg2db("sync", sp)
+
+for k, v in pkgvers:
+ lp = pmpkg("pkg_%d" % k, versions[2])
+ self.addpkg2db("local", lp)
+
+self.args = "-Su"
+
+self.addrule("PACMAN_RETCODE=0")
+for k, v in pkgvers:
+ right_ver = versions[max(k, 2)]
+ self.addrule("PKG_VERSION=pkg_%d|%s" % (k, right_ver))
diff --git a/test/pacman/tests/fileconflict001.py b/test/pacman/tests/fileconflict001.py
index 8c13911c..dec61512 100644
--- a/test/pacman/tests/fileconflict001.py
+++ b/test/pacman/tests/fileconflict001.py
@@ -2,6 +2,7 @@ self.description = "Fileconflict with symlinks"
lp = pmpkg("dummy")
lp.files = ["dir/realdir/",
+ "dir/realdir/realfile",
"dir/symdir -> realdir"]
self.addpkg2db("local", lp)
@@ -18,5 +19,7 @@ self.args = "-U %s" % " ".join([p.filename() for p in p1, p2])
self.addrule("PACMAN_RETCODE=1")
self.addrule("!PKG_EXIST=pkg1")
self.addrule("!PKG_EXIST=pkg2")
+self.addrule("FILE_EXIST=dir/realdir/realfile")
+self.addrule("!FILE_EXIST=dir/realdir/file")
self.expectfailure = True
diff --git a/test/pacman/tests/fileconflict002.py b/test/pacman/tests/fileconflict002.py
index f70873ba..e107cd2e 100644
--- a/test/pacman/tests/fileconflict002.py
+++ b/test/pacman/tests/fileconflict002.py
@@ -1,12 +1,16 @@
self.description = "Fileconflict with symlinks (2)"
p1 = pmpkg("pkg1")
-p1.files = ["dir/realdir/file",
+p1.files = ["dir/",
+ "dir/realdir/",
+ "dir/realdir/file",
"dir/symdir -> realdir"]
self.addpkg(p1)
p2 = pmpkg("pkg2")
-p2.files = ["dir/symdir/file"]
+p2.files = ["dir/",
+ "dir/symdir/",
+ "dir/symdir/file"]
self.addpkg(p2)
self.args = "-U %s" % " ".join([p.filename() for p in p1, p2])
@@ -14,5 +18,6 @@ self.args = "-U %s" % " ".join([p.filename() for p in p1, p2])
self.addrule("PACMAN_RETCODE=1")
self.addrule("!PKG_EXIST=pkg1")
self.addrule("!PKG_EXIST=pkg2")
+self.addrule("!FILE_EXIST=dir/realdir/file")
self.expectfailure = True
diff --git a/test/pacman/tests/fileconflict003.py b/test/pacman/tests/fileconflict003.py
index 89696fcb..749e5a99 100644
--- a/test/pacman/tests/fileconflict003.py
+++ b/test/pacman/tests/fileconflict003.py
@@ -1,4 +1,4 @@
-self.description = "FS#8156"
+self.description = "FS#8156- conflict between directory and incoming symlink"
p1 = pmpkg("pkg1")
p1.files = ["test/",
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/remove070.py b/test/pacman/tests/remove070.py
index e0587e17..898e2f50 100644
--- a/test/pacman/tests/remove070.py
+++ b/test/pacman/tests/remove070.py
@@ -1,21 +1,29 @@
-self.description = "Remove a package with an empty directory needed by another package"
+self.description = "Remove a package with various directory overlaps"
+
+self.filesystem = ["lib/alsoonfs/randomfile"]
p1 = pmpkg("pkg1")
-p1.files = ["bin/pkg1", "opt/"]
+p1.files = ["bin/pkg1",
+ "opt/",
+ "lib/onlyinp1/",
+ "lib/alsoonfs/"]
p2 = pmpkg("pkg2")
-p2.files = ["bin/pkg2", "opt/"]
+p2.files = ["bin/pkg2",
+ "opt/",
+ "lib/onlyinp2/"]
for p in p1, p2:
- self.addpkg2db("local", p)
+ self.addpkg2db("local", p)
self.args = "-R %s" % p1.name
self.addrule("PACMAN_RETCODE=0")
self.addrule("!PKG_EXIST=pkg1")
self.addrule("PKG_EXIST=pkg2")
-self.addrule("!FILE_EXIST=bin/pkg1")
-self.addrule("FILE_EXIST=bin/pkg2")
-self.addrule("FILE_EXIST=opt/")
-self.expectfailure = True
+self.addrule("DIR_EXIST=bin/")
+self.addrule("DIR_EXIST=opt/")
+self.addrule("!DIR_EXIST=lib/onlyinp1/")
+self.addrule("DIR_EXIST=lib/onlyinp2/")
+self.addrule("DIR_EXIST=lib/alsoonfs/")
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/upgrade027.py b/test/pacman/tests/upgrade027.py
new file mode 100644
index 00000000..99087f34
--- /dev/null
+++ b/test/pacman/tests/upgrade027.py
@@ -0,0 +1,22 @@
+self.description = "Upgrade a package, with a file entering the pkg in 'backup' (changed)"
+
+self.filesystem = ["etc/dummy.conf"]
+
+lp = pmpkg("dummy")
+lp.files = ["usr/bin/dummy"]
+self.addpkg2db("local", lp)
+
+p = pmpkg("dummy", "1.0-2")
+p.files = ["usr/bin/dummy",
+ "etc/dummy.conf*"]
+p.backup = ["etc/dummy.conf"]
+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_PACNEW=etc/dummy.conf")
+self.addrule("!FILE_PACSAVE=etc/dummy.conf")
+self.addrule("!FILE_PACORIG=etc/dummy.conf")
+self.addrule("FILE_EXIST=etc/dummy.conf")
diff --git a/test/pacman/tests/upgrade028.py b/test/pacman/tests/upgrade028.py
new file mode 100644
index 00000000..18a10f57
--- /dev/null
+++ b/test/pacman/tests/upgrade028.py
@@ -0,0 +1,22 @@
+self.description = "Upgrade a package, with a file entering the pkg in 'backup' (unchanged)"
+
+self.filesystem = ["etc/dummy.conf"]
+
+lp = pmpkg("dummy")
+lp.files = ["usr/bin/dummy"]
+self.addpkg2db("local", lp)
+
+p = pmpkg("dummy", "1.0-2")
+p.files = ["usr/bin/dummy",
+ "etc/dummy.conf"]
+p.backup = ["etc/dummy.conf"]
+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_PACNEW=etc/dummy.conf")
+self.addrule("!FILE_PACSAVE=etc/dummy.conf")
+self.addrule("!FILE_PACORIG=etc/dummy.conf")
+self.addrule("FILE_EXIST=etc/dummy.conf")
diff --git a/test/pacman/tests/upgrade029.py b/test/pacman/tests/upgrade029.py
new file mode 100644
index 00000000..c308f426
--- /dev/null
+++ b/test/pacman/tests/upgrade029.py
@@ -0,0 +1,24 @@
+self.description = "Upgrade a package, with an owned file entering the pkg in 'backup'"
+
+lp = pmpkg("dummy")
+lp.files = ["usr/bin/dummy"]
+self.addpkg2db("local", lp)
+
+lp2 = pmpkg("dummy2")
+lp2.files = ["etc/dummy.conf"]
+self.addpkg2db("local", lp2)
+
+p = pmpkg("dummy", "1.0-2")
+p.files = ["usr/bin/dummy",
+ "etc/dummy.conf*"]
+p.backup = ["etc/dummy.conf"]
+self.addpkg(p)
+
+self.args = "-U %s" % p.filename()
+
+self.addrule("PACMAN_RETCODE=1")
+self.addrule("PKG_VERSION=dummy|1.0-1")
+self.addrule("!FILE_PACNEW=etc/dummy.conf")
+self.addrule("!FILE_PACSAVE=etc/dummy.conf")
+self.addrule("!FILE_PACORIG=etc/dummy.conf")
+self.addrule("FILE_EXIST=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")