Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--test/pacman/tests/provision002.py22
-rw-r--r--test/pacman/tests/provision003.py23
-rw-r--r--test/pacman/tests/provision004.py21
3 files changed, 66 insertions, 0 deletions
diff --git a/test/pacman/tests/provision002.py b/test/pacman/tests/provision002.py
new file mode 100644
index 00000000..49b88a18
--- /dev/null
+++ b/test/pacman/tests/provision002.py
@@ -0,0 +1,22 @@
+self.description = "-S provision, multiple providers, one installed"
+
+sp = pmpkg("pkg1", "1.0-2")
+sp.provides = ["pkg-env"]
+self.addpkg2db("sync", sp)
+
+sp = pmpkg("pkg2", "1.0-2")
+sp.provides = ["pkg-env"]
+self.addpkg2db("sync", sp)
+
+lp = pmpkg("pkg2")
+lp.provides = ["pkg-env"]
+self.addpkg2db("local", lp)
+
+self.args = "-S pkg-env"
+
+self.addrule("PACMAN_RETCODE=0")
+self.addrule("!PKG_EXIST=pkg1")
+self.addrule("PKG_EXIST=pkg2")
+self.addrule("PKG_VERSION=pkg2|1.0-2")
+
+self.expectfailure = True
diff --git a/test/pacman/tests/provision003.py b/test/pacman/tests/provision003.py
new file mode 100644
index 00000000..9308be6e
--- /dev/null
+++ b/test/pacman/tests/provision003.py
@@ -0,0 +1,23 @@
+self.description = "-S provision, multiple providers, one installed, different repos"
+
+sp = pmpkg("pkg1", "1.0-2")
+sp.provides = ["pkg-env"]
+self.addpkg2db("sync", sp)
+
+sp = pmpkg("pkg2", "1.0-2")
+sp.provides = ["pkg-env"]
+# this repo will be sorted second alphabetically
+self.addpkg2db("sync2", sp)
+
+lp = pmpkg("pkg2")
+lp.provides = ["pkg-env"]
+self.addpkg2db("local", lp)
+
+self.args = "-S pkg-env"
+
+self.addrule("PACMAN_RETCODE=0")
+self.addrule("!PKG_EXIST=pkg1")
+self.addrule("PKG_EXIST=pkg2")
+self.addrule("PKG_VERSION=pkg2|1.0-2")
+
+self.expectfailure = True
diff --git a/test/pacman/tests/provision004.py b/test/pacman/tests/provision004.py
new file mode 100644
index 00000000..696fa79f
--- /dev/null
+++ b/test/pacman/tests/provision004.py
@@ -0,0 +1,21 @@
+self.description = "-S literal with provision of same name installed"
+
+sp = pmpkg("provision", "1.0-2")
+sp.provides = ["literal"]
+sp.conflicts = ["literal"]
+self.addpkg2db("sync", sp)
+
+sp = pmpkg("literal", "1.0-2")
+self.addpkg2db("sync2", sp)
+
+lp = pmpkg("provision")
+lp.provides = ["literal"]
+lp.conflicts = ["literal"]
+self.addpkg2db("local", lp)
+
+self.args = "-S literal --ask=4"
+
+self.addrule("PACMAN_RETCODE=0")
+self.addrule("!PKG_EXIST=provision")
+self.addrule("PKG_EXIST=literal")
+self.addrule("PKG_VERSION=literal|1.0-2")