From b8d01dace84a379d9104ae35f98c94b96103b6bc Mon Sep 17 00:00:00 2001 From: Xavier Chantry Date: Sun, 10 Oct 2010 19:51:07 +0200 Subject: add pactests for -Sdd Signed-off-by: Xavier Chantry Signed-off-by: Dan McGee --- 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(+) 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 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") -- cgit v1.2.3-70-g09d2