Signed-off-by: Xavier Chantry <chantry.xavier@gmail.com> --- test/pacman/tests/sync-sdd1.py | 18 ++++++++++++++++++ test/pacman/tests/sync-sdd2.py | 15 +++++++++++++++ test/pacman/tests/sync-sdd3.py | 15 +++++++++++++++ test/pacman/tests/sync-sdd4.py | 17 +++++++++++++++++ 4 files changed, 65 insertions(+), 0 deletions(-) create mode 100644 test/pacman/tests/sync-sdd1.py create mode 100644 test/pacman/tests/sync-sdd2.py create mode 100644 test/pacman/tests/sync-sdd3.py create mode 100644 test/pacman/tests/sync-sdd4.py diff --git a/test/pacman/tests/sync-sdd1.py b/test/pacman/tests/sync-sdd1.py new file mode 100644 index 0000000..4438ef0 --- /dev/null +++ b/test/pacman/tests/sync-sdd1.py @@ -0,0 +1,18 @@ +self.description = "-Sdd: -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-sdd2.py b/test/pacman/tests/sync-sdd2.py new file mode 100644 index 0000000..5f1f847 --- /dev/null +++ b/test/pacman/tests/sync-sdd2.py @@ -0,0 +1,15 @@ +self.description = "-Sdd: -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-sdd3.py b/test/pacman/tests/sync-sdd3.py new file mode 100644 index 0000000..68733af --- /dev/null +++ b/test/pacman/tests/sync-sdd3.py @@ -0,0 +1,15 @@ +self.description = "-Sdd: -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-sdd4.py b/test/pacman/tests/sync-sdd4.py new file mode 100644 index 0000000..4cd4b54 --- /dev/null +++ b/test/pacman/tests/sync-sdd4.py @@ -0,0 +1,17 @@ +self.description = "-Sdd: 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 -- 1.7.3.1