summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorDan McGee <dan@archlinux.org>2011-06-03 14:37:51 -0500
committerDan McGee <dan@archlinux.org>2011-06-03 14:37:51 -0500
commitcc25576f8b54b3e975949ac7991a193053b519bc (patch)
tree546febcbf96be529f4326b526841ca4c2ec8c9de /test
parente68f5d9a30671419c853b255b32b2e9d0239c9f1 (diff)
downloadpacman-cc25576f8b54b3e975949ac7991a193053b519bc.tar.xz
Use standard errno codes in return from _alpm_archive_fgets
This allows us to not require the context (e.g. handle) when calling this function. Also beef up the checks in the two callers of this function to bail if the last return code is not ARCHIVE_EOF, which is the expected value. This requires a change to one of the pactest return codes and the overall result of the test, but results in a much safer operating condition whereby invalid database entries will stop the operation. Signed-off-by: Dan McGee <dan@archlinux.org>
Diffstat (limited to 'test')
-rwxr-xr-xtest/pacman/pactest.py1
-rw-r--r--test/pacman/tests/smoke002.py12
2 files changed, 6 insertions, 7 deletions
diff --git a/test/pacman/pactest.py b/test/pacman/pactest.py
index 64d56510..77f87da6 100755
--- a/test/pacman/pactest.py
+++ b/test/pacman/pactest.py
@@ -114,6 +114,7 @@ if __name__ == "__main__":
env.results()
if env.failed > 0:
+ print "pacman testing root saved: %s" % root_path
sys.exit(1)
if not opts.keeproot:
diff --git a/test/pacman/tests/smoke002.py b/test/pacman/tests/smoke002.py
index 44f2d0ec..8ff5cab7 100644
--- a/test/pacman/tests/smoke002.py
+++ b/test/pacman/tests/smoke002.py
@@ -10,10 +10,8 @@ self.addpkg(p2)
self.args = "-U %s %s" % (p1.filename(), p2.filename())
-# Note that the current cutoff on line length is 512K, so the first package
-# will succeed while the second one will fail to record the description.
-self.addrule("PACMAN_RETCODE=0")
-self.addrule("PKG_EXIST=pkg1")
-self.addrule("PKG_DESC=pkg1|%s" % p1.desc)
-self.addrule("PKG_EXIST=pkg1")
-self.addrule("!PKG_DESC=pkg1|%s" % p2.desc)
+# We error out when fed a package with an invalid description; the second one
+# fits the bill in this case as the desc is > 512K
+self.addrule("PACMAN_RETCODE=1")
+self.addrule("!PKG_EXIST=pkg1")
+self.addrule("!PKG_EXIST=pkg1")