[pacman-dev] [PATCH 1/2] Add two pactests for group and --needed interaction
Dan McGee
dan at archlinux.org
Sun Jul 25 23:38:03 EDT 2010
The first step for resolving FS#20221. sync023 is the case from the bug
report; sync022 is already working fine but we have no tests at all that
test the --needed option in any form.
Signed-off-by: Dan McGee <dan at archlinux.org>
---
test/pacman/tests/sync022.py | 25 +++++++++++++++++++++++++
test/pacman/tests/sync023.py | 31 +++++++++++++++++++++++++++++++
2 files changed, 56 insertions(+), 0 deletions(-)
create mode 100644 test/pacman/tests/sync022.py
create mode 100644 test/pacman/tests/sync023.py
diff --git a/test/pacman/tests/sync022.py b/test/pacman/tests/sync022.py
new file mode 100644
index 0000000..eebbe07
--- /dev/null
+++ b/test/pacman/tests/sync022.py
@@ -0,0 +1,25 @@
+self.description = "Install a group from a sync db using --needed"
+
+lp1 = pmpkg("pkg1")
+lp2 = pmpkg("pkg2")
+lp3 = pmpkg("pkg3")
+
+sp1 = pmpkg("pkg1", "1.1-1")
+sp2 = pmpkg("pkg2")
+sp3 = pmpkg("pkg3")
+
+for p in lp1, lp2, lp3, sp1, sp2, sp3:
+ setattr(p, "groups", ["grp"])
+
+for p in lp1, lp2, lp3:
+ self.addpkg2db("local", p)
+
+for p in sp1, sp2, sp3:
+ self.addpkg2db("sync", p);
+
+self.args = "-S --needed grp"
+
+self.addrule("PACMAN_RETCODE=0")
+for p in sp1, sp2, sp3:
+ self.addrule("PKG_EXIST=%s" % p.name)
+self.addrule("PKG_VERSION=pkg1|1.1-1")
diff --git a/test/pacman/tests/sync023.py b/test/pacman/tests/sync023.py
new file mode 100644
index 0000000..9253497
--- /dev/null
+++ b/test/pacman/tests/sync023.py
@@ -0,0 +1,31 @@
+self.description = "Install a group from a sync db using --needed (testing repo)"
+
+lp1 = pmpkg("pkg1", "1.1-1")
+lp2 = pmpkg("pkg2")
+lp3 = pmpkg("pkg3")
+
+sp1 = pmpkg("pkg1")
+sp2 = pmpkg("pkg2")
+sp3 = pmpkg("pkg3")
+newp1 = pmpkg("pkg1", "1.1-1")
+
+for p in lp1, lp2, lp3, sp1, sp2, sp3, newp1:
+ setattr(p, "groups", ["grp"])
+
+for p in lp1, lp2, lp3:
+ self.addpkg2db("local", p)
+
+self.addpkg2db("testing", newp1);
+
+for p in sp1, sp2, sp3:
+ self.addpkg2db("sync", p);
+
+self.args = "-S --needed grp"
+
+self.addrule("PACMAN_RETCODE=0")
+for p in sp1, sp2, sp3:
+ self.addrule("PKG_EXIST=%s" % p.name)
+# The newer version should still be installed
+self.addrule("PKG_VERSION=pkg1|1.1-1")
+
+self.expectfailure = True
--
1.7.2
More information about the pacman-dev
mailing list