diff options
author | Dan McGee <dan@archlinux.org> | 2011-10-26 23:43:36 +0200 |
---|---|---|
committer | Dan McGee <dan@archlinux.org> | 2011-10-27 00:31:43 +0200 |
commit | 5c1885b55eae870a10c91793d05a74d74a075e83 (patch) | |
tree | 3160bb76a3b24c28640f79340b650c101bbe15e7 /test | |
parent | 7a6b01d46c1da385dd34466e757beafa33e02afa (diff) | |
download | pacman-5c1885b55eae870a10c91793d05a74d74a075e83.tar.gz pacman-5c1885b55eae870a10c91793d05a74d74a075e83.tar.xz |
Add some unowned symlink replacement tests
These should all prevent installation, and yet two of the three tests
currently fail. Not good.
The best way to see what is going on here is to diff the three new tests
side by side- there is only a small difference between the three tests,
and that is in the destination of the symlink in question that should
never be overwritten.
symlink010.py: myprogsuffix -> myprog
symlink011.py: myprogsuffix -> broken
symlink012.py: myprogsuffix -> otherprog
Signed-off-by: Dan McGee <dan@archlinux.org>
Diffstat (limited to 'test')
-rw-r--r-- | test/pacman/tests/fileconflict007.py | 2 | ||||
-rw-r--r-- | test/pacman/tests/symlink010.py | 26 | ||||
-rw-r--r-- | test/pacman/tests/symlink011.py | 26 | ||||
-rw-r--r-- | test/pacman/tests/symlink012.py | 24 |
4 files changed, 77 insertions, 1 deletions
diff --git a/test/pacman/tests/fileconflict007.py b/test/pacman/tests/fileconflict007.py index 7e6d85ef..4ee4624e 100644 --- a/test/pacman/tests/fileconflict007.py +++ b/test/pacman/tests/fileconflict007.py @@ -3,7 +3,7 @@ self.description = "Fileconflict with symlinks (klibc case)" lp = pmpkg("pkg") lp.files = ["dir/realdir/", "dir/symdir -> realdir", - "dir/realdir/file"] + "dir/realdir/file"] self.addpkg2db("local", lp) p = pmpkg("pkg", "1.0-2") diff --git a/test/pacman/tests/symlink010.py b/test/pacman/tests/symlink010.py new file mode 100644 index 00000000..8c80dbc9 --- /dev/null +++ b/test/pacman/tests/symlink010.py @@ -0,0 +1,26 @@ +self.description = "Unowned identical symlink pointing to file in package" + +lp = pmpkg("dummy") +lp.files = ["usr/bin/myprog"] +self.addpkg2db("local", lp) + +self.filesystem = ["usr/bin/otherprog", + "usr/bin/myprogsuffix -> myprog"] + +p = pmpkg("dummy", "1.0-2") +p.files = ["usr/bin/myprog", + "usr/bin/myprogsuffix -> myprog"] +self.addpkg(p) + +self.args = "-U %s" % p.filename() + +self.addrule("PACMAN_RETCODE=1") +self.addrule("PKG_VERSION=dummy|1.0-1") +self.addrule("FILE_EXIST=usr/bin/myprog") +self.addrule("LINK_EXIST=usr/bin/myprogsuffix") +self.addrule("FILE_EXIST=usr/bin/otherprog") +self.addrule("FILE_TYPE=usr/bin/myprog|file") +self.addrule("FILE_TYPE=usr/bin/myprogsuffix|link") +self.addrule("FILE_TYPE=usr/bin/otherprog|file") + +self.expectfailure = True diff --git a/test/pacman/tests/symlink011.py b/test/pacman/tests/symlink011.py new file mode 100644 index 00000000..85101725 --- /dev/null +++ b/test/pacman/tests/symlink011.py @@ -0,0 +1,26 @@ +self.description = "Unowned broken symlink replaced by one in package" + +lp = pmpkg("dummy") +lp.files = ["usr/bin/myprog"] +self.addpkg2db("local", lp) + +self.filesystem = ["usr/bin/otherprog", + "usr/bin/myprogsuffix -> broken"] + +p = pmpkg("dummy", "1.0-2") +p.files = ["usr/bin/myprog", + "usr/bin/myprogsuffix -> myprog"] +self.addpkg(p) + +self.args = "-U %s" % p.filename() + +self.addrule("PACMAN_RETCODE=1") +self.addrule("PKG_VERSION=dummy|1.0-1") +self.addrule("FILE_EXIST=usr/bin/myprog") +self.addrule("LINK_EXIST=usr/bin/myprogsuffix") +self.addrule("FILE_EXIST=usr/bin/otherprog") +self.addrule("FILE_TYPE=usr/bin/myprog|file") +self.addrule("FILE_TYPE=usr/bin/myprogsuffix|link") +self.addrule("FILE_TYPE=usr/bin/otherprog|file") + +self.expectfailure = True diff --git a/test/pacman/tests/symlink012.py b/test/pacman/tests/symlink012.py new file mode 100644 index 00000000..6a73bbbc --- /dev/null +++ b/test/pacman/tests/symlink012.py @@ -0,0 +1,24 @@ +self.description = "Unowned symlink when pointing to different file" + +lp = pmpkg("dummy") +lp.files = ["usr/bin/myprog"] +self.addpkg2db("local", lp) + +self.filesystem = ["usr/bin/otherprog", + "usr/bin/myprogsuffix -> otherprog"] + +p = pmpkg("dummy", "1.0-2") +p.files = ["usr/bin/myprog", + "usr/bin/myprogsuffix -> myprog"] +self.addpkg(p) + +self.args = "-U %s" % p.filename() + +self.addrule("PACMAN_RETCODE=1") +self.addrule("PKG_VERSION=dummy|1.0-1") +self.addrule("FILE_EXIST=usr/bin/myprog") +self.addrule("LINK_EXIST=usr/bin/myprogsuffix") +self.addrule("FILE_EXIST=usr/bin/otherprog") +self.addrule("FILE_TYPE=usr/bin/myprog|file") +self.addrule("FILE_TYPE=usr/bin/myprogsuffix|link") +self.addrule("FILE_TYPE=usr/bin/otherprog|file") |