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/remove071.py33
-rw-r--r--test/pacman/tests/replace101.py18
-rw-r--r--test/pacman/tests/replace102.py25
-rw-r--r--test/pacman/tests/replace110.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/sync600.py51
-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
28 files changed, 320 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/remove071.py b/test/pacman/tests/remove071.py
new file mode 100644
index 00000000..eff70a43
--- /dev/null
+++ b/test/pacman/tests/remove071.py
@@ -0,0 +1,33 @@
+# coding=utf8
+self.description = "Remove packages with evil filenames"
+
+self.filesystem = ["usr/bin/endwithspace",
+ "spaces/name"]
+
+p1 = pmpkg("spaces")
+p1.files = ["usr/bin/endwithspace ",
+ " spaces/name"]
+self.addpkg2db("local", p1)
+
+p2 = pmpkg("unicodechars")
+# somewhat derived from FS#9906
+p2.files = ["usr/share/Märchen",
+ "usr/share/ƏƐƕƺ",
+ "usr/share/предупреждение",
+ "usr/share/סֶאבױ",
+ "usr/share/←↯↻⇈",
+ "usr/share/アヅヨヾ",
+ "usr/share/错误"]
+self.addpkg2db("local", p2)
+
+self.args = "-R %s %s" % (p1.name, p2.name)
+
+self.addrule("PACMAN_RETCODE=0")
+self.addrule("!PKG_EXIST=%s" % p1.name)
+self.addrule("!PKG_EXIST=%s" % p2.name)
+
+for f in p1.files:
+ self.addrule("!FILE_EXIST=%s" % f)
+ self.addrule("FILE_EXIST=%s" % f.strip())
+for f in p2.files:
+ self.addrule("!FILE_EXIST=%s" % f)
diff --git a/test/pacman/tests/replace101.py b/test/pacman/tests/replace101.py
new file mode 100644
index 00000000..00d2b6b3
--- /dev/null
+++ b/test/pacman/tests/replace101.py
@@ -0,0 +1,18 @@
+self.description = "Sysupgrade with a versioned replacement, original disappears"
+
+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)
+
+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")
diff --git a/test/pacman/tests/replace102.py b/test/pacman/tests/replace102.py
new file mode 100644
index 00000000..ca05d4e6
--- /dev/null
+++ b/test/pacman/tests/replace102.py
@@ -0,0 +1,25 @@
+self.description = "Sysupgrade with a versioned replacement, original stays"
+
+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/replace110.py b/test/pacman/tests/replace110.py
new file mode 100644
index 00000000..c6e2e5f0
--- /dev/null
+++ b/test/pacman/tests/replace110.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/sync600.py b/test/pacman/tests/sync600.py
new file mode 100644
index 00000000..e0be668c
--- /dev/null
+++ b/test/pacman/tests/sync600.py
@@ -0,0 +1,51 @@
+# coding=utf8
+self.description = "Sync packages with evil filenames"
+
+self.filesystem = ["usr/bin/endwithspace",
+ "usr/bin/newendwithspace",
+ "usr/bin/disappear",
+ "spaces/name",
+ "spaces/name2"]
+
+p1 = pmpkg("spaces")
+p1.files = ["usr/bin/endwithspace ",
+ "usr/bin/disappear ",
+ " spaces/name",
+ " spaces/gone"]
+self.addpkg2db("local", p1)
+
+sp1 = pmpkg("spaces", "1.1-1")
+sp1.files = ["usr/bin/endwithspace ",
+ "usr/bin/newendwithspace ",
+ " spaces/name",
+ " spaces/name2"]
+self.addpkg2db("sync", sp1)
+
+names = ["Märchen", "ƏƐƕƺ", "предупреждение", "סֶאבױ",
+ "←↯↻⇈", "アヅヨヾ", "错误"]
+
+p2 = pmpkg("unicodechars")
+# somewhat derived from FS#9906
+p2.files = ["usr/share/%s" % name for name in names]
+self.addpkg2db("local", p2)
+
+sp2 = pmpkg("unicodechars", "2.0-1")
+sp2.files = ["usr/man/%s" % name for name in names]
+self.addpkg2db("sync", sp2)
+
+self.args = "-S %s %s" % (sp1.name, sp2.name)
+
+self.addrule("PACMAN_RETCODE=0")
+self.addrule("PKG_VERSION=%s|%s" % (sp1.name, sp1.version))
+self.addrule("PKG_VERSION=%s|%s" % (sp2.name, sp2.version))
+
+for f in self.filesystem:
+ self.addrule("FILE_EXIST=%s" % f)
+self.addrule("FILE_EXIST=usr/bin/endwithspace ")
+self.addrule("FILE_EXIST= spaces/name")
+self.addrule("FILE_EXIST= spaces/name2")
+self.addrule("!FILE_EXIST=usr/bin/disappear ")
+for f in p2.files:
+ self.addrule("!FILE_EXIST=%s" % f)
+for f in sp2.files:
+ self.addrule("FILE_EXIST=%s" % f)
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")