[pacman-dev] [PATCH 2/7] pactest: add more testing for epoch
Dan McGee
dan at archlinux.org
Thu Jan 20 19:33:49 EST 2011
Signed-off-by: Dan McGee <dan at archlinux.org>
---
test/pacman/tests/epoch001.py | 1 +
test/pacman/tests/epoch002.py | 1 +
test/pacman/tests/epoch003.py | 1 +
test/pacman/tests/epoch004.py | 1 +
test/pacman/tests/epoch010.py | 14 ++++++++++++++
test/pacman/tests/epoch011.py | 15 +++++++++++++++
test/pacman/tests/epoch012.py | 15 +++++++++++++++
7 files changed, 48 insertions(+), 0 deletions(-)
create mode 100644 test/pacman/tests/epoch010.py
create mode 100644 test/pacman/tests/epoch011.py
create mode 100644 test/pacman/tests/epoch012.py
diff --git a/test/pacman/tests/epoch001.py b/test/pacman/tests/epoch001.py
index b7ec9fc..e1d3114 100644
--- a/test/pacman/tests/epoch001.py
+++ b/test/pacman/tests/epoch001.py
@@ -11,3 +11,4 @@
self.addrule("PACMAN_RETCODE=0")
self.addrule("PKG_VERSION=dummy|1.0-1")
+self.addrule("PKG_EPOCH=dummy|1")
diff --git a/test/pacman/tests/epoch002.py b/test/pacman/tests/epoch002.py
index dac81f7..9e8a048 100644
--- a/test/pacman/tests/epoch002.py
+++ b/test/pacman/tests/epoch002.py
@@ -11,3 +11,4 @@
self.addrule("PACMAN_RETCODE=0")
self.addrule("PKG_VERSION=dummy|1.0-1")
+self.addrule("PKG_EPOCH=dummy|0")
diff --git a/test/pacman/tests/epoch003.py b/test/pacman/tests/epoch003.py
index 726ef30..17ca9bf 100644
--- a/test/pacman/tests/epoch003.py
+++ b/test/pacman/tests/epoch003.py
@@ -12,3 +12,4 @@
self.addrule("PACMAN_RETCODE=0")
self.addrule("PKG_VERSION=dummy|1.4-1")
+self.addrule("PKG_EPOCH=dummy|2")
diff --git a/test/pacman/tests/epoch004.py b/test/pacman/tests/epoch004.py
index 2ee940a..ad3e995 100644
--- a/test/pacman/tests/epoch004.py
+++ b/test/pacman/tests/epoch004.py
@@ -16,3 +16,4 @@
self.addrule("PKG_VERSION=dummy|2.0-1")
self.addrule("FILE_EXIST=bin/dummynew")
self.addrule("!FILE_EXIST=bin/dummyold")
+self.addrule("PKG_EPOCH=dummy|2")
diff --git a/test/pacman/tests/epoch010.py b/test/pacman/tests/epoch010.py
new file mode 100644
index 0000000..3277597
--- /dev/null
+++ b/test/pacman/tests/epoch010.py
@@ -0,0 +1,14 @@
+self.description = "usbutils case study: force in new package"
+
+sp = pmpkg("usbutils", "001-1")
+sp.force = True
+self.addpkg2db("sync", sp)
+
+lp = pmpkg("usbutils", "0.91-4")
+self.addpkg2db("local", lp)
+
+self.args = "-Su"
+
+self.addrule("PACMAN_RETCODE=0")
+self.addrule("PKG_VERSION=usbutils|001-1")
+self.addrule("PKG_EPOCH=usbutils|1")
diff --git a/test/pacman/tests/epoch011.py b/test/pacman/tests/epoch011.py
new file mode 100644
index 0000000..2c064aa
--- /dev/null
+++ b/test/pacman/tests/epoch011.py
@@ -0,0 +1,15 @@
+self.description = "usbutils case study: force stays, epoch now in local db"
+
+sp = pmpkg("usbutils", "002-1")
+sp.force = True
+self.addpkg2db("sync", sp)
+
+lp = pmpkg("usbutils", "001-1")
+lp.epoch = 1
+self.addpkg2db("local", lp)
+
+self.args = "-Su"
+
+self.addrule("PACMAN_RETCODE=0")
+self.addrule("PKG_VERSION=usbutils|002-1")
+self.addrule("PKG_EPOCH=usbutils|1")
diff --git a/test/pacman/tests/epoch012.py b/test/pacman/tests/epoch012.py
new file mode 100644
index 0000000..e0c7314
--- /dev/null
+++ b/test/pacman/tests/epoch012.py
@@ -0,0 +1,15 @@
+self.description = "usbutils case study: maintainer screws up and removes force"
+
+sp = pmpkg("usbutils", "003-1")
+self.addpkg2db("sync", sp)
+
+lp = pmpkg("usbutils", "002-1")
+lp.epoch = 1
+self.addpkg2db("local", lp)
+
+self.args = "-Su"
+
+self.addrule("PACMAN_RETCODE=0")
+# remember, this is how we have to handle this- 003 will not be installed
+self.addrule("PKG_VERSION=usbutils|002-1")
+self.addrule("PKG_EPOCH=usbutils|1")
--
1.7.3.5
More information about the pacman-dev
mailing list