From 0c41663c7b5a9d73ea49c20b74149d12f0fcd26c Mon Sep 17 00:00:00 2001 From: Andrew Gregory Date: Sat, 2 Mar 2013 23:26:56 -0500 Subject: update tests for symlink support removal Signed-off-by: Andrew Gregory Signed-off-by: Allan McRae --- test/pacman/tests/fileconflict007.py | 1 + test/pacman/tests/fileconflict013.py | 7 +++++-- test/pacman/tests/fileconflict022.py | 1 - test/pacman/tests/fileconflict023.py | 9 ++++++--- test/pacman/tests/fileconflict025.py | 10 ++++++---- test/pacman/tests/symlink001.py | 11 ++++++----- test/pacman/tests/sync700.py | 12 ++++++------ test/pacman/tests/sync701.py | 11 +++++------ test/pacman/tests/sync702.py | 9 +++++---- 9 files changed, 40 insertions(+), 31 deletions(-) (limited to 'test') diff --git a/test/pacman/tests/fileconflict007.py b/test/pacman/tests/fileconflict007.py index 4ee4624e..7fe65ed4 100644 --- a/test/pacman/tests/fileconflict007.py +++ b/test/pacman/tests/fileconflict007.py @@ -15,3 +15,4 @@ self.args = "-U %s" % p.filename() self.addrule("PACMAN_RETCODE=0") self.addrule("PKG_EXIST=pkg") self.addrule("PKG_VERSION=pkg|1.0-2") +self.addrule("FILE_TYPE=dir/symdir/|dir") diff --git a/test/pacman/tests/fileconflict013.py b/test/pacman/tests/fileconflict013.py index a83923c6..5c3a43b1 100644 --- a/test/pacman/tests/fileconflict013.py +++ b/test/pacman/tests/fileconflict013.py @@ -1,4 +1,5 @@ self.description = "file->file path change with same effective path (/lib as symlink)" +# Note: this situation means the filesystem and local db are out of sync lp1 = pmpkg("filesystem", "1.0-1") lp1.files = ["usr/", @@ -16,5 +17,7 @@ self.addpkg2db("sync", sp1) self.args = "-Su" -self.addrule("PACMAN_RETCODE=0") -self.addrule("PKG_VERSION=pkg1|1.0-2") +self.addrule("PACMAN_RETCODE=1") +self.addrule("PKG_VERSION=pkg1|1.0-1") + +self.expectfailure = True diff --git a/test/pacman/tests/fileconflict022.py b/test/pacman/tests/fileconflict022.py index 5759d4c3..5ff0b537 100644 --- a/test/pacman/tests/fileconflict022.py +++ b/test/pacman/tests/fileconflict022.py @@ -14,6 +14,5 @@ self.addpkg2db("sync", sp2) self.args = "-S %s %s" % (sp1.name, sp2.name) self.addrule("PACMAN_RETCODE=1") -self.addrule("PACMAN_OUTPUT=.*/usr/lib/file exists in both 'foo' and 'bar'") self.addrule("!PKG_EXIST=foo") self.addrule("!PKG_EXIST=bar") diff --git a/test/pacman/tests/fileconflict023.py b/test/pacman/tests/fileconflict023.py index ce72087b..9685c0dd 100644 --- a/test/pacman/tests/fileconflict023.py +++ b/test/pacman/tests/fileconflict023.py @@ -1,4 +1,5 @@ self.description = "File conflict between package with symlink and package with real path resolved by removal" +# Note: this situation means the filesystem and local db are out of sync self.filesystem = ["usr/", "usr/lib/", "lib -> usr/lib/"] @@ -13,6 +14,8 @@ self.addpkg2db("sync", sp1) self.args = "-S %s --ask=4" % sp1.name -self.addrule("PACMAN_RETCODE=0") -self.addrule("!PKG_EXIST=foo") -self.addrule("PKG_EXIST=bar") +self.addrule("PACMAN_RETCODE=1") +self.addrule("PKG_EXIST=foo") +self.addrule("!PKG_EXIST=bar") + +self.expectfailure = True diff --git a/test/pacman/tests/fileconflict025.py b/test/pacman/tests/fileconflict025.py index 3c6f0638..195badbc 100644 --- a/test/pacman/tests/fileconflict025.py +++ b/test/pacman/tests/fileconflict025.py @@ -1,4 +1,4 @@ -self.description = "File conflict between package with symlink and package with real path resolved by removal (reversed)" +self.description = "File conflict between package with symlink and package with real path and filesystem (reversed)" self.filesystem = ["usr/lib/", "lib -> usr/lib/"] @@ -13,6 +13,8 @@ self.addpkg2db("sync", sp1) self.args = "-S %s --ask=4" % sp1.name -self.addrule("PACMAN_RETCODE=0") -self.addrule("!PKG_EXIST=foo") -self.addrule("PKG_EXIST=bar") +self.addrule("PACMAN_RETCODE=1") +self.addrule("PKG_EXIST=foo") +self.addrule("!PKG_EXIST=bar") + +self.expectfailure = True diff --git a/test/pacman/tests/symlink001.py b/test/pacman/tests/symlink001.py index cbf71ccc..f88d0ae7 100644 --- a/test/pacman/tests/symlink001.py +++ b/test/pacman/tests/symlink001.py @@ -11,10 +11,11 @@ self.addpkg(p) self.args = "-U %s" % p.filename() -self.addrule("PACMAN_RETCODE=0") -self.addrule("PKG_EXIST=pkg1") -self.addrule("FILE_EXIST=dir/symdir/tmp") -self.addrule("FILE_EXIST=dir/realdir/tmp") -self.addrule("FILE_TYPE=dir/symdir/tmp|file") +self.addrule("PACMAN_RETCODE=1") +self.addrule("!PKG_EXIST=pkg1") +self.addrule("!FILE_EXIST=dir/symdir/tmp") +self.addrule("!FILE_EXIST=dir/realdir/tmp") self.addrule("FILE_TYPE=dir/symdir|link") self.addrule("FILE_TYPE=dir/realdir|dir") + +self.expectfailure = True diff --git a/test/pacman/tests/sync700.py b/test/pacman/tests/sync700.py index 9748c819..3948b006 100644 --- a/test/pacman/tests/sync700.py +++ b/test/pacman/tests/sync700.py @@ -1,4 +1,5 @@ -self.description = "do not remove directory symlink if another package has file in its path" +self.description = "removal of directory symlink when another package has file in its path" +# Note: this situation means that the filesystem and local db are out of sync lp1 = pmpkg("pkg1") lp1.files = ["usr/lib/foo", @@ -15,8 +16,7 @@ self.addpkg2db("sync", p) self.args = "-S pkg1" -self.addrule("PACMAN_RETCODE=1") -self.addrule("PKG_VERSION=pkg1|1.0-1") -self.addrule("FILE_EXIST=lib/bar") - -self.expectfailure = True +self.addrule("PACMAN_RETCODE=0") +self.addrule("PKG_VERSION=pkg1|1.0-2") +self.addrule("FILE_EXIST=usr/lib/bar") +self.addrule("!FILE_EXIST=lib/bar") diff --git a/test/pacman/tests/sync701.py b/test/pacman/tests/sync701.py index 201f6028..590845ff 100644 --- a/test/pacman/tests/sync701.py +++ b/test/pacman/tests/sync701.py @@ -1,4 +1,4 @@ -self.description = "do not remove directory symlink if incoming package has file in its path (order 1)" +self.description = "incoming package replaces symlink with directory (order 1)" lp = pmpkg("pkg1") lp.files = ["usr/lib/foo", @@ -15,8 +15,7 @@ self.addpkg2db("sync", p2) self.args = "-S pkg1 pkg2" -self.addrule("PACMAN_RETCODE=1") -self.addrule("PKG_VERSION=pkg1|1.0-1") -self.addrule("!PKG_EXIST=pkg2") - -self.expectfailure = True +self.addrule("PACMAN_RETCODE=0") +self.addrule("PKG_VERSION=pkg1|1.0-2") +self.addrule("PKG_EXIST=pkg2") +self.addrule("FILE_TYPE=lib|dir") diff --git a/test/pacman/tests/sync702.py b/test/pacman/tests/sync702.py index ee4eef95..8f4c0ad7 100644 --- a/test/pacman/tests/sync702.py +++ b/test/pacman/tests/sync702.py @@ -1,4 +1,4 @@ -self.description = "do not remove directory symlink if incoming package has file in its path (order 2)" +self.description = "incoming package replaces symlink with directory (order 2)" lp = pmpkg("pkg2") lp.files = ["usr/lib/foo", @@ -15,8 +15,9 @@ self.addpkg2db("sync", p2) self.args = "-S pkg1 pkg2" -self.addrule("PACMAN_RETCODE=1") -self.addrule("PKG_VERSION=pkg2|1.0-1") -self.addrule("!PKG_EXIST=pkg1") +self.addrule("PACMAN_RETCODE=0") +self.addrule("PKG_VERSION=pkg2|1.0-2") +self.addrule("PKG_EXIST=pkg1") +self.addrule("FILE_TYPE=lib|dir") self.expectfailure = True -- cgit v1.2.3-24-g4f1b