summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorDan McGee <dan@archlinux.org>2011-01-29 18:26:48 +0100
committerDan McGee <dan@archlinux.org>2011-01-31 16:37:20 +0100
commitd6a9436143920f794d785423ac35eb351d791776 (patch)
treebd557091473ea0aff26f5d485a7dc121cd5a7bfc /test
parent2d5ec02d7c82bdef1a9fb0565dcb67564968a8c0 (diff)
downloadpacman-d6a9436143920f794d785423ac35eb351d791776.tar.gz
pacman-d6a9436143920f794d785423ac35eb351d791776.tar.xz
Add three clean cache tests
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@archlinux.org>
Diffstat (limited to 'test')
-rw-r--r--test/pacman/tests/clean001.py26
-rw-r--r--test/pacman/tests/clean002.py26
-rw-r--r--test/pacman/tests/clean003.py16
3 files changed, 68 insertions, 0 deletions
diff --git a/test/pacman/tests/clean001.py b/test/pacman/tests/clean001.py
new file mode 100644
index 00000000..ad86250a
--- /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 00000000..5dddbc53
--- /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 00000000..0d3f451f
--- /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")