summaryrefslogtreecommitdiff
path: root/test/pacman/tests
diff options
context:
space:
mode:
Diffstat (limited to 'test/pacman/tests')
-rw-r--r--test/pacman/tests/sync-nodepversion01.py18
-rw-r--r--test/pacman/tests/sync-nodepversion02.py15
-rw-r--r--test/pacman/tests/sync-nodepversion03.py15
-rw-r--r--test/pacman/tests/sync-nodepversion04.py17
-rw-r--r--test/pacman/tests/sync-nodepversion05.py19
-rw-r--r--test/pacman/tests/sync-nodepversion06.py19
6 files changed, 103 insertions, 0 deletions
diff --git a/test/pacman/tests/sync-nodepversion01.py b/test/pacman/tests/sync-nodepversion01.py
new file mode 100644
index 00000000..3db445fa
--- /dev/null
+++ b/test/pacman/tests/sync-nodepversion01.py
@@ -0,0 +1,18 @@
+self.description = "nodepversion: -Sdd works"
+
+p1 = pmpkg("pkg1", "1.0-2")
+p1.depends = ["provision>1.0-1"]
+self.addpkg2db("sync", p1)
+
+p2 = pmpkg("pkg2", "1.0-2")
+p2.provides = ["provision=1.0-1"]
+self.addpkg2db("sync", p2)
+
+self.args = "-Sdd %s" % p1.name
+
+self.addrule("PACMAN_RETCODE=0")
+self.addrule("PKG_EXIST=pkg1")
+self.addrule("PKG_EXIST=pkg2")
+self.addrule("PKG_DEPENDS=pkg1|provision>1.0-1")
+
+self.expectfailure = True
diff --git a/test/pacman/tests/sync-nodepversion02.py b/test/pacman/tests/sync-nodepversion02.py
new file mode 100644
index 00000000..6ebbdb7a
--- /dev/null
+++ b/test/pacman/tests/sync-nodepversion02.py
@@ -0,0 +1,15 @@
+self.description = "nodepversion: -S fails"
+
+p1 = pmpkg("pkg1", "1.0-2")
+p1.depends = ["provision>=1.0-2"]
+self.addpkg2db("sync", p1)
+
+p2 = pmpkg("pkg2", "1.0-2")
+p2.provides = ["provision=1.0-1"]
+self.addpkg2db("sync", p2)
+
+self.args = "-S %s" % p1.name
+
+self.addrule("PACMAN_RETCODE=1")
+self.addrule("!PKG_EXIST=pkg1")
+self.addrule("!PKG_EXIST=pkg2")
diff --git a/test/pacman/tests/sync-nodepversion03.py b/test/pacman/tests/sync-nodepversion03.py
new file mode 100644
index 00000000..8ebb1c89
--- /dev/null
+++ b/test/pacman/tests/sync-nodepversion03.py
@@ -0,0 +1,15 @@
+self.description = "nodepversion: -Sd works but no deps"
+
+p1 = pmpkg("pkg1", "1.0-2")
+p1.depends = ["provision>=1.0-2"]
+self.addpkg2db("sync", p1)
+
+p2 = pmpkg("pkg2", "1.0-2")
+p2.provides = ["provision=1.0-1"]
+self.addpkg2db("sync", p2)
+
+self.args = "-Sd %s" % p1.name
+
+self.addrule("PACMAN_RETCODE=0")
+self.addrule("PKG_EXIST=pkg1")
+self.addrule("!PKG_EXIST=pkg2")
diff --git a/test/pacman/tests/sync-nodepversion04.py b/test/pacman/tests/sync-nodepversion04.py
new file mode 100644
index 00000000..f5a091e4
--- /dev/null
+++ b/test/pacman/tests/sync-nodepversion04.py
@@ -0,0 +1,17 @@
+self.description = "nodepversion: provision does not exist"
+
+p1 = pmpkg("pkg1", "1.0-2")
+p1.depends = ["invalid>=1.0-2"]
+self.addpkg2db("sync", p1)
+
+p2 = pmpkg("pkg2", "1.0-2")
+p2.provides = ["provision=1.0-1"]
+self.addpkg2db("sync", p2)
+
+self.args = "-Sdd %s" % p1.name
+
+self.addrule("PACMAN_RETCODE=1")
+self.addrule("!PKG_EXIST=pkg1")
+self.addrule("!PKG_EXIST=pkg2")
+
+self.expectfailure = True
diff --git a/test/pacman/tests/sync-nodepversion05.py b/test/pacman/tests/sync-nodepversion05.py
new file mode 100644
index 00000000..f2a45f0b
--- /dev/null
+++ b/test/pacman/tests/sync-nodepversion05.py
@@ -0,0 +1,19 @@
+self.description = "nodepversion: -Sudd works"
+
+p1 = pmpkg("pkg1", "1.0-1")
+p1.depends = ["provision=1.0"]
+self.addpkg2db("local", p1)
+
+p2 = pmpkg("pkg2", "1.0-1")
+p2.provides = ["provision=1.0"]
+self.addpkg2db("local", p2)
+
+sp2 = pmpkg("pkg2", "1.1-1")
+sp2.provides = ["provision=1.1"]
+self.addpkg2db("sync", sp2)
+
+self.args = "-Sudd"
+
+self.addrule("PACMAN_RETCODE=0")
+self.addrule("PKG_VERSION=pkg1|1.0-1")
+self.addrule("PKG_VERSION=pkg2|1.1-1")
diff --git a/test/pacman/tests/sync-nodepversion06.py b/test/pacman/tests/sync-nodepversion06.py
new file mode 100644
index 00000000..139b87af
--- /dev/null
+++ b/test/pacman/tests/sync-nodepversion06.py
@@ -0,0 +1,19 @@
+self.description = "nodepversion: -Su fails"
+
+p1 = pmpkg("pkg1", "1.0-1")
+p1.depends = ["provision=1.0"]
+self.addpkg2db("local", p1)
+
+p2 = pmpkg("pkg2", "1.0-1")
+p2.provides = ["provision=1.0"]
+self.addpkg2db("local", p2)
+
+sp2 = pmpkg("pkg2", "1.1-1")
+sp2.provides = ["provision=1.1"]
+self.addpkg2db("sync", sp2)
+
+self.args = "-Su"
+
+self.addrule("PACMAN_RETCODE=1")
+self.addrule("PKG_VERSION=pkg1|1.0-1")
+self.addrule("PKG_VERSION=pkg2|1.0-1")