Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
path: root/pactest/tests
diff options
context:
space:
mode:
Diffstat (limited to 'pactest/tests')
-rw-r--r--pactest/tests/conflict001.py19
-rw-r--r--pactest/tests/conflict002.py13
-rw-r--r--pactest/tests/conflict003.py13
-rw-r--r--pactest/tests/conflict004.py15
-rw-r--r--pactest/tests/remove044.py16
-rw-r--r--pactest/tests/remove045.py30
-rw-r--r--pactest/tests/remove046.py10
-rw-r--r--pactest/tests/remove047.py25
-rw-r--r--pactest/tests/sync011.py20
-rw-r--r--pactest/tests/sync012.py20
-rw-r--r--pactest/tests/sync022.py22
-rw-r--r--pactest/tests/sync030.py19
-rw-r--r--pactest/tests/sync1002.py19
-rw-r--r--pactest/tests/sync1003.py26
-rw-r--r--pactest/tests/sync400.py25
-rw-r--r--pactest/tests/sync401.py21
-rw-r--r--pactest/tests/sync402.py21
-rw-r--r--pactest/tests/sync403.py21
-rw-r--r--pactest/tests/upgrade031.py19
-rw-r--r--pactest/tests/upgrade056.py1
20 files changed, 353 insertions, 22 deletions
diff --git a/pactest/tests/conflict001.py b/pactest/tests/conflict001.py
new file mode 100644
index 00000000..a9f3f6b3
--- /dev/null
+++ b/pactest/tests/conflict001.py
@@ -0,0 +1,19 @@
+self.description = "target vs db conflict will disappear after upgrade"
+
+sp1 = pmpkg("pkg1")
+sp1.conflicts = ["imaginary"]
+self.addpkg2db("sync", sp1);
+
+sp2 = pmpkg("pkg2", "1.0-2")
+self.addpkg2db("sync", sp2)
+
+lp = pmpkg("pkg2", "1.0-1")
+lp.provides = ["imaginary"]
+self.addpkg2db("local", lp)
+
+self.args = "-S %s" % " ".join([p.name for p in sp1, sp2])
+
+self.addrule("PACMAN_RETCODE=0")
+self.addrule("PKG_EXIST=pkg1")
+self.addrule("PKG_EXIST=pkg2")
+self.addrule("PKG_VERSION=pkg2|1.0-2")
diff --git a/pactest/tests/conflict002.py b/pactest/tests/conflict002.py
new file mode 100644
index 00000000..2e326f52
--- /dev/null
+++ b/pactest/tests/conflict002.py
@@ -0,0 +1,13 @@
+self.description = "conflict with version (conflict)"
+
+p = pmpkg("pkg1")
+p.conflicts = ["pkg2<=1.0-2"]
+self.addpkg(p);
+
+lp = pmpkg("pkg2", "1.0-1")
+self.addpkg2db("local", lp)
+
+self.args = "-A %s" % p.filename()
+self.addrule("PACMAN_RETCODE=1")
+self.addrule("!PKG_EXIST=pkg1")
+self.addrule("PKG_EXIST=pkg2")
diff --git a/pactest/tests/conflict003.py b/pactest/tests/conflict003.py
new file mode 100644
index 00000000..7205086a
--- /dev/null
+++ b/pactest/tests/conflict003.py
@@ -0,0 +1,13 @@
+self.description = "conflict with version (no conflict)"
+
+p = pmpkg("pkg1")
+p.conflicts = ["pkg2=1.0-2"]
+self.addpkg(p);
+
+lp = pmpkg("pkg2", "1.0-1")
+self.addpkg2db("local", lp)
+
+self.args = "-A %s" % p.filename()
+self.addrule("PACMAN_RETCODE=0")
+self.addrule("PKG_EXIST=pkg1")
+self.addrule("PKG_EXIST=pkg2")
diff --git a/pactest/tests/conflict004.py b/pactest/tests/conflict004.py
new file mode 100644
index 00000000..948017d9
--- /dev/null
+++ b/pactest/tests/conflict004.py
@@ -0,0 +1,15 @@
+self.description = "a package conflicts with itself"
+
+sp1 = pmpkg("pkg1")
+sp1.conflicts = ["pkg1"]
+self.addpkg2db("sync", sp1);
+
+sp2 = pmpkg("pkg2", "1.0-2")
+self.addpkg2db("sync", sp2)
+
+self.args = "-S %s" % " ".join([p.name for p in sp1, sp2])
+
+self.addrule("PACMAN_RETCODE=0")
+self.addrule("PKG_EXIST=pkg1")
+self.addrule("PKG_EXIST=pkg2")
+self.addrule("PKG_VERSION=pkg2|1.0-2")
diff --git a/pactest/tests/remove044.py b/pactest/tests/remove044.py
new file mode 100644
index 00000000..720c1fe7
--- /dev/null
+++ b/pactest/tests/remove044.py
@@ -0,0 +1,16 @@
+self.description = "-Rs test"
+
+lp1 = pmpkg("pkg1")
+lp1.depends = ["pkg2=1.1-1"]
+self.addpkg2db("local", lp1)
+
+lp2 = pmpkg("pkg2", "1.0-1")
+lp2.reason = 1
+self.addpkg2db("local", lp2)
+
+
+self.args = "-Rs %s" % lp1.name
+
+self.addrule("PACMAN_RETCODE=0")
+self.addrule("!PKG_EXIST=pkg1")
+self.addrule("PKG_EXIST=pkg2")
diff --git a/pactest/tests/remove045.py b/pactest/tests/remove045.py
new file mode 100644
index 00000000..d8b7845b
--- /dev/null
+++ b/pactest/tests/remove045.py
@@ -0,0 +1,30 @@
+self.description = "-Rs advanced test"
+
+lp1 = pmpkg("pkg1")
+lp1.depends = ["pkg2" , "pkg3"]
+self.addpkg2db("local", lp1)
+
+lp2 = pmpkg("pkg2")
+lp2.reason = 1
+lp2.depends = ["pkg4"]
+lp2.requiredby = ["pkg1"]
+self.addpkg2db("local", lp2)
+
+lp3 = pmpkg("pkg3")
+lp3.reason = 1
+lp3.requiredby = ["pkg1", "pkg4"]
+self.addpkg2db("local", lp3)
+
+lp4 = pmpkg("pkg4")
+lp4.reason = 1
+lp4.depends = ["pkg3"]
+lp4.requiredby = ["pkg2"]
+self.addpkg2db("local", lp4)
+
+self.args = "-Rs %s" % lp1.name
+
+self.addrule("PACMAN_RETCODE=0")
+self.addrule("!PKG_EXIST=pkg1")
+self.addrule("!PKG_EXIST=pkg2")
+self.addrule("!PKG_EXIST=pkg3")
+self.addrule("!PKG_EXIST=pkg4")
diff --git a/pactest/tests/remove046.py b/pactest/tests/remove046.py
new file mode 100644
index 00000000..1ee8be17
--- /dev/null
+++ b/pactest/tests/remove046.py
@@ -0,0 +1,10 @@
+self.description = "Cascade remove a package with a broken required by"
+
+lp1 = pmpkg("pkg1")
+lp1.requiredby = [ "fake" ]
+self.addpkg2db("local", lp1)
+
+self.args = "-Rc %s" % lp1.name
+
+self.addrule("PACMAN_RETCODE=0")
+self.addrule("!PKG_EXIST=pkg1")
diff --git a/pactest/tests/remove047.py b/pactest/tests/remove047.py
new file mode 100644
index 00000000..9606c2e3
--- /dev/null
+++ b/pactest/tests/remove047.py
@@ -0,0 +1,25 @@
+self.description = "Remove a package required by other packages"
+
+lp1 = pmpkg("pkg1")
+lp1.requiredby = ["pkg2", "pkg3", "pkg4"]
+self.addpkg2db("local", lp1)
+
+lp2 = pmpkg("pkg2")
+lp2.depends = ["pkg1"]
+self.addpkg2db("local", lp2)
+
+lp3 = pmpkg("pkg3")
+lp3.depends = ["pkg1"]
+self.addpkg2db("local", lp3)
+
+lp4 = pmpkg("pkg4")
+lp4.depends = ["pkg1"]
+self.addpkg2db("local", lp4)
+
+self.args = "-R pkg1 pkg2"
+
+self.addrule("!PACMAN_RETCODE=0")
+self.addrule("PKG_EXIST=pkg1")
+self.addrule("PKG_EXIST=pkg2")
+self.addrule("PKG_EXIST=pkg3")
+self.addrule("PKG_EXIST=pkg4")
diff --git a/pactest/tests/sync011.py b/pactest/tests/sync011.py
new file mode 100644
index 00000000..f5b1943a
--- /dev/null
+++ b/pactest/tests/sync011.py
@@ -0,0 +1,20 @@
+self.description = "Install a package from a sync db with cascaded dependencies + provides"
+
+sp1 = pmpkg("dummy", "1.0-2")
+sp1.depends = ["dep1", "dep2=1.0-2"]
+
+sp2 = pmpkg("dep1")
+sp2.files = ["bin/dep1"]
+sp2.provides = ["dep2"]
+
+sp3 = pmpkg("dep2", "1.0-2")
+
+for p in sp1, sp2, sp3:
+ self.addpkg2db("sync", p);
+
+self.args = "-S %s" % sp1.name
+
+self.addrule("PACMAN_RETCODE=0")
+self.addrule("PKG_VERSION=dummy|1.0-2")
+self.addrule("PKG_EXIST=dep1")
+self.addrule("PKG_EXIST=dep2")
diff --git a/pactest/tests/sync012.py b/pactest/tests/sync012.py
new file mode 100644
index 00000000..3aaba376
--- /dev/null
+++ b/pactest/tests/sync012.py
@@ -0,0 +1,20 @@
+self.description = "Install packages from a sync db with circular dependencies"
+
+sp1 = pmpkg("pkg1")
+sp1.depends = ["pkg2"]
+
+sp2 = pmpkg("pkg2")
+sp2.depends = ["pkg3"]
+
+sp3 = pmpkg("pkg3")
+sp3.depends = ["pkg1"]
+
+for p in sp1, sp2, sp3:
+ self.addpkg2db("sync", p);
+
+self.args = "-S %s" % sp1.name
+
+self.addrule("PACMAN_RETCODE=0")
+self.addrule("PKG_EXIST=pkg1")
+self.addrule("PKG_EXIST=pkg2")
+self.addrule("PKG_EXIST=pkg3")
diff --git a/pactest/tests/sync022.py b/pactest/tests/sync022.py
deleted file mode 100644
index c24a979f..00000000
--- a/pactest/tests/sync022.py
+++ /dev/null
@@ -1,22 +0,0 @@
-self.description = "Installs a group with two conflicting packages, one replacing the other"
-
-sp1 = pmpkg("pkg1")
-sp1.groups = ["grp"]
-self.addpkg2db("sync", sp1);
-
-sp2 = pmpkg("pkg2")
-sp2.groups = ["grp"]
-sp2.provides = ["pkg1"]
-sp2.conflicts = ["pkg1"]
-sp2.replaces = ["pkg1"]
-self.addpkg2db("sync", sp2);
-
-lp1 = pmpkg("pkg2")
-lp1.groups = ["grp"]
-self.addpkg2db("local", lp1);
-
-self.args = "-S %s" % "grp"
-
-self.addrule("PACMAN_RETCODE=0")
-self.addrule("PKG_EXIST=pkg2");
-self.addrule("!PKG_EXIST=pkg1");
diff --git a/pactest/tests/sync030.py b/pactest/tests/sync030.py
new file mode 100644
index 00000000..1fd97500
--- /dev/null
+++ b/pactest/tests/sync030.py
@@ -0,0 +1,19 @@
+self.description = "Sync packages non-explicitly"
+
+lp1 = pmpkg("pkg1")
+lp1.reason = 0
+self.addpkg2db("local", lp1)
+
+p1 = pmpkg("pkg1", "1.0-2")
+p2 = pmpkg("pkg2", "1.0-2")
+
+for p in p1, p2:
+ self.addpkg2db("sync", p)
+
+self.args = "-S --asdeps %s" % " ".join([p.name for p in p1, p2])
+
+self.addrule("PACMAN_RETCODE=0")
+self.addrule("PKG_VERSION=pkg1|1.0-2")
+self.addrule("PKG_VERSION=pkg2|1.0-2")
+self.addrule("PKG_REASON=pkg1|1")
+self.addrule("PKG_REASON=pkg2|1")
diff --git a/pactest/tests/sync1002.py b/pactest/tests/sync1002.py
new file mode 100644
index 00000000..c158838b
--- /dev/null
+++ b/pactest/tests/sync1002.py
@@ -0,0 +1,19 @@
+self.description = "Test -Se (resolve the dependencies' dependencies )"
+
+sp1 = pmpkg("pkg1")
+sp1.depends = [ "pkg2" ]
+self.addpkg2db("sync", sp1)
+
+sp2 = pmpkg("pkg2")
+sp2.depends = [ "pkg3" ]
+self.addpkg2db("sync", sp2)
+
+sp3 = pmpkg("pkg3")
+self.addpkg2db("sync", sp3)
+
+self.args = "-Se pkg1 pkg3"
+
+self.addrule("PACMAN_RETCODE=0")
+self.addrule("PKG_EXIST=pkg2")
+self.addrule("PKG_EXIST=pkg3")
+self.addrule("!PKG_EXIST=pkg1")
diff --git a/pactest/tests/sync1003.py b/pactest/tests/sync1003.py
new file mode 100644
index 00000000..3fd9799d
--- /dev/null
+++ b/pactest/tests/sync1003.py
@@ -0,0 +1,26 @@
+self.description = "Induced removal would break dependency"
+
+sp1 = pmpkg("pkg1", "1.0-2")
+sp1.replaces = [ "pkg2" ]
+self.addpkg2db("sync", sp1)
+
+sp2 = pmpkg("pkg2", "1.0-2")
+self.addpkg2db("sync", sp2)
+
+sp3 = pmpkg("pkg3", "1.0-2")
+sp3.depends = ["pkg2=1.0-2"]
+self.addpkg2db("sync", sp3)
+
+lp1 = pmpkg("pkg1", "1.0-1")
+self.addpkg2db("local", lp1)
+
+lp2 = pmpkg("pkg2", "1.0-2")
+self.addpkg2db("local", lp2)
+
+lp3 = pmpkg("pkg3", "1.0-1")
+self.addpkg2db("local", lp3)
+
+self.args = "-Su"
+
+self.addrule("PACMAN_RETCODE=1")
+self.addrule("PKG_EXIST=pkg2")
diff --git a/pactest/tests/sync400.py b/pactest/tests/sync400.py
new file mode 100644
index 00000000..2ee1095d
--- /dev/null
+++ b/pactest/tests/sync400.py
@@ -0,0 +1,25 @@
+self.description = "Install package with dep that conflicts with older version of package"
+
+sp1 = pmpkg("pkg1", "1.0-2")
+sp1.depends = ["pkg2=1.0-2"]
+self.addpkg2db("sync", sp1)
+
+sp2 = pmpkg("pkg2", "1.0-2")
+sp2.conflicts = [ "pkg1=1.0-1" ]
+self.addpkg2db("sync", sp2)
+
+lp1 = pmpkg("pkg1", "1.0-1")
+lp1.depends = ["pkg2=1.0-1"]
+self.addpkg2db("local", lp1)
+
+lp2 = pmpkg("pkg2", "1.0-1")
+lp2.requiredby = [ "pkg1" ]
+self.addpkg2db("local", lp2)
+
+self.args = "-S pkg1"
+
+self.addrule("PACMAN_RETCODE=0")
+self.addrule("PKG_EXIST=pkg1")
+self.addrule("PKG_VERSION=pkg1|1.0-2")
+self.addrule("PKG_EXIST=pkg2")
+self.addrule("PKG_VERSION=pkg2|1.0-2")
diff --git a/pactest/tests/sync401.py b/pactest/tests/sync401.py
new file mode 100644
index 00000000..eb816377
--- /dev/null
+++ b/pactest/tests/sync401.py
@@ -0,0 +1,21 @@
+self.description = "Ensure we choose provider already in target list"
+
+sp1 = pmpkg("pkg1")
+sp1.depends = ["dep"]
+self.addpkg2db("sync", sp1)
+
+sp2 = pmpkg("pkg2")
+sp2.provides = ["dep"]
+self.addpkg2db("sync", sp2)
+
+sp3 = pmpkg("pkg3")
+sp3.conflicts = ["pkg2"]
+sp3.provides = ["dep"]
+self.addpkg2db("sync", sp3)
+
+self.args = "-S pkg1 pkg2"
+
+self.addrule("PACMAN_RETCODE=0")
+self.addrule("PKG_EXIST=pkg1")
+self.addrule("PKG_EXIST=pkg2")
+self.addrule("!PKG_EXIST=pkg3")
diff --git a/pactest/tests/sync402.py b/pactest/tests/sync402.py
new file mode 100644
index 00000000..6d82f735
--- /dev/null
+++ b/pactest/tests/sync402.py
@@ -0,0 +1,21 @@
+self.description = "Choice between two providers (1)"
+
+sp1 = pmpkg("pkg1")
+sp1.depends = ["dep"]
+self.addpkg2db("sync", sp1)
+
+sp2 = pmpkg("pkg2")
+sp2.provides = ["dep"]
+self.addpkg2db("sync", sp2)
+
+sp3 = pmpkg("pkg3")
+sp3.conflicts = ["pkg1"]
+sp3.provides = ["dep"]
+self.addpkg2db("sync", sp3)
+
+self.args = "-S pkg1"
+
+self.addrule("PACMAN_RETCODE=0")
+self.addrule("PKG_EXIST=pkg1")
+self.addrule("PKG_EXIST=pkg2")
+self.addrule("!PKG_EXIST=pkg3")
diff --git a/pactest/tests/sync403.py b/pactest/tests/sync403.py
new file mode 100644
index 00000000..b8d01016
--- /dev/null
+++ b/pactest/tests/sync403.py
@@ -0,0 +1,21 @@
+self.description = "Choice between two providers (2)"
+
+sp1 = pmpkg("pkg1")
+sp1.depends = ["dep"]
+self.addpkg2db("sync", sp1)
+
+sp2 = pmpkg("pkg2")
+sp2.conflicts = [ "pkg1" ]
+sp2.provides = [ "dep" ]
+self.addpkg2db("sync", sp2)
+
+sp3 = pmpkg("pkg3")
+sp3.provides = [ "dep" ]
+self.addpkg2db("sync", sp3)
+
+self.args = "-S pkg1"
+
+self.addrule("PACMAN_RETCODE=0")
+self.addrule("PKG_EXIST=pkg1")
+self.addrule("!PKG_EXIST=pkg2")
+self.addrule("PKG_EXIST=pkg3")
diff --git a/pactest/tests/upgrade031.py b/pactest/tests/upgrade031.py
new file mode 100644
index 00000000..856de983
--- /dev/null
+++ b/pactest/tests/upgrade031.py
@@ -0,0 +1,19 @@
+self.description = "Install packages non-explicitly"
+
+lp1 = pmpkg("pkg1")
+lp1.reason = 0
+self.addpkg2db("local", lp1)
+
+p1 = pmpkg("pkg1", "1.0-2")
+p2 = pmpkg("pkg2", "1.0-2")
+
+for p in p1, p2:
+ self.addpkg(p)
+
+self.args = "-U --asdeps %s" % " ".join([p.filename() for p in p1, p2])
+
+self.addrule("PACMAN_RETCODE=0")
+self.addrule("PKG_VERSION=pkg1|1.0-2")
+self.addrule("PKG_VERSION=pkg2|1.0-2")
+self.addrule("PKG_REASON=pkg1|1")
+self.addrule("PKG_REASON=pkg2|1")
diff --git a/pactest/tests/upgrade056.py b/pactest/tests/upgrade056.py
index 8419731c..b92c38ac 100644
--- a/pactest/tests/upgrade056.py
+++ b/pactest/tests/upgrade056.py
@@ -11,6 +11,7 @@ self.addpkg2db("local", lp2)
lp3 = pmpkg("pkg3")
lp3.provides = ["imaginary"]
+lp3.requiredby = [ "pkg1" ]
self.addpkg2db("local", lp3)
p = pmpkg("pkg2", "1.0-2")