[pacman-dev] [PATCH 6/6] add pacman-db-upgrade test

Andrew Gregory andrew.gregory.8 at gmail.com
Wed Oct 8 06:39:07 UTC 2014


Signed-off-by: Andrew Gregory <andrew.gregory.8 at gmail.com>
---
 Makefile.am                          |  1 +
 test/scripts/pacman-db-upgrade-v9.py | 21 +++++++++++++++++++++
 valgrind.supp                        |  7 +++++++
 3 files changed, 29 insertions(+)
 create mode 100644 test/scripts/pacman-db-upgrade-v9.py

diff --git a/Makefile.am b/Makefile.am
index 44a2341..e9b3dfa 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -28,6 +28,7 @@ $(top_srcdir)/test/pacman/tests/TESTS: $(wildcard test/pacman/tests/*.py*)
 
 TESTS =  test/scripts/parseopts_test.sh \
 				 test/scripts/human_to_size_test.sh \
+				 test/scripts/pacman-db-upgrade-v9.py \
 				 test/util/pacsorttest.sh \
 				 test/util/vercmptest.sh
 include $(top_srcdir)/test/pacman/tests/TESTS
diff --git a/test/scripts/pacman-db-upgrade-v9.py b/test/scripts/pacman-db-upgrade-v9.py
new file mode 100644
index 0000000..dc6f97d
--- /dev/null
+++ b/test/scripts/pacman-db-upgrade-v9.py
@@ -0,0 +1,21 @@
+self.description = "pacman-db-upgrade DB version 9 (symlink support removal)"
+
+self.filesystem = [ "mnt_real/subdir/", "mnt -> mnt_real/subdir/", "bar -> ./" ]
+
+fpkg = pmpkg("filesystem")
+fpkg.files = ["mnt_real/", "mnt/", "mnt/foo", "bar/", "bar/baz"]
+fpkg.backup = ["mnt/foo"]
+
+self.addpkg2db("local", fpkg)
+self.dbver = 8
+
+self.cmd = ["pacman-db-upgrade", "--root", self.root + "/"]
+
+self.addrule("PACMAN_RETCODE=0")
+self.addrule("PKG_BACKUP=filesystem|mnt_real/subdir/foo")
+self.addrule("PKG_FILES=filesystem|mnt_real/")
+self.addrule("PKG_FILES=filesystem|mnt_real/subdir/")
+self.addrule("PKG_FILES=filesystem|mnt_real/subdir/foo")
+self.addrule("PKG_FILES=filesystem|baz")
+self.addrule("!PKG_FILES=filesystem|mnt/")
+self.addrule("!PKG_FILES=filesystem|bar/")
diff --git a/valgrind.supp b/valgrind.supp
index ac54b74..806c9b6 100644
--- a/valgrind.supp
+++ b/valgrind.supp
@@ -149,3 +149,10 @@
    Memcheck:Cond
    fun:__lxstat
 }
+{
+   bash-is-a-sieve
+   Memcheck:Leak
+   match-leak-kinds: reachable,definite,indirect
+   ...
+   obj:*/bash
+}
-- 
2.1.2


More information about the pacman-dev mailing list