From 5a6ebec7b27e0ec15c2fe79b394f9f65aecc33cd Mon Sep 17 00:00:00 2001 From: Dan McGee Date: Mon, 8 Aug 2011 23:52:52 -0500 Subject: Add a slightly simpler versioned replace test It turns out we have a few problems here which are best tackled independently. The first is simply parsing replacements as dep strings; the second will be dealing with replaces when the original package name still exists in the repository. Signed-off-by: Dan McGee --- test/pacman/tests/replace101.py | 7 +------ test/pacman/tests/replace102.py | 38 ++++++++++++++++++-------------------- test/pacman/tests/replace110.py | 27 +++++++++++++++++++++++++++ 3 files changed, 46 insertions(+), 26 deletions(-) create mode 100644 test/pacman/tests/replace110.py (limited to 'test') diff --git a/test/pacman/tests/replace101.py b/test/pacman/tests/replace101.py index 86c40ac6..ee0f8607 100644 --- a/test/pacman/tests/replace101.py +++ b/test/pacman/tests/replace101.py @@ -1,4 +1,4 @@ -self.description = "Sysupgrade with a versioned replacement" +self.description = "Sysupgrade with a versioned replacement, original disappears" sp1 = pmpkg("python2-yaml", "5-1") sp1.replaces = ["python-yaml<5"] @@ -6,11 +6,6 @@ sp1.conflicts = ["python-yaml<5"] sp1.files = ["lib/python2/file"] self.addpkg2db("sync", sp1) -# the python3 version -sp2 = pmpkg("python-yaml", "5-1") -sp2.files = ["lib/python3/file"] -self.addpkg2db("sync", sp2) - lp1 = pmpkg("python-yaml", "4-1") lp1.files = ["lib/python2/file"] self.addpkg2db("local", lp1) diff --git a/test/pacman/tests/replace102.py b/test/pacman/tests/replace102.py index c6e2e5f0..ca05d4e6 100644 --- a/test/pacman/tests/replace102.py +++ b/test/pacman/tests/replace102.py @@ -1,27 +1,25 @@ -self.description = "Replace a package with a file in 'backup' (local modified)" -# FS#24543 +self.description = "Sysupgrade with a versioned replacement, original stays" -lp = pmpkg("dummy") -lp.files = ["etc/dummy.conf*", "bin/dummy"] -lp.backup = ["etc/dummy.conf"] -self.addpkg2db("local", lp) +sp1 = pmpkg("python2-yaml", "5-1") +sp1.replaces = ["python-yaml<5"] +sp1.conflicts = ["python-yaml<5"] +sp1.files = ["lib/python2/file"] +self.addpkg2db("sync", sp1) -sp = pmpkg("replacement") -sp.replaces = ["dummy"] -sp.files = ["etc/dummy.conf", "bin/dummy*"] -sp.backup = ["etc/dummy.conf"] -self.addpkg2db("sync", sp) +# the python3 version +sp2 = pmpkg("python-yaml", "5-1") +sp2.files = ["lib/python3/file"] +self.addpkg2db("sync", sp2) -self.args = "-Su" - -self.addrule("!PKG_EXIST=dummy") -self.addrule("PKG_EXIST=replacement") +lp1 = pmpkg("python-yaml", "4-1") +lp1.files = ["lib/python2/file"] +self.addpkg2db("local", lp1) -self.addrule("FILE_EXIST=etc/dummy.conf") -self.addrule("!FILE_MODIFIED=etc/dummy.conf") -self.addrule("!FILE_PACNEW=etc/dummy.conf") -self.addrule("!FILE_PACSAVE=etc/dummy.conf") +self.args = "-Su" -self.addrule("FILE_EXIST=bin/dummy") +self.addrule("PACMAN_RETCODE=0") +self.addrule("!PKG_EXIST=python-yaml") +self.addrule("PKG_VERSION=python2-yaml|5-1") +self.addrule("FILE_EXIST=lib/python2/file") self.expectfailure = True diff --git a/test/pacman/tests/replace110.py b/test/pacman/tests/replace110.py new file mode 100644 index 00000000..c6e2e5f0 --- /dev/null +++ b/test/pacman/tests/replace110.py @@ -0,0 +1,27 @@ +self.description = "Replace a package with a file in 'backup' (local modified)" +# FS#24543 + +lp = pmpkg("dummy") +lp.files = ["etc/dummy.conf*", "bin/dummy"] +lp.backup = ["etc/dummy.conf"] +self.addpkg2db("local", lp) + +sp = pmpkg("replacement") +sp.replaces = ["dummy"] +sp.files = ["etc/dummy.conf", "bin/dummy*"] +sp.backup = ["etc/dummy.conf"] +self.addpkg2db("sync", sp) + +self.args = "-Su" + +self.addrule("!PKG_EXIST=dummy") +self.addrule("PKG_EXIST=replacement") + +self.addrule("FILE_EXIST=etc/dummy.conf") +self.addrule("!FILE_MODIFIED=etc/dummy.conf") +self.addrule("!FILE_PACNEW=etc/dummy.conf") +self.addrule("!FILE_PACSAVE=etc/dummy.conf") + +self.addrule("FILE_EXIST=bin/dummy") + +self.expectfailure = True -- cgit v1.2.3-70-g09d2