[pacman-dev] [PATCH 1/5] add pactests for -Sdd

Florian Pritz bluewind at xssn.at
Wed Jan 19 12:13:25 EST 2011


From: Xavier Chantry <chantry.xavier at gmail.com>

Signed-off-by: Xavier Chantry <chantry.xavier at gmail.com>
---
 test/pacman/tests/sync-nodepversion01.py |   18 ++++++++++++++++++
 test/pacman/tests/sync-nodepversion02.py |   15 +++++++++++++++
 test/pacman/tests/sync-nodepversion03.py |   15 +++++++++++++++
 test/pacman/tests/sync-nodepversion04.py |   17 +++++++++++++++++
 test/pacman/tests/sync-nodepversion05.py |   19 +++++++++++++++++++
 test/pacman/tests/sync-nodepversion06.py |   19 +++++++++++++++++++
 6 files changed, 103 insertions(+), 0 deletions(-)
 create mode 100644 test/pacman/tests/sync-nodepversion01.py
 create mode 100644 test/pacman/tests/sync-nodepversion02.py
 create mode 100644 test/pacman/tests/sync-nodepversion03.py
 create mode 100644 test/pacman/tests/sync-nodepversion04.py
 create mode 100644 test/pacman/tests/sync-nodepversion05.py
 create mode 100644 test/pacman/tests/sync-nodepversion06.py

diff --git a/test/pacman/tests/sync-nodepversion01.py b/test/pacman/tests/sync-nodepversion01.py
new file mode 100644
index 0000000..3db445f
--- /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 0000000..6ebbdb7
--- /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 0000000..8ebb1c8
--- /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 0000000..f5a091e
--- /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 0000000..f2a45f0
--- /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 0000000..139b87a
--- /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")
-- 
1.7.3.5


More information about the pacman-dev mailing list