[pacman-dev] [PATCH 2/3] Add two pactests with non-trivial file counts

Dan McGee dan at archlinux.org
Tue Jan 11 19:50:21 EST 2011


These are probably useful anyway, but also exposed the double file list bug
that will be fixed in a later commit.

Signed-off-by: Dan McGee <dan at archlinux.org>
---
 test/pacman/tests/remove002.py  |   12 ++++++++++++
 test/pacman/tests/upgrade006.py |   18 ++++++++++++++++++
 2 files changed, 30 insertions(+), 0 deletions(-)
 create mode 100644 test/pacman/tests/remove002.py
 create mode 100644 test/pacman/tests/upgrade006.py

diff --git a/test/pacman/tests/remove002.py b/test/pacman/tests/remove002.py
new file mode 100644
index 0000000..1deffb0
--- /dev/null
+++ b/test/pacman/tests/remove002.py
@@ -0,0 +1,12 @@
+self.description = "Remove a package with several files"
+
+p = pmpkg("foo")
+p.files = ["usr/share/file_%d" % n for n in range(1000)]
+self.addpkg2db("local", p)
+
+self.args = "-R %s" % p.name
+
+self.addrule("PACMAN_RETCODE=0")
+self.addrule("!PKG_EXIST=foo")
+self.addrule("!FILE_EXIST=usr/share/file_0")
+self.addrule("!FILE_EXIST=usr/share/file_999")
diff --git a/test/pacman/tests/upgrade006.py b/test/pacman/tests/upgrade006.py
new file mode 100644
index 0000000..5e5173b
--- /dev/null
+++ b/test/pacman/tests/upgrade006.py
@@ -0,0 +1,18 @@
+self.description = "Upgrade a package with several files"
+
+lp = pmpkg("dummy")
+lp.files = ["usr/share/file_%d" % n for n in range(250, 750)]
+self.addpkg2db("local", lp)
+
+p = pmpkg("dummy", "1.1-1")
+p.files = ["usr/share/file_%d" % n for n in range(600, 1000)]
+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_EXIST=usr/share/file_250")
+self.addrule("!FILE_EXIST=usr/share/file_599")
+self.addrule("FILE_EXIST=usr/share/file_600")
+self.addrule("FILE_EXIST=usr/share/file_999")
-- 
1.7.3.5



More information about the pacman-dev mailing list