summaryrefslogtreecommitdiff
path: root/pactest/tests
diff options
context:
space:
mode:
Diffstat (limited to 'pactest/tests')
-rw-r--r--pactest/tests/TESTS61
-rw-r--r--pactest/tests/add001.py13
-rw-r--r--pactest/tests/add002.py18
-rw-r--r--pactest/tests/add003.py23
-rw-r--r--pactest/tests/add004.py12
-rw-r--r--pactest/tests/add010.py15
-rw-r--r--pactest/tests/add011.py14
-rw-r--r--pactest/tests/add012.py20
-rw-r--r--pactest/tests/add013.py23
-rw-r--r--pactest/tests/add020.py15
-rw-r--r--pactest/tests/add021.py16
-rw-r--r--pactest/tests/add030.py18
-rw-r--r--pactest/tests/add031.py18
-rw-r--r--pactest/tests/add032.py18
-rw-r--r--pactest/tests/add040.py14
-rw-r--r--pactest/tests/add041.py15
-rw-r--r--pactest/tests/add042.py29
-rw-r--r--pactest/tests/add050.py16
-rw-r--r--pactest/tests/add060.py15
-rw-r--r--pactest/tests/dummy001.py19
-rw-r--r--pactest/tests/query001.py9
-rw-r--r--pactest/tests/remove010.py12
-rw-r--r--pactest/tests/remove011.py12
-rw-r--r--pactest/tests/remove020.py12
-rw-r--r--pactest/tests/remove021.py12
-rw-r--r--pactest/tests/remove030.py12
-rw-r--r--pactest/tests/smoke001.py19
-rw-r--r--pactest/tests/sync001.py12
-rw-r--r--pactest/tests/sync002.py17
-rw-r--r--pactest/tests/sync003.py12
-rw-r--r--pactest/tests/sync009.py12
-rw-r--r--pactest/tests/sync010.py26
-rw-r--r--pactest/tests/sync020.py19
-rw-r--r--pactest/tests/sync021.py21
-rw-r--r--pactest/tests/sync040.py15
-rw-r--r--pactest/tests/sync041.py16
-rw-r--r--pactest/tests/sync042.py14
-rw-r--r--pactest/tests/sync043.py14
-rw-r--r--pactest/tests/sync050.py10
-rw-r--r--pactest/tests/sync100.py12
-rw-r--r--pactest/tests/sync101.py12
-rw-r--r--pactest/tests/sync102.py12
-rw-r--r--pactest/tests/sync103.py14
-rw-r--r--pactest/tests/sync110.py22
-rw-r--r--pactest/tests/sync120.py21
-rw-r--r--pactest/tests/sync130.py16
-rw-r--r--pactest/tests/sync131.py19
-rw-r--r--pactest/tests/sync132.py18
-rw-r--r--pactest/tests/sync133.py18
-rw-r--r--pactest/tests/sync134.py21
-rw-r--r--pactest/tests/sync135.py31
-rw-r--r--pactest/tests/sync200.py15
-rw-r--r--pactest/tests/sync890.py20
-rw-r--r--pactest/tests/sync891.py22
-rw-r--r--pactest/tests/sync892.py24
-rw-r--r--pactest/tests/sync893.py20
-rw-r--r--pactest/tests/sync897.py26
-rw-r--r--pactest/tests/sync898.py18
-rw-r--r--pactest/tests/sync899.py18
-rw-r--r--pactest/tests/sync990.py20
-rw-r--r--pactest/tests/sync992.py23
-rw-r--r--pactest/tests/sync999.py21
-rw-r--r--pactest/tests/upgrade001.py18
-rw-r--r--pactest/tests/upgrade002.py18
-rw-r--r--pactest/tests/upgrade003.py18
-rw-r--r--pactest/tests/upgrade004.py12
-rw-r--r--pactest/tests/upgrade010.py17
-rw-r--r--pactest/tests/upgrade020.py17
-rw-r--r--pactest/tests/upgrade021.py17
-rw-r--r--pactest/tests/upgrade022.py17
-rw-r--r--pactest/tests/upgrade030.py22
-rw-r--r--pactest/tests/upgrade040.py25
72 files changed, 1292 insertions, 0 deletions
diff --git a/pactest/tests/TESTS b/pactest/tests/TESTS
new file mode 100644
index 00000000..67343750
--- /dev/null
+++ b/pactest/tests/TESTS
@@ -0,0 +1,61 @@
+add001: Install a package
+add002: Install a package (already installed)
+add003: Install a set of packages
+add004: Install a set of the same package at different versions
+add010: Install a package with a filesystem conflict
+add011: Install a package with a filesystem conflict (--force)
+add012: Install two packages with a conflicting file
+add013: Install two packages with a conflicting file (--force)
+add020: Install a package with an existing file
+add021: Install a package with an existing file (new modified)
+add030: Freshen a package
+add031: Freshen a package (installed is newer)
+add032: Freshen a package (installed is newer)
+add040: Install a package with a missing dependency
+add041: Install a package with a missing dependency (nodeps)
+add042: Install a package with cascaded dependencies
+add050: Install a package with a file in NoUpgrade
+add060: Install a package with a file in NoExtract
+query001: Query a package
+remove010: Remove a package, with a file marked for backup
+remove011: Remove a package, with a modified file marked for backup
+remove020: Remove a package, with a file marked for backup (--nosave)
+remove021: Remove a package, with a modified file marked for backup (--nosave)
+smoke001: Install a thousand packages in a single transaction
+sync001: Install a package from a sync db
+sync002: Upgrade a package from a sync db
+sync003: Install a package from a sync db, with a filesystem conflict
+sync010: Install a package from a sync db, with its dependencies
+sync040: Install two targets with a conflict
+sync041: Install two conflicting targets
+sync042: Install a sync package conflicting with a local one
+sync043: Install a sync package conflicting with a local one
+sync050: Install a virtual target (provided by a sync package)
+sync100: Sysupgrade with a newer sync package
+sync101: Sysupgrade with same version for local and sync packages
+sync102: Sysupgrade with a newer local package
+sync103: Sysupgrade with a local package not existing in sync db
+sync110: Sysupgrade of a package pulling new dependencies
+sync120: Sysupgrade of packages in 'IgnorePkg'
+sync130: Sysupgrade with a sync package replacing a local one
+sync131: Sysupgrade with a sync package replacing a set of local ones
+sync132: Sysupgrade with a replacement for a local package out of date
+sync133: Sysupgrade with a sync package replacing a local one in 'IgnorePkg'
+sync134: Sysupgrade with a set of sync packages replacing a set local one
+sync135: Sysupgrade with a set of sync packages replacing a set of local ones
+sync897: System upgrade
+sync898: System upgrade
+sync899: System upgrade
+sync990: Sync a package pulling a dependency conflicting with a target
+sync992: Sync a package pulling a conflicting dependency
+sync999: System upgrade
+upgrade001: Upgrade a package (newer version)
+upgrade002: Upgrade a package (same version)
+upgrade003: Upgrade a package (lesser version)
+upgrade004: Upgrade a package (not installed)
+upgrade010: Upgrade a package, with a file in NoUpgrade
+upgrade020: Upgrade a package, with a file in 'backup' (new modified)
+upgrade021: Upgrade a package, with a file in 'backup' (local modified, new unchanged)
+upgrade022: Upgrade a package, with a file in 'backup' (local and new modified)
+upgrade030: Upgrade packages with various reasons
+upgrade040: file relocation 1
diff --git a/pactest/tests/add001.py b/pactest/tests/add001.py
new file mode 100644
index 00000000..159a54a3
--- /dev/null
+++ b/pactest/tests/add001.py
@@ -0,0 +1,13 @@
+self.description = "Install a package"
+
+p = pmpkg("dummy")
+p.files = ["bin/dummy",
+ "usr/man/man1/dummy.1"]
+self.addpkg(p)
+
+self.args = "-A %s" % p.filename()
+
+self.addrule("PACMAN_RETCODE=0")
+self.addrule("PKG_EXIST=dummy")
+for f in p.files:
+ self.addrule("FILE_EXIST=%s" % f)
diff --git a/pactest/tests/add002.py b/pactest/tests/add002.py
new file mode 100644
index 00000000..2ec90644
--- /dev/null
+++ b/pactest/tests/add002.py
@@ -0,0 +1,18 @@
+self.description = "Install a package (already installed)"
+
+lp = pmpkg("dummy")
+lp.files = ["bin/dummy",
+ "usr/man/man1/dummy.1"]
+self.addpkg2db("local", lp)
+
+p = pmpkg("dummy")
+p.files = ["bin/dummy",
+ "usr/man/man1/dummy.1"]
+self.addpkg(p)
+
+self.args = "-A %s" % p.filename()
+
+self.addrule("PACMAN_RETCODE=1")
+self.addrule("!PKG_MODIFIED=dummy")
+for f in lp.files:
+ self.addrule("!FILE_MODIFIED=%s" % f)
diff --git a/pactest/tests/add003.py b/pactest/tests/add003.py
new file mode 100644
index 00000000..bde87649
--- /dev/null
+++ b/pactest/tests/add003.py
@@ -0,0 +1,23 @@
+self.description = "Install a set of packages"
+
+p1 = pmpkg("pkg1")
+p1.files = ["bin/pkg1",
+ "usr/man/man1/pkg1.1"]
+
+p2 = pmpkg("pkg2", "2.0-1")
+p2.files = ["bin/pkg2",
+ "usr/man/man1/pkg2.1"]
+
+p3 = pmpkg("pkg3", "3.0-1")
+p3.files = ["bin/pkg3", "usr/man/man1/pkg3.1"]
+
+for p in p1, p2, p3:
+ self.addpkg(p)
+
+self.args = "-A %s" % " ".join([p.filename() for p in p1, p2, p3])
+
+self.addrule("PACMAN_RETCODE=0")
+for p in p1, p2, p3:
+ self.addrule("PKG_EXIST=%s" % p.name)
+ for f in p.files:
+ self.addrule("FILE_EXIST=%s" % f)
diff --git a/pactest/tests/add004.py b/pactest/tests/add004.py
new file mode 100644
index 00000000..59ba45c6
--- /dev/null
+++ b/pactest/tests/add004.py
@@ -0,0 +1,12 @@
+self.description = "Install a set of the same package at different versions"
+
+p1 = pmpkg("dummy", "1.0-2")
+p2 = pmpkg("dummy", "2.0-1")
+p3 = pmpkg("dummy")
+for p in p1, p2, p3:
+ self.addpkg(p)
+
+self.args = "-A %s" % " ".join([p.filename() for p in p1, p2, p3])
+
+self.addrule("PACMAN_RETCODE=0")
+self.addrule("PKG_VERSION=dummy|2.0-1")
diff --git a/pactest/tests/add010.py b/pactest/tests/add010.py
new file mode 100644
index 00000000..a7874746
--- /dev/null
+++ b/pactest/tests/add010.py
@@ -0,0 +1,15 @@
+self.description = "Install a package with a filesystem conflict"
+
+p = pmpkg("dummy")
+p.files = ["bin/dummy",
+ "usr/man/man1/dummy.1"]
+self.addpkg(p)
+
+self.filesystem = ["bin/dummy"]
+
+self.args = "-A %s" % p.filename()
+
+self.addrule("PACMAN_RETCODE=1")
+self.addrule("!PKG_EXIST=dummy")
+self.addrule("!FILE_MODIFIED=bin/dummy")
+self.addrule("!FILE_EXIST=usr/man/man1/dummy.1")
diff --git a/pactest/tests/add011.py b/pactest/tests/add011.py
new file mode 100644
index 00000000..5d2ae43f
--- /dev/null
+++ b/pactest/tests/add011.py
@@ -0,0 +1,14 @@
+self.description = "Install a package with a filesystem conflict (--force)"
+
+p = pmpkg("dummy")
+p.files = ["bin/dummy", "usr/man/man1/dummy.1"]
+self.addpkg(p)
+
+self.filesystem = ["bin/dummy"]
+
+self.args = "-Af %s" % p.filename()
+
+self.addrule("PACMAN_RETCODE=0")
+self.addrule("PKG_EXIST=dummy")
+self.addrule("FILE_MODIFIED=bin/dummy")
+self.addrule("FILE_EXIST=usr/man/man1/dummy.1")
diff --git a/pactest/tests/add012.py b/pactest/tests/add012.py
new file mode 100644
index 00000000..291d1fba
--- /dev/null
+++ b/pactest/tests/add012.py
@@ -0,0 +1,20 @@
+self.description = "Install two packages with a conflicting file"
+
+p1 = pmpkg("dummy")
+p1.files = ["bin/dummy",
+ "usr/man/man1/dummy.1",
+ "usr/common"]
+
+p2 = pmpkg("foobar")
+p2.files = ["bin/foobar",
+ "usr/man/man1/foobar.1",
+ "usr/common"]
+
+for p in p1, p2:
+ self.addpkg(p)
+
+self.args = "-A %s" % " ".join([p.filename() for p in p1, p2])
+
+self.addrule("PACMAN_RETCODE=1")
+self.addrule("!PKG_EXIST=dummy")
+self.addrule("!PKG_EXIST=foobar")
diff --git a/pactest/tests/add013.py b/pactest/tests/add013.py
new file mode 100644
index 00000000..547ce001
--- /dev/null
+++ b/pactest/tests/add013.py
@@ -0,0 +1,23 @@
+self.description = "Install two packages with a conflicting file (--force)"
+
+p1 = pmpkg("dummy")
+p1.files = ["bin/dummy",
+ "usr/man/man1/dummy.1",
+ "usr/common"]
+
+p2 = pmpkg("foobar")
+p2.files = ["bin/foobar",
+ "usr/man/man1/foobar.1",
+ "usr/common"]
+
+for p in p1, p2:
+ self.addpkg(p)
+
+self.args = "-Af %s" % " ".join([p.filename() for p in p1, p2])
+
+self.addrule("PACMAN_RETCODE=0")
+for p in p1, p2:
+ self.addrule("PKG_EXIST=%s" % p.name)
+ self.addrule("PKG_FILES=%s|usr/common" % p.name)
+ for f in p.files:
+ self.addrule("FILE_EXIST=%s" % f)
diff --git a/pactest/tests/add020.py b/pactest/tests/add020.py
new file mode 100644
index 00000000..b435ddde
--- /dev/null
+++ b/pactest/tests/add020.py
@@ -0,0 +1,15 @@
+self.description = "Install a package with an existing file"
+
+p = pmpkg("dummy")
+p.files = ["etc/dummy.conf"]
+self.addpkg(p)
+
+self.filesystem = ["etc/dummy.conf"]
+
+self.args = "-Af %s" % p.filename()
+
+self.addrule("PACMAN_RETCODE=0")
+self.addrule("PKG_EXIST=dummy")
+self.addrule("FILE_MODIFIED=etc/dummy.conf")
+self.addrule("!FILE_PACNEW=etc/dummy.conf")
+self.addrule("!FILE_PACORIG=etc/dummy.conf")
diff --git a/pactest/tests/add021.py b/pactest/tests/add021.py
new file mode 100644
index 00000000..ab96d156
--- /dev/null
+++ b/pactest/tests/add021.py
@@ -0,0 +1,16 @@
+self.description = "Install a package with an existing file (new modified)"
+
+p = pmpkg("dummy")
+p.files = ["etc/dummy.conf*"]
+p.backup = ["etc/dummy.conf"]
+self.addpkg(p)
+
+self.filesystem = ["etc/dummy.conf"]
+
+self.args = "-Af %s" % p.filename()
+
+self.addrule("PACMAN_RETCODE=0")
+self.addrule("PKG_EXIST=dummy")
+self.addrule("FILE_MODIFIED=etc/dummy.conf")
+self.addrule("!FILE_PACNEW=etc/dummy.conf")
+self.addrule("FILE_PACORIG=etc/dummy.conf")
diff --git a/pactest/tests/add030.py b/pactest/tests/add030.py
new file mode 100644
index 00000000..d36311c0
--- /dev/null
+++ b/pactest/tests/add030.py
@@ -0,0 +1,18 @@
+self.description = "Freshen a package"
+
+lp = pmpkg("dummy")
+lp.files = ["bin/dummy",
+ "usr/man/man1/dummy.1"]
+self.addpkg2db("local", lp)
+
+p = pmpkg("dummy", "1.0-2")
+p.files = ["bin/dummy",
+ "usr/man/man1/dummy.1"]
+self.addpkg(p)
+
+self.args = "-F %s" % p.filename()
+
+self.addrule("PACMAN_RETCODE=0")
+self.addrule("PKG_VERSION=dummy|1.0-2")
+for f in p.files:
+ self.addrule("FILE_MODIFIED=%s" % f)
diff --git a/pactest/tests/add031.py b/pactest/tests/add031.py
new file mode 100644
index 00000000..38b0485c
--- /dev/null
+++ b/pactest/tests/add031.py
@@ -0,0 +1,18 @@
+self.description = "Freshen a package (installed is newer)"
+
+lp = pmpkg("dummy", "1.0-2")
+lp.files = ["bin/dummy",
+ "usr/man/man1/dummy.1"]
+self.addpkg2db("local", lp)
+
+p = pmpkg("dummy")
+p.files = ["bin/dummy",
+ "usr/man/man1/dummy.1"]
+self.addpkg(p)
+
+self.args = "-F %s" % p.filename()
+
+self.addrule("PACMAN_RETCODE=1")
+self.addrule("!PKG_MODIFIED=dummy")
+for f in p.files:
+ self.addrule("!FILE_MODIFIED=%s" % f)
diff --git a/pactest/tests/add032.py b/pactest/tests/add032.py
new file mode 100644
index 00000000..00d9a6d0
--- /dev/null
+++ b/pactest/tests/add032.py
@@ -0,0 +1,18 @@
+self.description = "Freshen a package (installed is newer)"
+
+lp = pmpkg("dummy")
+lp.files = ["bin/dummy",
+ "usr/man/man1/dummy.1"]
+self.addpkg2db("local", lp)
+
+p = pmpkg("dummy")
+p.files = ["bin/dummy",
+ "usr/man/man1/dummy.1"]
+self.addpkg(p)
+
+self.args = "-F %s" % p.filename()
+
+self.addrule("PACMAN_RETCODE=1")
+self.addrule("!PKG_MODIFIED=dummy")
+for f in p.files:
+ self.addrule("!FILE_MODIFIED=%s" % f)
diff --git a/pactest/tests/add040.py b/pactest/tests/add040.py
new file mode 100644
index 00000000..2bb7f91b
--- /dev/null
+++ b/pactest/tests/add040.py
@@ -0,0 +1,14 @@
+self.description = "Install a package with a missing dependency"
+
+p = pmpkg("dummy")
+p.files = ["bin/dummy",
+ "usr/man/man1/dummy.1"]
+p.depends = ["missdep"]
+self.addpkg(p)
+
+self.args = "-A %s" % p.filename()
+
+self.addrule("PACMAN_RETCODE=1")
+self.addrule("!PKG_EXIST=dummy")
+for f in p.files:
+ self.addrule("!FILE_EXIST=%s" % f)
diff --git a/pactest/tests/add041.py b/pactest/tests/add041.py
new file mode 100644
index 00000000..af3ffe46
--- /dev/null
+++ b/pactest/tests/add041.py
@@ -0,0 +1,15 @@
+self.description = "Install a package with a missing dependency (nodeps)"
+
+p = pmpkg("dummy")
+p.files = ["bin/dummy",
+ "usr/man/man1/dummy.1"]
+p.depends = ["dep1"]
+self.addpkg(p)
+
+self.args = "-Ad %s" % p.filename()
+
+self.addrule("PACMAN_RETCODE=0")
+self.addrule("PKG_EXIST=dummy")
+self.addrule("PKG_DEPENDS=dummy|dep1")
+for f in p.files:
+ self.addrule("FILE_EXIST=%s" % f)
diff --git a/pactest/tests/add042.py b/pactest/tests/add042.py
new file mode 100644
index 00000000..a9b17c0f
--- /dev/null
+++ b/pactest/tests/add042.py
@@ -0,0 +1,29 @@
+self.description = "Install a package with cascaded dependencies"
+
+p1 = pmpkg("dummy", "1.0-2")
+p1.files = ["bin/dummy",
+ "usr/man/man1/dummy.1"]
+p1.depends = ["dep1"]
+
+p2 = pmpkg("dep1")
+p2.files = ["bin/dep1"]
+p2.depends = ["dep2"]
+
+p3 = pmpkg("dep2")
+p3.files = ["bin/dep2"]
+
+for p in p1, p2, p3:
+ self.addpkg(p)
+
+self.args = "-A %s" % " ".join([p.filename() for p in p1, p2, p3])
+
+self.addrule("PACMAN_RETCODE=0")
+self.addrule("PKG_VERSION=dummy|1.0-2")
+for f in p1.files:
+ self.addrule("FILE_EXIST=%s" % f)
+self.addrule("PKG_EXIST=dep1")
+self.addrule("PKG_EXIST=dep2")
+self.addrule("PKG_DEPENDS=dummy|dep1")
+self.addrule("PKG_DEPENDS=dep1|dep2")
+self.addrule("PKG_REQUIREDBY=dep1|dummy")
+self.addrule("PKG_REQUIREDBY=dep2|dep1")
diff --git a/pactest/tests/add050.py b/pactest/tests/add050.py
new file mode 100644
index 00000000..f9b3b251
--- /dev/null
+++ b/pactest/tests/add050.py
@@ -0,0 +1,16 @@
+self.description = "Install a package with a file in NoUpgrade"
+
+p = pmpkg("dummy")
+p.files = ["etc/dummy.conf"]
+self.addpkg(p)
+
+self.filesystem = ["etc/dummy.conf"]
+
+self.option["noupgrade"] = ["etc/dummy.conf"]
+
+self.args = "-Af %s" % p.filename()
+
+self.addrule("PACMAN_RETCODE=0")
+self.addrule("PKG_EXIST=dummy")
+self.addrule("!FILE_MODIFIED=etc/dummy.conf")
+self.addrule("FILE_PACNEW=etc/dummy.conf")
diff --git a/pactest/tests/add060.py b/pactest/tests/add060.py
new file mode 100644
index 00000000..4c5f17da
--- /dev/null
+++ b/pactest/tests/add060.py
@@ -0,0 +1,15 @@
+self.description = "Install a package with a file in NoExtract"
+
+p = pmpkg("dummy")
+p.files = ["bin/dummy",
+ "usr/man/man1/dummy.1"]
+self.addpkg(p)
+
+self.option["noextract"] = ["usr/man/man1/dummy.1"]
+
+self.args = "-A %s" % p.filename()
+
+self.addrule("PACMAN_RETCODE=0")
+self.addrule("PKG_EXIST=dummy")
+self.addrule("FILE_EXIST=bin/dummy")
+self.addrule("!FILE_EXIST=usr/man/man1/dummy.1")
diff --git a/pactest/tests/dummy001.py b/pactest/tests/dummy001.py
new file mode 100644
index 00000000..79e2bd00
--- /dev/null
+++ b/pactest/tests/dummy001.py
@@ -0,0 +1,19 @@
+self.description = "dummy test case"
+
+p1 = pmpkg("dummy")
+p1.files = ["etc/dummy.conf*",
+ "lib/libdummy.so.0",
+ "lib/libdummy.so -> ./libdummy.so.0",
+ "usr/",
+ "bin/dummy"]
+p1.backup = ["etc/dummy.conf*"]
+p1.install['post_install'] = "echo toto";
+p1.url="ze url"
+self.addpkg(p1)
+
+#p2 = pmpkg("dummy", "1.0-2")
+#p2.files = ["etc/dummy.conf**"]
+#p2.backup = ["etc/dummy.conf"]
+#self.addpkg(p2)
+
+self.args = "-U %s" % p1.filename()
diff --git a/pactest/tests/query001.py b/pactest/tests/query001.py
new file mode 100644
index 00000000..fe689104
--- /dev/null
+++ b/pactest/tests/query001.py
@@ -0,0 +1,9 @@
+self.description = "Query a package"
+
+p = pmpkg("foobar")
+p.files = ["bin/foobar"]
+self.addpkg2db("local", p)
+
+self.args = "-Q foobar"
+
+self.addrule("PACMAN_OUTPUT=foobar")
diff --git a/pactest/tests/remove010.py b/pactest/tests/remove010.py
new file mode 100644
index 00000000..aff46f0e
--- /dev/null
+++ b/pactest/tests/remove010.py
@@ -0,0 +1,12 @@
+self.description = "Remove a package, with a file marked for backup"
+
+p1 = pmpkg("dummy")
+p1.files = ["etc/dummy.conf"]
+p1.backup = ["etc/dummy.conf"]
+self.addpkg2db("local", p1)
+
+self.args = "-R dummy"
+
+self.addrule("!PKG_EXIST=dummy")
+self.addrule("!FILE_EXIST=etc/dummy.conf")
+self.addrule("FILE_PACSAVE=etc/dummy.conf")
diff --git a/pactest/tests/remove011.py b/pactest/tests/remove011.py
new file mode 100644
index 00000000..afc03d45
--- /dev/null
+++ b/pactest/tests/remove011.py
@@ -0,0 +1,12 @@
+self.description = "Remove a package, with a modified file marked for backup"
+
+p1 = pmpkg("dummy")
+p1.files = ["etc/dummy.conf*"]
+p1.backup = ["etc/dummy.conf"]
+self.addpkg2db("local", p1)
+
+self.args = "-R dummy"
+
+self.addrule("!PKG_EXIST=dummy")
+self.addrule("!FILE_EXIST=etc/dummy.conf")
+self.addrule("FILE_PACSAVE=etc/dummy.conf")
diff --git a/pactest/tests/remove020.py b/pactest/tests/remove020.py
new file mode 100644
index 00000000..293ad1bd
--- /dev/null
+++ b/pactest/tests/remove020.py
@@ -0,0 +1,12 @@
+self.description = "Remove a package, with a file marked for backup (--nosave)"
+
+p1 = pmpkg("dummy")
+p1.files = ["etc/dummy.conf"]
+p1.backup = ["etc/dummy.conf"]
+self.addpkg2db("local", p1)
+
+self.args = "-Rn dummy"
+
+self.addrule("!PKG_EXIST=dummy")
+self.addrule("!FILE_EXIST=etc/dummy.conf")
+self.addrule("!FILE_PACSAVE=etc/dummy.conf")
diff --git a/pactest/tests/remove021.py b/pactest/tests/remove021.py
new file mode 100644
index 00000000..388bf018
--- /dev/null
+++ b/pactest/tests/remove021.py
@@ -0,0 +1,12 @@
+self.description = "Remove a package, with a modified file marked for backup (--nosave)"
+
+p1 = pmpkg("dummy")
+p1.files = ["etc/dummy.conf*"]
+p1.backup = ["etc/dummy.conf"]
+self.addpkg2db("local", p1)
+
+self.args = "-Rn dummy"
+
+self.addrule("!PKG_EXIST=dummy")
+self.addrule("!FILE_EXIST=etc/dummy.conf")
+self.addrule("!FILE_PACSAVE=etc/dummy.conf")
diff --git a/pactest/tests/remove030.py b/pactest/tests/remove030.py
new file mode 100644
index 00000000..ff81a263
--- /dev/null
+++ b/pactest/tests/remove030.py
@@ -0,0 +1,12 @@
+self.description = "Remove a package in HoldPkg"
+
+p1 = pmpkg("dummy")
+self.addpkg2db("local", p1)
+
+self.option["holdpkg"] = ["dummy"]
+
+self.args = "-R dummy"
+
+self.addrule("!PKG_EXIST=dummy")
+self.addrule("!FILE_EXIST=etc/dummy.conf")
+self.addrule("!FILE_PACSAVE=etc/dummy.conf")
diff --git a/pactest/tests/smoke001.py b/pactest/tests/smoke001.py
new file mode 100644
index 00000000..85ee782b
--- /dev/null
+++ b/pactest/tests/smoke001.py
@@ -0,0 +1,19 @@
+self.description = "Install a thousand packages in a single transaction"
+
+p = pmpkg("pkg1000")
+
+self.addpkg2db("local", p)
+
+for i in range(1000):
+ p = pmpkg("pkg%03d" % i)
+ p.depends = ["pkg%03d" % (i+1)]
+ p.files = ["usr/share/pkg%03d" % i]
+ self.addpkg(p)
+
+_list = []
+[_list.append(p.filename()) for p in self.localpkgs]
+self.args = "-A %s" % " ".join(_list)
+
+self.addrule("PACMAN_RETCODE=0")
+#for i in range(1000):
+# self.addrule("PKG_EXIST=pkg%03d" %i)
diff --git a/pactest/tests/sync001.py b/pactest/tests/sync001.py
new file mode 100644
index 00000000..fc2015d4
--- /dev/null
+++ b/pactest/tests/sync001.py
@@ -0,0 +1,12 @@
+self.description = "Install a package from a sync db"
+
+sp = pmpkg("dummy")
+sp.files = ["bin/dummy",
+ "usr/man/man1/dummy.1"]
+self.addpkg2db("sync", sp)
+
+self.args = "-S dummy"
+
+self.addrule("PKG_EXIST=dummy")
+for f in sp.files:
+ self.addrule("FILE_EXIST=%s" % f)
diff --git a/pactest/tests/sync002.py b/pactest/tests/sync002.py
new file mode 100644
index 00000000..43c99fbd
--- /dev/null
+++ b/pactest/tests/sync002.py
@@ -0,0 +1,17 @@
+self.description = "Upgrade a package from a sync db"
+
+sp = pmpkg("dummy", "1.0-2")
+sp.files = ["bin/dummy",
+ "usr/man/man1/dummy.1"]
+self.addpkg2db("sync", sp)
+
+lp = pmpkg("dummy")
+lp.files = ["bin/dummy",
+ "usr/man/man1/dummy.1"]
+self.addpkg2db("local", lp)
+
+self.args = "-S dummy"
+
+self.addrule("PKG_VERSION=dummy|1.0-2")
+for f in lp.files:
+ self.addrule("FILE_MODIFIED=%s" % f)
diff --git a/pactest/tests/sync003.py b/pactest/tests/sync003.py
new file mode 100644
index 00000000..3a480adf
--- /dev/null
+++ b/pactest/tests/sync003.py
@@ -0,0 +1,12 @@
+self.description = "Install a package from a sync db, with a filesystem conflict"
+
+sp = pmpkg("dummy")
+sp.files = ["bin/dummy",
+ "usr/man/man1/dummy.1"]
+self.addpkg2db("sync", sp)
+
+self.filesystem = ["bin/dummy"]
+
+self.args = "-S dummy"
+
+self.addrule("!PKG_EXIST=dummy")
diff --git a/pactest/tests/sync009.py b/pactest/tests/sync009.py
new file mode 100644
index 00000000..fc2015d4
--- /dev/null
+++ b/pactest/tests/sync009.py
@@ -0,0 +1,12 @@
+self.description = "Install a package from a sync db"
+
+sp = pmpkg("dummy")
+sp.files = ["bin/dummy",
+ "usr/man/man1/dummy.1"]
+self.addpkg2db("sync", sp)
+
+self.args = "-S dummy"
+
+self.addrule("PKG_EXIST=dummy")
+for f in sp.files:
+ self.addrule("FILE_EXIST=%s" % f)
diff --git a/pactest/tests/sync010.py b/pactest/tests/sync010.py
new file mode 100644
index 00000000..9e54eb62
--- /dev/null
+++ b/pactest/tests/sync010.py
@@ -0,0 +1,26 @@
+self.description = "Install a package from a sync db, with its dependencies"
+
+sp1 = pmpkg("dummy", "1.0-2")
+sp1.files = ["bin/dummy",
+ "usr/man/man1/dummy.1"]
+sp1.depends = ["dep1"]
+
+sp2 = pmpkg("dep1")
+sp2.files = ["bin/dep1"]
+sp2.depends = ["dep2"]
+
+sp3 = pmpkg("dep2")
+sp3.files = ["bin/dep2"]
+
+for p in sp1, sp2, sp3:
+ self.addpkg2db("sync", p);
+
+self.args = "-S dummy"
+
+self.addrule("PKG_VERSION=dummy|1.0-2")
+self.addrule("PKG_DEPENDS=dummy|dep1")
+for f in sp1.files:
+ self.addrule("FILE_EXIST=%s" % f)
+self.addrule("PKG_DEPENDS=dep1|dep2")
+self.addrule("PKG_REQUIREDBY=dep1|dummy")
+self.addrule("PKG_REQUIREDBY=dep2|dep1")
diff --git a/pactest/tests/sync020.py b/pactest/tests/sync020.py
new file mode 100644
index 00000000..eae699fe
--- /dev/null
+++ b/pactest/tests/sync020.py
@@ -0,0 +1,19 @@
+self.description = "Install a group from a sync db"
+
+sp1 = pmpkg("pkg1")
+sp1.groups = ["grp"]
+
+sp2 = pmpkg("pkg2")
+sp2.groups = ["grp"]
+
+sp3 = pmpkg("pkg3")
+sp3.groups = ["grp"]
+
+for p in sp1, sp2, sp3:
+ self.addpkg2db("sync", p);
+
+self.args = "-S grp"
+
+self.addrule("PACMAN_RETCODE=0")
+for p in sp1, sp2, sp3:
+ self.addrule("PKG_EXIST=%s" % p.name)
diff --git a/pactest/tests/sync021.py b/pactest/tests/sync021.py
new file mode 100644
index 00000000..d8a5475b
--- /dev/null
+++ b/pactest/tests/sync021.py
@@ -0,0 +1,21 @@
+self.description = "Install a group from a sync db, with a package in IgnorePkg"
+
+sp1 = pmpkg("pkg1")
+sp1.groups = ["grp"]
+
+sp2 = pmpkg("pkg2")
+sp2.groups = ["grp"]
+
+sp3 = pmpkg("pkg3")
+sp3.groups = ["grp"]
+
+for p in sp1, sp2, sp3:
+ self.addpkg2db("sync", p);
+
+self.option["ignorepkg"] = ["pkg2"]
+
+self.args = "-S grp"
+
+self.addrule("PACMAN_RETCODE=0")
+for p in sp1, sp2, sp3:
+ self.addrule("PKG_EXIST=%s" % p.name)
diff --git a/pactest/tests/sync040.py b/pactest/tests/sync040.py
new file mode 100644
index 00000000..73f6ee63
--- /dev/null
+++ b/pactest/tests/sync040.py
@@ -0,0 +1,15 @@
+self.description = "Install two targets with a conflict"
+
+sp1 = pmpkg("pkg1")
+sp1.conflicts = ["pkg2"]
+
+sp2 = pmpkg("pkg2")
+
+for p in sp1, sp2:
+ self.addpkg2db("sync", p);
+
+self.args = "-S pkg1 pkg2"
+
+self.addrule("PACMAN_RETCODE=1")
+for p in sp1, sp2:
+ self.addrule("!PKG_EXIST=%s" % p.name)
diff --git a/pactest/tests/sync041.py b/pactest/tests/sync041.py
new file mode 100644
index 00000000..a612e71f
--- /dev/null
+++ b/pactest/tests/sync041.py
@@ -0,0 +1,16 @@
+self.description = "Install two conflicting targets"
+
+sp1 = pmpkg("pkg1")
+sp1.conflicts = ["pkg2"]
+
+sp2 = pmpkg("pkg2")
+sp2.conflicts = ["pkg1"]
+
+for p in sp1, sp2:
+ self.addpkg2db("sync", p);
+
+self.args = "-S pkg1 pkg2"
+
+self.addrule("PACMAN_RETCODE=1")
+self.addrule("!PKG_EXIST=pkg1")
+self.addrule("!PKG_EXIST=pkg2")
diff --git a/pactest/tests/sync042.py b/pactest/tests/sync042.py
new file mode 100644
index 00000000..200626d3
--- /dev/null
+++ b/pactest/tests/sync042.py
@@ -0,0 +1,14 @@
+self.description = "Install a sync package conflicting with a local one"
+
+sp = pmpkg("pkg1")
+sp.conflicts = ["pkg2"]
+self.addpkg2db("sync", sp);
+
+lp = pmpkg("pkg2")
+self.addpkg2db("local", lp);
+
+self.args = "-S pkg1"
+
+self.addrule("PACMAN_RETCODE=0")
+self.addrule("PKG_EXIST=pkg1")
+self.addrule("!PKG_EXIST=pkg2")
diff --git a/pactest/tests/sync043.py b/pactest/tests/sync043.py
new file mode 100644
index 00000000..200626d3
--- /dev/null
+++ b/pactest/tests/sync043.py
@@ -0,0 +1,14 @@
+self.description = "Install a sync package conflicting with a local one"
+
+sp = pmpkg("pkg1")
+sp.conflicts = ["pkg2"]
+self.addpkg2db("sync", sp);
+
+lp = pmpkg("pkg2")
+self.addpkg2db("local", lp);
+
+self.args = "-S pkg1"
+
+self.addrule("PACMAN_RETCODE=0")
+self.addrule("PKG_EXIST=pkg1")
+self.addrule("!PKG_EXIST=pkg2")
diff --git a/pactest/tests/sync050.py b/pactest/tests/sync050.py
new file mode 100644
index 00000000..6c7619be
--- /dev/null
+++ b/pactest/tests/sync050.py
@@ -0,0 +1,10 @@
+self.description = "Install a virtual target (provided by a sync package)"
+
+sp1 = pmpkg("pkg1")
+sp1.provides = ["pkg2"]
+self.addpkg2db("sync", sp1);
+
+self.args = "-S pkg2"
+
+self.addrule("PACMAN_RETCODE=0")
+self.addrule("PKG_EXIST=pkg1")
diff --git a/pactest/tests/sync100.py b/pactest/tests/sync100.py
new file mode 100644
index 00000000..a4997fb1
--- /dev/null
+++ b/pactest/tests/sync100.py
@@ -0,0 +1,12 @@
+self.description = "Sysupgrade with a newer sync package"
+
+sp = pmpkg("dummy", "1.0-2")
+lp = pmpkg("dummy")
+
+self.addpkg2db("sync", sp)
+self.addpkg2db("local", lp)
+
+self.args = "-Su"
+
+self.addrule("PACMAN_RETCODE=0")
+self.addrule("PKG_VERSION=dummy|1.0-2")
diff --git a/pactest/tests/sync101.py b/pactest/tests/sync101.py
new file mode 100644
index 00000000..5d39ecb9
--- /dev/null
+++ b/pactest/tests/sync101.py
@@ -0,0 +1,12 @@
+self.description = "Sysupgrade with same version for local and sync packages"
+
+sp = pmpkg("dummy")
+lp = pmpkg("dummy")
+
+self.addpkg2db("sync", sp)
+self.addpkg2db("local", lp)
+
+self.args = "-Su"
+
+self.addrule("PACMAN_RETCODE=0")
+self.addrule("!PKG_MODIFIED=dummy")
diff --git a/pactest/tests/sync102.py b/pactest/tests/sync102.py
new file mode 100644
index 00000000..40a7ec99
--- /dev/null
+++ b/pactest/tests/sync102.py
@@ -0,0 +1,12 @@
+self.description = "Sysupgrade with a newer local package"
+
+sp = pmpkg("dummy", "0.9-1")
+lp = pmpkg("dummy")
+
+self.addpkg2db("sync", sp)
+self.addpkg2db("local", lp)
+
+self.args = "-Su"
+
+self.addrule("PACMAN_RETCODE=0")
+self.addrule("!PKG_MODIFIED=dummy")
diff --git a/pactest/tests/sync103.py b/pactest/tests/sync103.py
new file mode 100644
index 00000000..5d17790b
--- /dev/null
+++ b/pactest/tests/sync103.py
@@ -0,0 +1,14 @@
+self.description = "Sysupgrade with a local package not existing in sync db"
+
+sp = pmpkg("spkg")
+
+self.addpkg2db("sync", sp)
+
+lp = pmpkg("lpkg")
+
+self.addpkg2db("local", lp)
+
+self.args = "-Su"
+
+self.addrule("PACMAN_RETCODE=0")
+self.addrule("!PKG_MODIFIED=lpkg")
diff --git a/pactest/tests/sync110.py b/pactest/tests/sync110.py
new file mode 100644
index 00000000..08a1a890
--- /dev/null
+++ b/pactest/tests/sync110.py
@@ -0,0 +1,22 @@
+self.description = "Sysupgrade of a package pulling new dependencies"
+
+sp1 = pmpkg("pkg1", "1.0-2")
+sp1.depends = ["pkg2"]
+
+sp2 = pmpkg("pkg2")
+sp2.depends = ["pkg3"]
+
+sp3 = pmpkg("pkg3")
+
+for p in sp1, sp2, sp3:
+ self.addpkg2db("sync", p)
+
+lp1 = pmpkg("pkg1")
+self.addpkg2db("local", lp1)
+
+self.args = "-Su"
+
+self.addrule("PACMAN_RETCODE=0")
+self.addrule("PKG_VERSION=pkg1|1.0-2")
+for p in sp2, sp3:
+ self.addrule("PKG_REASON=%s|1" % p.name)
diff --git a/pactest/tests/sync120.py b/pactest/tests/sync120.py
new file mode 100644
index 00000000..b8fc6747
--- /dev/null
+++ b/pactest/tests/sync120.py
@@ -0,0 +1,21 @@
+self.description = "Sysupgrade of packages in 'IgnorePkg'"
+
+sp1 = pmpkg("pkg1", "1.0-2")
+sp2 = pmpkg("pkg2", "1.0-2")
+
+for p in sp1, sp2:
+ self.addpkg2db("sync", p)
+
+lp1 = pmpkg("pkg1")
+lp2 = pmpkg("pkg2")
+
+for p in lp1, lp2:
+ self.addpkg2db("local", p)
+
+self.option["ignorepkg"] = ["pkg2"]
+
+self.args = "-Su"
+
+self.addrule("PACMAN_RETCODE=0")
+self.addrule("PKG_VERSION=pkg1|1.0-2")
+self.addrule("!PKG_MODIFIED=pkg2")
diff --git a/pactest/tests/sync130.py b/pactest/tests/sync130.py
new file mode 100644
index 00000000..afd196d1
--- /dev/null
+++ b/pactest/tests/sync130.py
@@ -0,0 +1,16 @@
+self.description = "Sysupgrade with a sync package replacing a local one"
+
+sp = pmpkg("pkg2")
+sp.replaces = ["pkg1"]
+
+self.addpkg2db("sync", sp)
+
+lp = pmpkg("pkg1")
+
+self.addpkg2db("local", lp)
+
+self.args = "-Su"
+
+self.addrule("PACMAN_RETCODE=0")
+self.addrule("!PKG_EXIST=pkg1")
+self.addrule("PKG_EXIST=pkg2")
diff --git a/pactest/tests/sync131.py b/pactest/tests/sync131.py
new file mode 100644
index 00000000..d0ed1a9f
--- /dev/null
+++ b/pactest/tests/sync131.py
@@ -0,0 +1,19 @@
+self.description = "Sysupgrade with a sync package replacing a set of local ones"
+
+sp = pmpkg("pkg4")
+sp.replaces = ["pkg1", "pkg2", "pkg3"]
+
+self.addpkg2db("sync", sp)
+
+lp1 = pmpkg("pkg1")
+lp2 = pmpkg("pkg2")
+
+for p in lp1, lp2:
+ self.addpkg2db("local", p)
+
+self.args = "-Su"
+
+self.addrule("PACMAN_RETCODE=0")
+self.addrule("PKG_EXIST=pkg4")
+for p in lp1, lp2:
+ self.addrule("!PKG_EXIST=%s" % p.name)
diff --git a/pactest/tests/sync132.py b/pactest/tests/sync132.py
new file mode 100644
index 00000000..5e85727d
--- /dev/null
+++ b/pactest/tests/sync132.py
@@ -0,0 +1,18 @@
+self.description = "Sysupgrade with a replacement for a local package out of date"
+
+sp1 = pmpkg("pkg1")
+sp1.replaces = ["pkg2"]
+sp2 = pmpkg("pkg2", "2.0-1")
+
+for p in sp1, sp2:
+ self.addpkg2db("sync", p)
+
+lp = pmpkg("pkg2")
+
+self.addpkg2db("local", lp)
+
+self.args = "-Su"
+
+self.addrule("PACMAN_RETCODE=0")
+self.addrule("PKG_EXIST=pkg1")
+self.addrule("!PKG_EXIST=pkg2")
diff --git a/pactest/tests/sync133.py b/pactest/tests/sync133.py
new file mode 100644
index 00000000..b852a7fc
--- /dev/null
+++ b/pactest/tests/sync133.py
@@ -0,0 +1,18 @@
+self.description = "Sysupgrade with a sync package replacing a local one in 'IgnorePkg'"
+
+sp = pmpkg("pkg2")
+sp.replaces = ["pkg1"]
+
+self.addpkg2db("sync", sp)
+
+lp = pmpkg("pkg1")
+
+self.addpkg2db("local", lp)
+
+self.option["ignorepkg"] = ["pkg1"]
+
+self.args = "-Su"
+
+self.addrule("PACMAN_RETCODE=0")
+self.addrule("PKG_EXIST=pkg1")
+self.addrule("!PKG_EXIST=pkg2")
diff --git a/pactest/tests/sync134.py b/pactest/tests/sync134.py
new file mode 100644
index 00000000..572ab326
--- /dev/null
+++ b/pactest/tests/sync134.py
@@ -0,0 +1,21 @@
+self.description = "Sysupgrade with a set of sync packages replacing a set local one"
+
+sp1 = pmpkg("pkg2")
+sp1.replaces = ["pkg1"]
+
+sp2 = pmpkg("pkg3")
+sp2.replaces = ["pkg1"]
+
+for p in sp1, sp2:
+ self.addpkg2db("sync", p)
+
+lp = pmpkg("pkg1")
+
+self.addpkg2db("local", lp)
+
+self.args = "-Su"
+
+self.addrule("PACMAN_RETCODE=0")
+self.addrule("!PKG_EXIST=pkg1")
+for p in sp1, sp2:
+ self.addrule("PKG_EXIST=%s" % p.name)
diff --git a/pactest/tests/sync135.py b/pactest/tests/sync135.py
new file mode 100644
index 00000000..18c412aa
--- /dev/null
+++ b/pactest/tests/sync135.py
@@ -0,0 +1,31 @@
+self.description = "Sysupgrade with a set of sync packages replacing a set of local ones"
+
+sp1 = pmpkg("pkg2")
+sp1.replaces = ["pkg1"]
+
+sp2 = pmpkg("pkg3")
+sp2.replaces = ["pkg1"]
+
+sp3 = pmpkg("pkg4")
+sp3.replaces = ["pkg1", "pkg0"]
+
+sp4 = pmpkg("pkg5")
+sp4.replaces = ["pkg0"]
+
+for p in sp1, sp2, sp3, sp4:
+ self.addpkg2db("sync", p)
+
+lp1 = pmpkg("pkg1")
+
+lp2 = pmpkg("pkg0")
+
+for p in lp1, lp2:
+ self.addpkg2db("local", p)
+
+self.args = "-Su"
+
+self.addrule("PACMAN_RETCODE=0")
+for p in lp1, lp2:
+ self.addrule("!PKG_EXIST=%s" % p.name)
+for p in sp1, sp2, sp3, sp4:
+ self.addrule("PKG_EXIST=%s" % p.name)
diff --git a/pactest/tests/sync200.py b/pactest/tests/sync200.py
new file mode 100644
index 00000000..82f30da1
--- /dev/null
+++ b/pactest/tests/sync200.py
@@ -0,0 +1,15 @@
+self.description = "Synchronize database"
+
+sp1 = pmpkg("spkg1", "1.0-1")
+sp1.depends = ["spkg2"]
+sp2 = pmpkg("spkg2", "2.0-1")
+sp2.depends = ["spkg3"]
+sp3 = pmpkg("spkg3", "3.0-1")
+sp3.depends = ["spkg1"]
+
+for sp in sp1, sp2, sp3:
+ self.addpkg2db("sync", sp)
+
+self.args = "-Sy"
+
+self.addrule("PACMAN_RETCODE=0")
diff --git a/pactest/tests/sync890.py b/pactest/tests/sync890.py
new file mode 100644
index 00000000..0613128e
--- /dev/null
+++ b/pactest/tests/sync890.py
@@ -0,0 +1,20 @@
+self.description = "conflict 'db vs targ'"
+
+sp = pmpkg("pkg3")
+
+self.addpkg2db("sync", sp)
+
+lp1 = pmpkg("pkg1")
+
+lp2 = pmpkg("pkg2")
+lp2.conflicts = ["pkg3"]
+
+for p in lp1, lp2:
+ self.addpkg2db("local", p)
+
+self.args = "-S pkg3"
+
+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/sync891.py b/pactest/tests/sync891.py
new file mode 100644
index 00000000..7810ac93
--- /dev/null
+++ b/pactest/tests/sync891.py
@@ -0,0 +1,22 @@
+self.description = "conflict 'db vs targ'"
+
+sp1 = pmpkg("pkg2")
+sp2 = pmpkg("pkg3")
+
+for p in sp1, sp2:
+ self.addpkg2db("sync", p)
+
+lp1 = pmpkg("pkg1")
+
+lp2 = pmpkg("pkg2")
+lp2.conflicts = ["pkg3"]
+
+for p in lp1, lp2:
+ self.addpkg2db("local", p)
+
+self.args = "-S pkg2 pkg3"
+
+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/sync892.py b/pactest/tests/sync892.py
new file mode 100644
index 00000000..9d37d682
--- /dev/null
+++ b/pactest/tests/sync892.py
@@ -0,0 +1,24 @@
+self.description = "conflict 'targ vs targ' and 'db vs targ'"
+
+sp1 = pmpkg("pkg2")
+sp1.conflicts = ["pkg1"]
+
+sp2 = pmpkg("pkg3")
+
+for p in sp1, sp2:
+ self.addpkg2db("sync", p)
+
+lp1 = pmpkg("pkg1")
+
+lp2 = pmpkg("pkg2")
+lp2.conflicts = ["pkg3"]
+
+for p in lp1, lp2:
+ self.addpkg2db("local", p)
+
+self.args = "-S pkg2 pkg3"
+
+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/sync893.py b/pactest/tests/sync893.py
new file mode 100644
index 00000000..7ab55383
--- /dev/null
+++ b/pactest/tests/sync893.py
@@ -0,0 +1,20 @@
+self.description = "conflict (bug)"
+
+sp1 = pmpkg("pkg1", "1.0-2")
+sp1.conflicts = ["pkg2"]
+self.addpkg2db("sync", sp1);
+
+sp2 = pmpkg("pkg2", "1.0-2")
+self.addpkg2db("sync", sp2)
+
+lp1 = pmpkg("pkg1")
+self.addpkg2db("local", lp1)
+
+lp2 = pmpkg("pkg2")
+self.addpkg2db("local", lp2)
+
+self.args = "-S pkg1 pkg2"
+
+self.addrule("PACMAN_RETCODE=0")
+self.addrule("PKG_EXIST=pkg1")
+self.addrule("!PKG_EXIST=pkg2")
diff --git a/pactest/tests/sync897.py b/pactest/tests/sync897.py
new file mode 100644
index 00000000..adaaa1c2
--- /dev/null
+++ b/pactest/tests/sync897.py
@@ -0,0 +1,26 @@
+self.description = "System upgrade"
+
+sp1 = pmpkg("pkg1", "1.0-2")
+sp1.conflicts = ["pkg2"]
+sp1.provides = ["pkg2"]
+self.addpkg2db("sync", sp1);
+
+sp2 = pmpkg("pkg2", "1.0-2")
+self.addpkg2db("sync", sp2)
+
+lp1 = pmpkg("pkg1")
+lp1.conflicts = ["pkg2"]
+self.addpkg2db("local", lp1)
+
+lp2 = pmpkg("pkg2")
+self.addpkg2db("local", lp2)
+
+lp3 = pmpkg("pkg3")
+lp3.conflicts = ["pkg1"]
+self.addpkg2db("local", lp3)
+
+self.args = "-Su"
+
+self.addrule("PACMAN_RETCODE=0")
+self.addrule("PKG_EXIST=pkg1")
+self.addrule("!PKG_EXIST=pkg2")
diff --git a/pactest/tests/sync898.py b/pactest/tests/sync898.py
new file mode 100644
index 00000000..06583217
--- /dev/null
+++ b/pactest/tests/sync898.py
@@ -0,0 +1,18 @@
+self.description = "System upgrade"
+
+sp1 = pmpkg("pkg1", "1.0-2")
+sp1.conflicts = ["pkg2"]
+sp1.provides = ["pkg2"]
+self.addpkg2db("sync", sp1);
+
+sp2 = pmpkg("pkg2", "1.0-2")
+self.addpkg2db("sync", sp2)
+
+lp1 = pmpkg("pkg1")
+self.addpkg2db("local", lp1)
+
+self.args = "-S pkg1 pkg2"
+
+self.addrule("PACMAN_RETCODE=1")
+self.addrule("!PKG_MODIFIED=pkg1")
+self.addrule("!PKG_EXIST=pkg2")
diff --git a/pactest/tests/sync899.py b/pactest/tests/sync899.py
new file mode 100644
index 00000000..698c93ea
--- /dev/null
+++ b/pactest/tests/sync899.py
@@ -0,0 +1,18 @@
+self.description = "System upgrade"
+
+sp1 = pmpkg("pkg1", "1.0-2")
+sp1.conflicts = ["pkg2"]
+sp1.provides = ["pkg2"]
+self.addpkg2db("sync", sp1);
+
+lp1 = pmpkg("pkg1")
+self.addpkg2db("local", lp1)
+
+lp2 = pmpkg("pkg2")
+self.addpkg2db("local", lp2)
+
+self.args = "-Su"
+
+self.addrule("PACMAN_RETCODE=0")
+self.addrule("PKG_EXIST=pkg1")
+self.addrule("!PKG_EXIST=pkg2")
diff --git a/pactest/tests/sync990.py b/pactest/tests/sync990.py
new file mode 100644
index 00000000..1bf532c5
--- /dev/null
+++ b/pactest/tests/sync990.py
@@ -0,0 +1,20 @@
+self.description = "Sync a package pulling a dependency conflicting with a target"
+
+sp1 = pmpkg("pkg1")
+sp1.depends = ["pkg3"]
+
+sp2 = pmpkg("pkg2")
+
+sp3 = pmpkg("pkg3")
+sp3.conflicts = ["pkg2"]
+sp3.provides = ["pkg2"]
+
+for p in sp1, sp2, sp3:
+ self.addpkg2db("sync", p)
+
+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/sync992.py b/pactest/tests/sync992.py
new file mode 100644
index 00000000..fc07f0cc
--- /dev/null
+++ b/pactest/tests/sync992.py
@@ -0,0 +1,23 @@
+self.description = "Sync a package pulling a conflicting dependency"
+
+sp1 = pmpkg("pkg1")
+sp1.depends = ["pkg3"]
+
+sp2 = pmpkg("pkg2")
+
+sp3 = pmpkg("pkg3")
+sp3.conflicts = ["pkg2"]
+sp3.provides = ["pkg2"]
+
+for p in sp1, sp2, sp3:
+ self.addpkg2db("sync", p)
+
+lp1 = pmpkg("pkg2", "0.1-1")
+self.addpkg2db("local", lp1)
+
+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/sync999.py b/pactest/tests/sync999.py
new file mode 100644
index 00000000..69089fa1
--- /dev/null
+++ b/pactest/tests/sync999.py
@@ -0,0 +1,21 @@
+self.description = "System upgrade"
+
+sp1 = pmpkg("pkg1", "1.0-2")
+sp1.conflicts = ["pkg2"]
+sp1.provides = ["pkg2"]
+self.addpkg2db("sync", sp1);
+
+sp2 = pmpkg("pkg2", "1.0-2")
+self.addpkg2db("sync", sp2)
+
+lp1 = pmpkg("pkg1")
+self.addpkg2db("local", lp1)
+
+lp2 = pmpkg("pkg2")
+self.addpkg2db("local", lp2)
+
+self.args = "-Su"
+
+self.addrule("PACMAN_RETCODE=0")
+self.addrule("PKG_EXIST=pkg1")
+self.addrule("!PKG_EXIST=pkg2")
diff --git a/pactest/tests/upgrade001.py b/pactest/tests/upgrade001.py
new file mode 100644
index 00000000..2a9538e0
--- /dev/null
+++ b/pactest/tests/upgrade001.py
@@ -0,0 +1,18 @@
+self.description = "Upgrade a package (newer version)"
+
+lp = pmpkg("dummy")
+lp.files = ["bin/dummy",
+ "usr/man/man1/dummy.1"]
+self.addpkg2db("local", lp)
+
+p = pmpkg("dummy", "1.0-2")
+p.files = ["bin/dummy",
+ "usr/man/man1/dummy.1"]
+self.addpkg(p)
+
+self.args = "-U %s" % p.filename()
+
+self.addrule("PKG_MODIFIED=dummy")
+self.addrule("PKG_VERSION=dummy|1.0-2")
+for f in lp.files:
+ self.addrule("FILE_MODIFIED=%s" % f)
diff --git a/pactest/tests/upgrade002.py b/pactest/tests/upgrade002.py
new file mode 100644
index 00000000..d561d894
--- /dev/null
+++ b/pactest/tests/upgrade002.py
@@ -0,0 +1,18 @@
+self.description = "Upgrade a package (same version)"
+
+lp = pmpkg("dummy")
+lp.files = ["bin/dummy",
+ "usr/man/man1/dummy.1"]
+self.addpkg2db("local", lp)
+
+p = pmpkg("dummy")
+p.files = ["bin/dummy",
+ "usr/man/man1/dummy.1"]
+self.addpkg(p)
+
+self.args = "-U %s" % p.filename()
+
+self.addrule("PKG_MODIFIED=dummy")
+self.addrule("PKG_VERSION=dummy|1.0-1")
+for f in lp.files:
+ self.addrule("FILE_MODIFIED=%s" % f)
diff --git a/pactest/tests/upgrade003.py b/pactest/tests/upgrade003.py
new file mode 100644
index 00000000..dac21e59
--- /dev/null
+++ b/pactest/tests/upgrade003.py
@@ -0,0 +1,18 @@
+self.description = "Upgrade a package (lesser version)"
+
+lp = pmpkg("dummy", "1.0-2")
+lp.files = ["bin/dummy",
+ "usr/man/man1/dummy.1"]
+self.addpkg2db("local", lp)
+
+p = pmpkg("dummy")
+p.files = ["bin/dummy",
+ "usr/man/man1/dummy.1"]
+self.addpkg(p)
+
+self.args = "-U %s" % p.filename()
+
+self.addrule("PKG_MODIFIED=dummy")
+self.addrule("PKG_VERSION=dummy|1.0-1")
+for f in lp.files:
+ self.addrule("FILE_MODIFIED=%s" % f)
diff --git a/pactest/tests/upgrade004.py b/pactest/tests/upgrade004.py
new file mode 100644
index 00000000..31daf915
--- /dev/null
+++ b/pactest/tests/upgrade004.py
@@ -0,0 +1,12 @@
+self.description = "Upgrade a package (not installed)"
+
+p = pmpkg("dummy")
+p.files = ["bin/dummy",
+ "usr/man/man1/dummy.1"]
+self.addpkg(p)
+
+self.args = "-U %s" % p.filename()
+
+self.addrule("PKG_EXIST=dummy")
+for f in p.files:
+ self.addrule("FILE_EXIST=%s" % f)
diff --git a/pactest/tests/upgrade010.py b/pactest/tests/upgrade010.py
new file mode 100644
index 00000000..04f3d816
--- /dev/null
+++ b/pactest/tests/upgrade010.py
@@ -0,0 +1,17 @@
+self.description = "Upgrade a package, with a file in NoUpgrade"
+
+lp = pmpkg("dummy")
+lp.files = ["etc/dummy.conf"]
+self.addpkg2db("local", lp)
+
+p = pmpkg("dummy", "1.0-2")
+p.files = ["etc/dummy.conf"]
+self.addpkg(p)
+
+self.option["noupgrade"] = ["etc/dummy.conf"]
+
+self.args = "-U %s" % p.filename()
+
+self.addrule("PKG_VERSION=dummy|1.0-2")
+self.addrule("!FILE_MODIFIED=etc/dummy.conf")
+self.addrule("FILE_PACNEW=etc/dummy.conf")
diff --git a/pactest/tests/upgrade020.py b/pactest/tests/upgrade020.py
new file mode 100644
index 00000000..bab00381
--- /dev/null
+++ b/pactest/tests/upgrade020.py
@@ -0,0 +1,17 @@
+self.description = "Upgrade a package, with a file in 'backup' (new modified)"
+
+lp = pmpkg("dummy")
+lp.files = ["etc/dummy.conf"]
+lp.backup = ["etc/dummy.conf"]
+self.addpkg2db("local", lp)
+
+p = pmpkg("dummy", "1.0-2")
+p.files = ["etc/dummy.conf*"]
+p.backup = ["etc/dummy.conf"]
+self.addpkg(p)
+
+self.args = "-U %s" % p.filename()
+
+self.addrule("PKG_VERSION=dummy|1.0-2")
+self.addrule("FILE_MODIFIED=etc/dummy.conf")
+self.addrule("!FILE_PACNEW=etc/dummy.conf")
diff --git a/pactest/tests/upgrade021.py b/pactest/tests/upgrade021.py
new file mode 100644
index 00000000..1ac0ceb5
--- /dev/null
+++ b/pactest/tests/upgrade021.py
@@ -0,0 +1,17 @@
+self.description = "Upgrade a package, with a file in 'backup' (local modified, new unchanged)"
+
+lp = pmpkg("dummy")
+lp.files = ["etc/dummy.conf*"]
+lp.backup = ["etc/dummy.conf"]
+self.addpkg2db("local", lp)
+
+p = pmpkg("dummy", "1.0-2")
+p.files = ["etc/dummy.conf"]
+p.backup = ["etc/dummy.conf"]
+self.addpkg(p)
+
+self.args = "-U %s" % p.filename()
+
+self.addrule("PKG_VERSION=dummy|1.0-2")
+self.addrule("!FILE_MODIFIED=etc/dummy.conf")
+self.addrule("!FILE_PACNEW=etc/dummy.conf")
diff --git a/pactest/tests/upgrade022.py b/pactest/tests/upgrade022.py
new file mode 100644
index 00000000..6bf12c15
--- /dev/null
+++ b/pactest/tests/upgrade022.py
@@ -0,0 +1,17 @@
+self.description = "Upgrade a package, with a file in 'backup' (local and new modified)"
+
+lp = pmpkg("dummy")
+lp.files = ["etc/dummy.conf"]
+lp.backup = ["etc/dummy.conf*"]
+self.addpkg2db("local", lp)
+
+p = pmpkg("dummy", "1.0-2")
+p.files = ["etc/dummy.conf**"]
+p.backup = ["etc/dummy.conf"]
+self.addpkg(p)
+
+self.args = "-U %s" % p.filename()
+
+self.addrule("PKG_VERSION=dummy|1.0-2")
+self.addrule("!FILE_MODIFIED=etc/dummy.conf")
+self.addrule("FILE_PACNEW=etc/dummy.conf")
diff --git a/pactest/tests/upgrade030.py b/pactest/tests/upgrade030.py
new file mode 100644
index 00000000..1082c32b
--- /dev/null
+++ b/pactest/tests/upgrade030.py
@@ -0,0 +1,22 @@
+self.description = "Upgrade packages with various reasons"
+
+lp1 = pmpkg("pkg1")
+lp1.reason = 0
+lp2 = pmpkg("pkg2")
+lp2.reason = 1
+
+for p in lp1, lp2:
+ self.addpkg2db("local", p)
+
+p1 = pmpkg("pkg1", "1.0-2")
+p2 = pmpkg("pkg2", "1.0-2")
+
+for p in p1, p2:
+ self.addpkg(p)
+
+self.args = "-U %s" % " ".join([p.filename() for p in p1, p2])
+#self.args = "-Qi %s" % " ".join([p.name for p in lp1, lp2])
+
+self.addrule("PACMAN_RETCODE=0")
+self.addrule("PKG_REASON=pkg1|0")
+self.addrule("PKG_REASON=pkg2|1")
diff --git a/pactest/tests/upgrade040.py b/pactest/tests/upgrade040.py
new file mode 100644
index 00000000..6946882e
--- /dev/null
+++ b/pactest/tests/upgrade040.py
@@ -0,0 +1,25 @@
+self.description = "file relocation 1"
+
+lp1 = pmpkg("dummy")
+lp1.files = ["bin/dummy",
+ "usr/share/file"]
+
+lp2 = pmpkg("foobar")
+lp2.files = ["bin/foobar"]
+
+for p in lp1, lp2:
+ self.addpkg2db("local", p)
+
+p1 = pmpkg("dummy")
+p1.files = ["bin/dummy"]
+
+p2 = pmpkg("foobar")
+p2.files = ["bin/foobar",
+ "usr/share/file"]
+
+for p in p1, p2:
+ self.addpkg(p)
+
+self.args = "-U %s" % " ".join([p.filename() for p in p1, p2])
+
+self.addrule("PACMAN_RETCODE=0")