[pacman-dev] [PATCH 2/4] Add three clean cache tests

Dan McGee dan at archlinux.org
Sat Jan 29 13:11:43 EST 2011


The first two are rather standard tests of our two available clean options,
and the third is attempting to test a reported bug (and failing to make the
given case fail).

Signed-off-by: Dan McGee <dan at archlinux.org>
---
 test/pacman/tests/clean001.py |   26 ++++++++++++++++++++++++++
 test/pacman/tests/clean002.py |   26 ++++++++++++++++++++++++++
 test/pacman/tests/clean003.py |   16 ++++++++++++++++
 3 files changed, 68 insertions(+), 0 deletions(-)
 create mode 100644 test/pacman/tests/clean001.py
 create mode 100644 test/pacman/tests/clean002.py
 create mode 100644 test/pacman/tests/clean003.py

diff --git a/test/pacman/tests/clean001.py b/test/pacman/tests/clean001.py
new file mode 100644
index 0000000..ad86250
--- /dev/null
+++ b/test/pacman/tests/clean001.py
@@ -0,0 +1,26 @@
+self.description = "CleanMethod = KeepInstalled"
+
+sp = pmpkg("dummy", "2.0-1")
+self.addpkg2db("sync", sp)
+
+sp = pmpkg("bar", "2.0-1")
+self.addpkg2db("sync", sp)
+
+sp = pmpkg("baz", "2.0-1")
+self.addpkg2db("sync", sp)
+
+lp = pmpkg("dummy", "1.0-1")
+self.addpkg2db("local", lp)
+
+lp = pmpkg("bar", "2.0-1")
+self.addpkg2db("local", lp)
+
+self.args = "-Sc"
+self.option['CleanMethod'] = ['KeepInstalled']
+self.createlocalpkgs = True
+
+self.addrule("PACMAN_RETCODE=0")
+self.addrule("!CACHE_EXISTS=dummy|2.0-1")
+self.addrule("CACHE_EXISTS=dummy|1.0-1")
+self.addrule("CACHE_EXISTS=bar|2.0-1")
+self.addrule("!CACHE_EXISTS=baz|2.0-1")
diff --git a/test/pacman/tests/clean002.py b/test/pacman/tests/clean002.py
new file mode 100644
index 0000000..5dddbc5
--- /dev/null
+++ b/test/pacman/tests/clean002.py
@@ -0,0 +1,26 @@
+self.description = "CleanMethod = KeepCurrent"
+
+sp = pmpkg("dummy", "2.0-1")
+self.addpkg2db("sync", sp)
+
+sp = pmpkg("bar", "2.0-1")
+self.addpkg2db("sync", sp)
+
+sp = pmpkg("baz", "2.0-1")
+self.addpkg2db("sync", sp)
+
+lp = pmpkg("dummy", "1.0-1")
+self.addpkg2db("local", lp)
+
+lp = pmpkg("bar", "2.0-1")
+self.addpkg2db("local", lp)
+
+self.args = "-Sc"
+self.option['CleanMethod'] = ['KeepCurrent']
+self.createlocalpkgs = True
+
+self.addrule("PACMAN_RETCODE=0")
+self.addrule("CACHE_EXISTS=dummy|2.0-1")
+self.addrule("!CACHE_EXISTS=dummy|1.0-1")
+self.addrule("CACHE_EXISTS=bar|2.0-1")
+self.addrule("CACHE_EXISTS=baz|2.0-1")
diff --git a/test/pacman/tests/clean003.py b/test/pacman/tests/clean003.py
new file mode 100644
index 0000000..0d3f451
--- /dev/null
+++ b/test/pacman/tests/clean003.py
@@ -0,0 +1,16 @@
+self.description = "CleanMethod = KeepInstalled with IgnorePkg (FS#22653)"
+
+sp = pmpkg("dummy", "2.0-1")
+self.addpkg2db("sync", sp)
+
+lp = pmpkg("dummy", "1.0-1")
+self.addpkg2db("local", lp)
+
+self.args = "-Sc"
+self.option['CleanMethod'] = ['KeepInstalled']
+self.option['IgnorePkg'] = ['dummy']
+self.createlocalpkgs = True
+
+self.addrule("PACMAN_RETCODE=0")
+self.addrule("!CACHE_EXISTS=dummy|2.0-1")
+self.addrule("CACHE_EXISTS=dummy|1.0-1")
-- 
1.7.3.5



More information about the pacman-dev mailing list