Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com> --- 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(-) diff --git a/test/pacman/tests/fileconflict007.py b/test/pacman/tests/fileconflict007.py index 4ee4624..7fe65ed 100644 --- a/test/pacman/tests/fileconflict007.py +++ b/test/pacman/tests/fileconflict007.py @@ -1,17 +1,18 @@ self.description = "Fileconflict with symlinks (klibc case)" lp = pmpkg("pkg") lp.files = ["dir/realdir/", "dir/symdir -> realdir", "dir/realdir/file"] self.addpkg2db("local", lp) p = pmpkg("pkg", "1.0-2") p.files = ["dir/symdir/file"] self.addpkg(p) 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 a83923c..5c3a43b 100644 --- a/test/pacman/tests/fileconflict013.py +++ b/test/pacman/tests/fileconflict013.py @@ -1,20 +1,23 @@ 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/", "usr/lib/", "lib -> usr/lib/"] self.addpkg2db("local", lp1) lp2 = pmpkg("pkg1", "1.0-1") lp2.files = ["lib/libfoo.so"] self.addpkg2db("local", lp2) sp1 = pmpkg("pkg1", "1.0-2") sp1.files = ["usr/lib/libfoo.so"] 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 5759d4c..5ff0b53 100644 --- a/test/pacman/tests/fileconflict022.py +++ b/test/pacman/tests/fileconflict022.py @@ -1,19 +1,18 @@ self.description = "File conflict between package with symlink and package with real path" self.filesystem = ["usr/lib/", "lib -> usr/lib/"] sp1 = pmpkg("foo") # share/ causes the entries to be reordered after path resolution sp1.files = ["lib/", "lib/file", "share/"] self.addpkg2db("sync", sp1) sp2 = pmpkg("bar") sp2.files = ["usr/", "usr/lib/", "usr/lib/file"] 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 ce72087..9685c0d 100644 --- a/test/pacman/tests/fileconflict023.py +++ b/test/pacman/tests/fileconflict023.py @@ -1,18 +1,21 @@ 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/"] lp1 = pmpkg("foo") lp1.files = ["lib/", "lib/file"] self.addpkg2db("local", lp1) sp1 = pmpkg("bar") sp1.conflicts = ["foo"] sp1.files = ["usr/", "usr/lib/", "usr/lib/file"] 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 3c6f063..195badb 100644 --- a/test/pacman/tests/fileconflict025.py +++ b/test/pacman/tests/fileconflict025.py @@ -1,18 +1,20 @@ -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/"] lp1 = pmpkg("foo") lp1.files = ["usr/", "usr/lib/", "usr/lib/file"] self.addpkg2db("local", lp1) sp1 = pmpkg("bar") sp1.conflicts = ["foo"] sp1.files = ["lib/", "lib/file"] 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 cbf71cc..f88d0ae 100644 --- a/test/pacman/tests/symlink001.py +++ b/test/pacman/tests/symlink001.py @@ -1,20 +1,21 @@ self.description = "Dir symlinks overwritten on install (the perl/git bug)" lp = pmpkg("dummy") lp.files = ["dir/realdir/", "dir/symdir -> realdir"] self.addpkg2db("local", lp) p = pmpkg("pkg1") p.files = ["dir/symdir/tmp"] 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 9748c81..3948b00 100644 --- a/test/pacman/tests/sync700.py +++ b/test/pacman/tests/sync700.py @@ -1,22 +1,22 @@ -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", "lib -> usr/lib"] self.addpkg2db("local", lp1) lp2 = pmpkg("pkg2") lp2.files = ["lib/bar"] self.addpkg2db("local", lp2) p = pmpkg("pkg1", "1.0-2") p.files = ["usr/lib/foo"] 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 201f602..590845f 100644 --- a/test/pacman/tests/sync701.py +++ b/test/pacman/tests/sync701.py @@ -1,22 +1,21 @@ -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", "lib -> usr/lib"] self.addpkg2db("local", lp) p1 = pmpkg("pkg1", "1.0-2") p1.files = ["usr/lib/foo"] self.addpkg2db("sync", p1) p2 = pmpkg("pkg2") p2.files = ["lib/bar"] 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 ee4eef9..8f4c0ad 100644 --- a/test/pacman/tests/sync702.py +++ b/test/pacman/tests/sync702.py @@ -1,22 +1,23 @@ -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", "lib -> usr/lib"] self.addpkg2db("local", lp) p1 = pmpkg("pkg1") p1.files = ["lib/bar"] self.addpkg2db("sync", p1) p2 = pmpkg("pkg2", "1.0-2") p2.files = ["usr/lib/foo"] 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 -- 1.8.2.1