summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/pacman/pmpkg.py2
-rw-r--r--test/pacman/pmtest.py2
-rw-r--r--test/pacman/tests/fileconflict007.py1
-rw-r--r--test/pacman/tests/fileconflict013.py5
-rw-r--r--test/pacman/tests/fileconflict022.py1
-rw-r--r--test/pacman/tests/fileconflict023.py7
-rw-r--r--test/pacman/tests/fileconflict025.py8
-rw-r--r--test/pacman/tests/fileconflict030.py17
-rw-r--r--test/pacman/tests/ignore005.py2
-rw-r--r--test/pacman/tests/symlink001.py9
-rw-r--r--test/pacman/tests/symlink020.py20
-rw-r--r--test/pacman/tests/sync140.py2
-rw-r--r--test/pacman/tests/sync141.py2
-rw-r--r--test/pacman/tests/sync700.py12
-rw-r--r--test/pacman/tests/sync701.py11
-rw-r--r--test/pacman/tests/sync702.py11
-rw-r--r--test/pacman/tests/unresolvable001.py2
-rw-r--r--test/pacman/tests/upgrade045.py3
-rw-r--r--test/pacman/tests/upgrade090.py2
-rw-r--r--test/pacman/util.py2
-rwxr-xr-xtest/scripts/parseopts_test.sh2
21 files changed, 81 insertions, 42 deletions
diff --git a/test/pacman/pmpkg.py b/test/pacman/pmpkg.py
index 988c73f3..9b3147a3 100644
--- a/test/pacman/pmpkg.py
+++ b/test/pacman/pmpkg.py
@@ -160,6 +160,8 @@ class pmpkg(object):
info = tarfile.TarInfo(fileinfo["filename"])
if fileinfo["hasperms"]:
info.mode = fileinfo["perms"]
+ elif fileinfo["isdir"]:
+ info.mode = 0755
if fileinfo["isdir"]:
info.type = tarfile.DIRTYPE
tar.addfile(info)
diff --git a/test/pacman/pmtest.py b/test/pacman/pmtest.py
index 2eafe682..f5a96805 100644
--- a/test/pacman/pmtest.py
+++ b/test/pacman/pmtest.py
@@ -241,7 +241,7 @@ class pmtest(object):
# archives are made available more easily.
time_start = time.time()
self.retcode = subprocess.call(cmd, stdout=output, stderr=output,
- cwd=os.path.join(self.root, util.TMPDIR))
+ cwd=os.path.join(self.root, util.TMPDIR), env={'LC_ALL': 'C'})
time_end = time.time()
vprint("\ttime elapsed: %.2fs" % (time_end - time_start))
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..aacb730a 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,5 @@ 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")
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..1a7eaaf7 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,6 @@ 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")
diff --git a/test/pacman/tests/fileconflict025.py b/test/pacman/tests/fileconflict025.py
index 3c6f0638..263c81d4 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,6 @@ 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")
diff --git a/test/pacman/tests/fileconflict030.py b/test/pacman/tests/fileconflict030.py
new file mode 100644
index 00000000..1de77813
--- /dev/null
+++ b/test/pacman/tests/fileconflict030.py
@@ -0,0 +1,17 @@
+self.description = "Dir->file transition filesystem conflict resolved by removal"
+
+lp1 = pmpkg("foo")
+lp1.files = ["foo/"]
+self.addpkg2db("local", lp1)
+
+sp1 = pmpkg("bar")
+sp1.conflicts = ["foo"]
+sp1.files = ["foo"]
+self.addpkg2db("sync", sp1)
+
+self.args = "-S %s --ask=4" % sp1.name
+
+self.addrule("PACMAN_RETCODE=0")
+self.addrule("PKG_EXIST=bar")
+self.addrule("!PKG_EXIST=foo")
+self.addrule("FILE_EXIST=foo")
diff --git a/test/pacman/tests/ignore005.py b/test/pacman/tests/ignore005.py
index 274e44c3..51bcba39 100644
--- a/test/pacman/tests/ignore005.py
+++ b/test/pacman/tests/ignore005.py
@@ -36,7 +36,7 @@ self.addpkg2db("sync", packageA5up)
self.option["IgnorePkg"] = ["packageA3"]
-self.args = "-S packageA1 packageA2 --ask=32"
+self.args = "-S packageA1 packageA2 --ask=16"
self.addrule("PACMAN_RETCODE=0")
self.addrule("PKG_VERSION=packageA1|1.0-1")
diff --git a/test/pacman/tests/symlink001.py b/test/pacman/tests/symlink001.py
index cbf71ccc..91365512 100644
--- a/test/pacman/tests/symlink001.py
+++ b/test/pacman/tests/symlink001.py
@@ -11,10 +11,9 @@ 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")
diff --git a/test/pacman/tests/symlink020.py b/test/pacman/tests/symlink020.py
new file mode 100644
index 00000000..343add2d
--- /dev/null
+++ b/test/pacman/tests/symlink020.py
@@ -0,0 +1,20 @@
+self.description = "symlink -> dir replacment"
+
+lp1 = pmpkg("pkg1")
+lp1.files = ["usr/lib/foo",
+ "lib -> usr/lib/"]
+self.addpkg2db("local", lp1)
+
+lp1 = pmpkg("pkg2")
+lp1.files = ["usr/lib/bar"]
+self.addpkg2db("local", lp1)
+
+sp = pmpkg("pkg1", "1.0-2")
+sp.files = ["lib/bar"]
+self.addpkg2db("sync", sp)
+
+self.args = "-S %s" % sp.name
+
+self.addrule("PACMAN_RETCODE=0")
+self.addrule("FILE_TYPE=lib|dir")
+self.addrule("FILE_TYPE=lib/bar|file")
diff --git a/test/pacman/tests/sync140.py b/test/pacman/tests/sync140.py
index ce21cc33..fbe750f2 100644
--- a/test/pacman/tests/sync140.py
+++ b/test/pacman/tests/sync140.py
@@ -18,7 +18,7 @@ sp3.depends = ["gcc-libs"]
for p in sp1, sp2, sp3:
self.addpkg2db("sync", p)
-self.args = "-Su --ignore %s --ask=32" % sp1.name
+self.args = "-Su --ignore %s --ask=16" % sp1.name
self.addrule("PACMAN_RETCODE=0")
self.addrule("PKG_VERSION=glibc|1.0-1")
diff --git a/test/pacman/tests/sync141.py b/test/pacman/tests/sync141.py
index f2f01364..02f7be81 100644
--- a/test/pacman/tests/sync141.py
+++ b/test/pacman/tests/sync141.py
@@ -18,7 +18,7 @@ sp3.depends = ["b_gcc-libs"]
for p in sp1, sp2, sp3:
self.addpkg2db("sync", p)
-self.args = "-Su --ignore %s --ask=32" % sp1.name
+self.args = "-Su --ignore %s --ask=16" % sp1.name
self.addrule("PACMAN_RETCODE=0")
self.addrule("PKG_VERSION=c_glibc|1.0-1")
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..c3e2320a 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,7 @@ 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.expectfailure = True
+self.addrule("PACMAN_RETCODE=0")
+self.addrule("PKG_VERSION=pkg2|1.0-2")
+self.addrule("PKG_EXIST=pkg1")
+self.addrule("FILE_TYPE=lib|dir")
diff --git a/test/pacman/tests/unresolvable001.py b/test/pacman/tests/unresolvable001.py
index 9d54c3e5..4e5da6f3 100644
--- a/test/pacman/tests/unresolvable001.py
+++ b/test/pacman/tests/unresolvable001.py
@@ -11,7 +11,7 @@ packageA2up = pmpkg("package")
packageA2up.depends = ["dep"];
self.addpkg2db("sync", packageA2up)
-self.args = "-S package dep --ask=32"
+self.args = "-S package dep --ask=16"
self.addrule("PACMAN_RETCODE=0")
self.addrule("PKG_EXIST=package")
diff --git a/test/pacman/tests/upgrade045.py b/test/pacman/tests/upgrade045.py
index 3b7f4769..c909aa08 100644
--- a/test/pacman/tests/upgrade045.py
+++ b/test/pacman/tests/upgrade045.py
@@ -14,4 +14,5 @@ self.args = "-U %s" % p1.filename()
self.addrule("PACMAN_RETCODE=0")
self.addrule("PKG_VERSION=foo|1.0-2")
-self.addrule("FILE_EXIST=etc/foo.cfg")
+self.addrule("LINK_EXIST=etc/foo.cfg")
+self.addrule("FILE_EXIST=etc/foo.cfg.pacnew")
diff --git a/test/pacman/tests/upgrade090.py b/test/pacman/tests/upgrade090.py
index 26e531c9..cdd4cace 100644
--- a/test/pacman/tests/upgrade090.py
+++ b/test/pacman/tests/upgrade090.py
@@ -16,7 +16,7 @@ sp = pmpkg("dep")
sp.files = ["bin/dep"]
self.addpkg2db("sync", sp)
-self.args = "-U %s --ask=32" % " ".join([p.filename() for p in p1, p2, p3])
+self.args = "-U %s --ask=16" % " ".join([p.filename() for p in p1, p2, p3])
self.addrule("PACMAN_RETCODE=0")
for p in p1, p2, sp:
diff --git a/test/pacman/util.py b/test/pacman/util.py
index be99cd57..65540ed3 100644
--- a/test/pacman/util.py
+++ b/test/pacman/util.py
@@ -100,7 +100,7 @@ def mkfile(base, name, data=""):
def writedata(filename, data):
if isinstance(data, list):
data = "\n".join(data)
- fd = file(filename, "w")
+ fd = open(filename, "w")
if data:
fd.write(data)
if data[-1] != "\n":
diff --git a/test/scripts/parseopts_test.sh b/test/scripts/parseopts_test.sh
index 2862caec..b7e5d08a 100755
--- a/test/scripts/parseopts_test.sh
+++ b/test/scripts/parseopts_test.sh
@@ -18,7 +18,7 @@ fi
OPT_SHORT="AcdefFghiLmop:rRsV"
OPT_LONG=('allsource' 'asroot' 'ignorearch' 'check' 'clean:' 'cleanall' 'nodeps'
'noextract' 'force' 'forcever:' 'geninteg' 'help' 'holdver'
- 'install' 'key:' 'log' 'nocolor' 'nobuild' 'nocheck' 'nosign' 'pkg:' 'rmdeps'
+ 'install' 'key:' 'log' 'nocolor' 'nobuild' 'nocheck' 'noprepare' 'nosign' 'pkg:' 'rmdeps'
'repackage' 'skipinteg' 'sign' 'source' 'syncdeps' 'version' 'config:'
'noconfirm' 'noprogressbar')