[pacman-dev] [PATCH 2/5] add fileconflict tests for cases with symlinks
Andrew Gregory
andrew.gregory.8 at gmail.com
Fri Feb 15 21:02:16 EST 2013
Signed-off-by: Andrew Gregory <andrew.gregory.8 at gmail.com>
---
test/pacman/tests/fileconflict022.py | 21 +++++++++++++++++++++
test/pacman/tests/fileconflict023.py | 20 ++++++++++++++++++++
test/pacman/tests/fileconflict024.py | 19 +++++++++++++++++++
test/pacman/tests/fileconflict025.py | 20 ++++++++++++++++++++
4 files changed, 80 insertions(+)
create mode 100644 test/pacman/tests/fileconflict022.py
create mode 100644 test/pacman/tests/fileconflict023.py
create mode 100644 test/pacman/tests/fileconflict024.py
create mode 100644 test/pacman/tests/fileconflict025.py
diff --git a/test/pacman/tests/fileconflict022.py b/test/pacman/tests/fileconflict022.py
new file mode 100644
index 0000000..6f9aec9
--- /dev/null
+++ b/test/pacman/tests/fileconflict022.py
@@ -0,0 +1,21 @@
+self.description = "File conflict between package with symlink and package with real path"
+
+self.filesystem = ["usr/lib/", "lib -> usr/lib/"]
+
+sp1 = pmpkg("foo")
+# share/ causes the entries to be reordered after path resolution
+sp1.files = ["lib/", "lib/file", "share/"]
+self.addpkg2db("sync", sp1)
+
+sp2 = pmpkg("bar")
+sp2.files = ["usr/", "usr/lib/", "usr/lib/file"]
+self.addpkg2db("sync", sp2)
+
+self.args = "-S %s %s" % (sp1.name, sp2.name)
+
+self.addrule("PACMAN_RETCODE=1")
+self.addrule("PACMAN_OUTPUT=.*/usr/lib/file exists in both 'foo' and 'bar'")
+self.addrule("!PKG_EXIST=foo")
+self.addrule("!PKG_EXIST=bar")
+
+self.expectfailure = True
diff --git a/test/pacman/tests/fileconflict023.py b/test/pacman/tests/fileconflict023.py
new file mode 100644
index 0000000..1310b68
--- /dev/null
+++ b/test/pacman/tests/fileconflict023.py
@@ -0,0 +1,20 @@
+self.description = "File conflict between package with symlink and package with real path resolved by removal"
+
+self.filesystem = ["usr/", "usr/lib/", "lib -> usr/lib/"]
+
+lp1 = pmpkg("foo")
+lp1.files = ["lib/", "lib/file"]
+self.addpkg2db("local", lp1)
+
+sp1 = pmpkg("bar")
+sp1.conflicts = ["foo"]
+sp1.files = ["usr/", "usr/lib/", "usr/lib/file"]
+self.addpkg2db("sync", sp1)
+
+self.args = "-S %s --ask=4" % sp1.name
+
+self.addrule("PACMAN_RETCODE=0")
+self.addrule("!PKG_EXIST=foo")
+self.addrule("PKG_EXIST=bar")
+
+self.expectfailure = True
diff --git a/test/pacman/tests/fileconflict024.py b/test/pacman/tests/fileconflict024.py
new file mode 100644
index 0000000..1dcb5ad
--- /dev/null
+++ b/test/pacman/tests/fileconflict024.py
@@ -0,0 +1,19 @@
+self.description = "Filesystem conflict on upgrade with symlinks"
+
+self.filesystem = ["share", "usr/lib/", "lib -> usr/lib/"]
+
+lp1 = pmpkg("foo", "1-1")
+lp1.files = ["lib/"]
+self.addpkg2db("local", lp1)
+
+sp1 = pmpkg("foo", "1-2")
+# share/ causes the file order to change upon path resolution
+sp1.files = ["lib/", "share"]
+self.addpkg2db("sync", sp1)
+
+self.args = "-S %s" % sp1.name
+
+self.addrule("PACMAN_RETCODE=1")
+self.addrule("PKG_EXIST=foo|1-1")
+
+self.expectfailure = True
diff --git a/test/pacman/tests/fileconflict025.py b/test/pacman/tests/fileconflict025.py
new file mode 100644
index 0000000..efd027e
--- /dev/null
+++ b/test/pacman/tests/fileconflict025.py
@@ -0,0 +1,20 @@
+self.description = "File conflict between package with symlink and package with real path resolved by removal (reversed)"
+
+self.filesystem = ["usr/lib/", "lib -> usr/lib/"]
+
+lp1 = pmpkg("foo")
+lp1.files = ["usr/", "usr/lib/", "usr/lib/file"]
+self.addpkg2db("local", lp1)
+
+sp1 = pmpkg("bar")
+sp1.conflicts = ["foo"]
+sp1.files = ["lib/", "lib/file"]
+self.addpkg2db("sync", sp1)
+
+self.args = "-S %s --ask=4" % sp1.name
+
+self.addrule("PACMAN_RETCODE=0")
+self.addrule("!PKG_EXIST=foo")
+self.addrule("PKG_EXIST=bar")
+
+self.expectfailure = True
--
1.8.1.3
More information about the pacman-dev
mailing list