summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorDan McGee <dan@archlinux.org>2011-05-16 18:32:33 +0200
committerDan McGee <dan@archlinux.org>2011-05-16 18:32:33 +0200
commit93f02f5793ad7907aa0bc7c4a9fe64f0c7ce86f6 (patch)
treec3e706f93a4f747dea01b3395b0faf490e734e39 /test
parent3000b6b473422dca3670c922c24d0e15e963281a (diff)
downloadpacman-93f02f5793ad7907aa0bc7c4a9fe64f0c7ce86f6.tar.gz
pacman-93f02f5793ad7907aa0bc7c4a9fe64f0c7ce86f6.tar.xz
Add test for FS#24230, dead backup symlink removal
This currently causes a segfault, which is bad news. Signed-off-by: Dan McGee <dan@archlinux.org>
Diffstat (limited to 'test')
-rw-r--r--test/pacman/tests/symlink002.py45
1 files changed, 45 insertions, 0 deletions
diff --git a/test/pacman/tests/symlink002.py b/test/pacman/tests/symlink002.py
new file mode 100644
index 00000000..7dcafb0d
--- /dev/null
+++ b/test/pacman/tests/symlink002.py
@@ -0,0 +1,45 @@
+self.description = "Dead backed-up symlink when removing package (FS#24230)"
+
+# symlink file is changed
+lp = pmpkg("dummy")
+lp.files = ["etc/brokenlink -> nonexistent",
+ "etc/exists"]
+lp.backup = ["etc/brokenlink*"]
+self.addpkg2db("local", lp)
+
+# symlink file is not changed
+lp2 = pmpkg("dummy2")
+lp2.files = ["etc/brokenlink2 -> nonexistent2",
+ "etc/exists2"]
+lp2.backup = ["etc/brokenlink2"]
+self.addpkg2db("local", lp2)
+
+# package is left alone, not uninstalled
+lp3 = pmpkg("dummy3")
+lp3.files = ["etc/brokenlink3 -> nonexistent3",
+ "etc/exists3"]
+self.addpkg2db("local", lp3)
+
+self.args = "-R %s %s" % (lp.name, lp2.name)
+#self.args = "-R"
+
+self.addrule("PACMAN_RETCODE=0")
+
+self.addrule("!PKG_EXIST=dummy")
+self.addrule("!LINK_EXIST=etc/brokenlink")
+self.addrule("!FILE_EXIST=etc/nonexistent")
+self.addrule("!FILE_EXIST=etc/exists")
+
+self.addrule("!PKG_EXIST=dummy2")
+self.addrule("!LINK_EXIST=etc/brokenlink2")
+self.addrule("!FILE_EXIST=etc/nonexistent2")
+self.addrule("!FILE_EXIST=etc/exists2")
+
+self.addrule("PKG_EXIST=dummy3")
+self.addrule("LINK_EXIST=etc/brokenlink3")
+self.addrule("!FILE_EXIST=etc/nonexistent")
+self.addrule("FILE_EXIST=etc/exists3")
+self.addrule("FILE_TYPE=etc/brokenlink3|link")
+self.addrule("FILE_TYPE=etc/exists3|file")
+
+self.expectfailure = True