summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xtest/pacman/pmdb.py2
-rwxr-xr-xtest/pacman/pmenv.py2
-rwxr-xr-xtest/pacman/pmfile.py2
-rwxr-xr-xtest/pacman/pmpkg.py2
-rwxr-xr-xtest/pacman/pmrule.py2
-rwxr-xr-xtest/pacman/pmtest.py2
-rw-r--r--test/pacman/tests/provision002.py22
-rw-r--r--test/pacman/tests/provision003.py23
-rw-r--r--test/pacman/tests/provision004.py21
-rw-r--r--test/pacman/tests/sync023.py3
-rwxr-xr-xtest/pacman/util.py5
11 files changed, 78 insertions, 8 deletions
diff --git a/test/pacman/pmdb.py b/test/pacman/pmdb.py
index bb5aab92..b31498a7 100755
--- a/test/pacman/pmdb.py
+++ b/test/pacman/pmdb.py
@@ -72,7 +72,7 @@ def _mksection(title, data):
"%s\n" % (title, s)
-class pmdb:
+class pmdb(object):
"""Database object
"""
diff --git a/test/pacman/pmenv.py b/test/pacman/pmenv.py
index 5b61de2c..40444829 100755
--- a/test/pacman/pmenv.py
+++ b/test/pacman/pmenv.py
@@ -22,7 +22,7 @@ import os.path
import pmtest
-class pmenv:
+class pmenv(object):
"""Environment object
"""
diff --git a/test/pacman/pmfile.py b/test/pacman/pmfile.py
index 6770bca8..bd03a24e 100755
--- a/test/pacman/pmfile.py
+++ b/test/pacman/pmfile.py
@@ -20,7 +20,7 @@ import os
import util
-class pmfile:
+class pmfile(object):
"""File object
"""
diff --git a/test/pacman/pmpkg.py b/test/pacman/pmpkg.py
index 336f2974..73156ab2 100755
--- a/test/pacman/pmpkg.py
+++ b/test/pacman/pmpkg.py
@@ -24,7 +24,7 @@ import tarfile
import util
-class pmpkg:
+class pmpkg(object):
"""Package object.
Object holding data from an ArchLinux package.
diff --git a/test/pacman/pmrule.py b/test/pacman/pmrule.py
index 3ba72fe7..c6412aa4 100755
--- a/test/pacman/pmrule.py
+++ b/test/pacman/pmrule.py
@@ -20,7 +20,7 @@ import stat
import util
-class pmrule:
+class pmrule(object):
"""Rule object
"""
diff --git a/test/pacman/pmtest.py b/test/pacman/pmtest.py
index 31517a9a..4f3b122f 100755
--- a/test/pacman/pmtest.py
+++ b/test/pacman/pmtest.py
@@ -28,7 +28,7 @@ import pmfile
import util
from util import vprint
-class pmtest:
+class pmtest(object):
"""Test object
"""
diff --git a/test/pacman/tests/provision002.py b/test/pacman/tests/provision002.py
new file mode 100644
index 00000000..49b88a18
--- /dev/null
+++ b/test/pacman/tests/provision002.py
@@ -0,0 +1,22 @@
+self.description = "-S provision, multiple providers, one installed"
+
+sp = pmpkg("pkg1", "1.0-2")
+sp.provides = ["pkg-env"]
+self.addpkg2db("sync", sp)
+
+sp = pmpkg("pkg2", "1.0-2")
+sp.provides = ["pkg-env"]
+self.addpkg2db("sync", sp)
+
+lp = pmpkg("pkg2")
+lp.provides = ["pkg-env"]
+self.addpkg2db("local", lp)
+
+self.args = "-S pkg-env"
+
+self.addrule("PACMAN_RETCODE=0")
+self.addrule("!PKG_EXIST=pkg1")
+self.addrule("PKG_EXIST=pkg2")
+self.addrule("PKG_VERSION=pkg2|1.0-2")
+
+self.expectfailure = True
diff --git a/test/pacman/tests/provision003.py b/test/pacman/tests/provision003.py
new file mode 100644
index 00000000..9308be6e
--- /dev/null
+++ b/test/pacman/tests/provision003.py
@@ -0,0 +1,23 @@
+self.description = "-S provision, multiple providers, one installed, different repos"
+
+sp = pmpkg("pkg1", "1.0-2")
+sp.provides = ["pkg-env"]
+self.addpkg2db("sync", sp)
+
+sp = pmpkg("pkg2", "1.0-2")
+sp.provides = ["pkg-env"]
+# this repo will be sorted second alphabetically
+self.addpkg2db("sync2", sp)
+
+lp = pmpkg("pkg2")
+lp.provides = ["pkg-env"]
+self.addpkg2db("local", lp)
+
+self.args = "-S pkg-env"
+
+self.addrule("PACMAN_RETCODE=0")
+self.addrule("!PKG_EXIST=pkg1")
+self.addrule("PKG_EXIST=pkg2")
+self.addrule("PKG_VERSION=pkg2|1.0-2")
+
+self.expectfailure = True
diff --git a/test/pacman/tests/provision004.py b/test/pacman/tests/provision004.py
new file mode 100644
index 00000000..696fa79f
--- /dev/null
+++ b/test/pacman/tests/provision004.py
@@ -0,0 +1,21 @@
+self.description = "-S literal with provision of same name installed"
+
+sp = pmpkg("provision", "1.0-2")
+sp.provides = ["literal"]
+sp.conflicts = ["literal"]
+self.addpkg2db("sync", sp)
+
+sp = pmpkg("literal", "1.0-2")
+self.addpkg2db("sync2", sp)
+
+lp = pmpkg("provision")
+lp.provides = ["literal"]
+lp.conflicts = ["literal"]
+self.addpkg2db("local", lp)
+
+self.args = "-S literal --ask=4"
+
+self.addrule("PACMAN_RETCODE=0")
+self.addrule("!PKG_EXIST=provision")
+self.addrule("PKG_EXIST=literal")
+self.addrule("PKG_VERSION=literal|1.0-2")
diff --git a/test/pacman/tests/sync023.py b/test/pacman/tests/sync023.py
index 8233ab73..3644c9de 100644
--- a/test/pacman/tests/sync023.py
+++ b/test/pacman/tests/sync023.py
@@ -15,7 +15,8 @@ for p in lp1, lp2, lp3, sp1, sp2, sp3, newp1:
for p in lp1, lp2, lp3:
self.addpkg2db("local", p)
-self.addpkg2db("testing", newp1);
+# repos are sorted in alpha order
+self.addpkg2db("atesting", newp1);
for p in sp1, sp2, sp3:
self.addpkg2db("sync", p);
diff --git a/test/pacman/util.py b/test/pacman/util.py
index 652467ae..359b42bf 100755
--- a/test/pacman/util.py
+++ b/test/pacman/util.py
@@ -125,8 +125,11 @@ def mkcfgfile(filename, root, option, db):
data.extend(["%s = %s" % (key, j) for j in value])
# Repositories
- for key, value in db.iteritems():
+ # sort by repo name so tests can predict repo order, rather than be
+ # subjects to the whims of python dict() ordering
+ for key in sorted(db.iterkeys()):
if key != "local":
+ value = db[key]
data.append("[%s]\n" \
"Server = file://%s" \
% (value.treename,