summaryrefslogtreecommitdiffstats
path: root/tests/t-disappear-diverted
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--tests/t-disappear-diverted-other/Makefile28
-rw-r--r--tests/t-disappear-diverted-other/pkg-divert/DEBIAN/control8
-rwxr-xr-xtests/t-disappear-diverted-other/pkg-divert/DEBIAN/postrm8
-rwxr-xr-xtests/t-disappear-diverted-other/pkg-divert/DEBIAN/preinst8
-rw-r--r--tests/t-disappear-diverted-other/pkg-divert/test-dir/test-normal0
-rw-r--r--tests/t-disappear-diverted-other/pkg-diverted/DEBIAN/control8
-rw-r--r--tests/t-disappear-diverted-other/pkg-diverted/test-dir/test-divert0
-rw-r--r--tests/t-disappear-diverted-other/pkg-replaces/DEBIAN/control9
-rw-r--r--tests/t-disappear-diverted-other/pkg-replaces/test-dir/test-normal0
-rw-r--r--tests/t-disappear-diverted/Makefile58
-rw-r--r--tests/t-disappear-diverted/pkg-disappear/DEBIAN/control8
-rw-r--r--tests/t-disappear-diverted/pkg-disappear/test-dir/test-normal0
-rw-r--r--tests/t-disappear-diverted/pkg-divert/DEBIAN/control9
-rwxr-xr-xtests/t-disappear-diverted/pkg-divert/DEBIAN/postrm8
-rwxr-xr-xtests/t-disappear-diverted/pkg-divert/DEBIAN/preinst8
-rw-r--r--tests/t-disappear-diverted/pkg-divert/test-dir/test-normal0
-rw-r--r--tests/t-disappear-diverted/pkg-normal/DEBIAN/control9
-rw-r--r--tests/t-disappear-diverted/pkg-normal/test-dir/test-normal0
18 files changed, 169 insertions, 0 deletions
diff --git a/tests/t-disappear-diverted-other/Makefile b/tests/t-disappear-diverted-other/Makefile
new file mode 100644
index 0000000..d483b9a
--- /dev/null
+++ b/tests/t-disappear-diverted-other/Makefile
@@ -0,0 +1,28 @@
+TESTS_DEB := pkg-divert pkg-diverted pkg-replaces
+
+include ../Test.mk
+
+test-case:
+ # Test disappearing diverted package with a not contended pathname.
+ $(DPKG_INSTALL) pkg-divert.deb
+ $(DPKG_INSTALL) pkg-diverted.deb
+ $(DPKG_INSTALL) pkg-replaces.deb
+ # Should disappear because there is no contended pathname.
+ $(call pkg_is_not_installed,pkg-divert)
+ $(DPKG_PURGE) pkg-divert
+ $(DPKG_PURGE) pkg-diverted
+ $(DPKG_PURGE) pkg-replaces
+ :
+ # Test disappearing diverted package with a not contended pathname.
+ $(DPKG_INSTALL) pkg-divert.deb
+ $(DPKG_INSTALL) pkg-replaces.deb
+ # Should disappear because there is no contended pathname.
+ $(call pkg_is_not_installed,pkg-divert)
+ $(DPKG_PURGE) pkg-divert
+ $(DPKG_PURGE) pkg-replaces
+
+test-clean:
+ $(DPKG_PURGE) pkg-divert
+ $(DPKG_PURGE) pkg-diverted
+ $(DPKG_PURGE) pkg-replaces
+
diff --git a/tests/t-disappear-diverted-other/pkg-divert/DEBIAN/control b/tests/t-disappear-diverted-other/pkg-divert/DEBIAN/control
new file mode 100644
index 0000000..b304762
--- /dev/null
+++ b/tests/t-disappear-diverted-other/pkg-divert/DEBIAN/control
@@ -0,0 +1,8 @@
+Package: pkg-divert
+Version: 0.0-1
+Section: test
+Priority: extra
+Maintainer: Dpkg Developers <debian-dpkg@lists.debian.org>
+Architecture: all
+Description: test package - divert on disappearing package
+
diff --git a/tests/t-disappear-diverted-other/pkg-divert/DEBIAN/postrm b/tests/t-disappear-diverted-other/pkg-divert/DEBIAN/postrm
new file mode 100755
index 0000000..98891f6
--- /dev/null
+++ b/tests/t-disappear-diverted-other/pkg-divert/DEBIAN/postrm
@@ -0,0 +1,8 @@
+#!/bin/sh
+
+set -e
+
+if [ "$1" = "purge" ] || [ "$1" = "disappear" ]; then
+ dpkg-divert --rename --remove /test-dir/test-divert
+fi
+
diff --git a/tests/t-disappear-diverted-other/pkg-divert/DEBIAN/preinst b/tests/t-disappear-diverted-other/pkg-divert/DEBIAN/preinst
new file mode 100755
index 0000000..ad840e6
--- /dev/null
+++ b/tests/t-disappear-diverted-other/pkg-divert/DEBIAN/preinst
@@ -0,0 +1,8 @@
+#!/bin/sh
+
+set -e
+
+if [ "$1" = "install" ] || [ "$1" = "upgrade" ]; then
+ dpkg-divert --rename --add /test-dir/test-divert
+fi
+
diff --git a/tests/t-disappear-diverted-other/pkg-divert/test-dir/test-normal b/tests/t-disappear-diverted-other/pkg-divert/test-dir/test-normal
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/tests/t-disappear-diverted-other/pkg-divert/test-dir/test-normal
diff --git a/tests/t-disappear-diverted-other/pkg-diverted/DEBIAN/control b/tests/t-disappear-diverted-other/pkg-diverted/DEBIAN/control
new file mode 100644
index 0000000..cb428af
--- /dev/null
+++ b/tests/t-disappear-diverted-other/pkg-diverted/DEBIAN/control
@@ -0,0 +1,8 @@
+Package: pkg-diverted
+Version: 0.0-1
+Section: test
+Priority: extra
+Maintainer: Dpkg Developers <debian-dpkg@lists.debian.org>
+Architecture: all
+Description: test package - diverted
+
diff --git a/tests/t-disappear-diverted-other/pkg-diverted/test-dir/test-divert b/tests/t-disappear-diverted-other/pkg-diverted/test-dir/test-divert
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/tests/t-disappear-diverted-other/pkg-diverted/test-dir/test-divert
diff --git a/tests/t-disappear-diverted-other/pkg-replaces/DEBIAN/control b/tests/t-disappear-diverted-other/pkg-replaces/DEBIAN/control
new file mode 100644
index 0000000..e41beda
--- /dev/null
+++ b/tests/t-disappear-diverted-other/pkg-replaces/DEBIAN/control
@@ -0,0 +1,9 @@
+Package: pkg-replaces
+Version: 0.0-1
+Section: test
+Priority: extra
+Maintainer: Dpkg Developers <debian-dpkg@lists.debian.org>
+Architecture: all
+Replaces: pkg-divert
+Description: test package - replaces to disappear
+
diff --git a/tests/t-disappear-diverted-other/pkg-replaces/test-dir/test-normal b/tests/t-disappear-diverted-other/pkg-replaces/test-dir/test-normal
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/tests/t-disappear-diverted-other/pkg-replaces/test-dir/test-normal
diff --git a/tests/t-disappear-diverted/Makefile b/tests/t-disappear-diverted/Makefile
new file mode 100644
index 0000000..6df38e6
--- /dev/null
+++ b/tests/t-disappear-diverted/Makefile
@@ -0,0 +1,58 @@
+TESTS_DEB := pkg-normal pkg-divert pkg-disappear
+
+include ../Test.mk
+
+test-case:
+ # Test not disappearing diverted package.
+ $(DPKG_INSTALL) pkg-disappear.deb
+ test -e $(DPKG_INSTDIR)/test-dir/test-normal
+ ! test -e $(DPKG_INSTDIR)/test-dir/test-normal.distrib
+ $(DPKG_INSTALL) pkg-divert.deb
+ test -e $(DPKG_INSTDIR)/test-dir/test-normal
+ test -e $(DPKG_INSTDIR)/test-dir/test-normal.distrib
+ # Should not disappear while it's being diverted.
+ $(call pkg_is_installed,pkg-disappear)
+ $(DPKG_PURGE) pkg-divert
+ test -e $(DPKG_INSTDIR)/test-dir/test-normal
+ ! test -e $(DPKG_INSTDIR)/test-dir/test-normal.distrib
+ $(DPKG_PURGE) pkg-disappear
+ :
+ # Test disappearing package not being diverted.
+ $(DPKG_INSTALL) pkg-disappear.deb
+ test -e $(DPKG_INSTDIR)/test-dir/test-normal
+ ! test -e $(DPKG_INSTDIR)/test-dir/test-normal.distrib
+ $(DPKG_INSTALL) pkg-normal.deb
+ test -e $(DPKG_INSTDIR)/test-dir/test-normal
+ ! test -e $(DPKG_INSTDIR)/test-dir/test-normal.distrib
+ # Should have been disappeared now.
+ $(call pkg_is_not_installed,pkg-disappear)
+ $(DPKG_PURGE) pkg-normal
+ ! test -e $(DPKG_INSTDIR)/test-dir/test-normal
+ ! test -e $(DPKG_INSTDIR)/test-dir/test-normal.distrib
+ $(DPKG_PURGE) pkg-disappear
+ :
+ # Test disappearing package diverted but replaced by a 3rd package.
+ $(DPKG_INSTALL) pkg-disappear.deb
+ test -e $(DPKG_INSTDIR)/test-dir/test-normal
+ ! test -e $(DPKG_INSTDIR)/test-dir/test-normal.distrib
+ $(DPKG_INSTALL) pkg-divert.deb
+ test -e $(DPKG_INSTDIR)/test-dir/test-normal
+ test -e $(DPKG_INSTDIR)/test-dir/test-normal.distrib
+ $(DPKG_INSTALL) pkg-normal.deb
+ test -e $(DPKG_INSTDIR)/test-dir/test-normal
+ test -e $(DPKG_INSTDIR)/test-dir/test-normal.distrib
+ # Should have been disappeared now, as it is diverted by a 3rd package.
+ $(call pkg_is_not_installed,pkg-disappear)
+ $(DPKG_PURGE) pkg-normal
+ test -e $(DPKG_INSTDIR)/test-dir/test-normal
+ ! test -e $(DPKG_INSTDIR)/test-dir/test-normal.distrib
+ $(DPKG_PURGE) pkg-divert
+ ! test -e $(DPKG_INSTDIR)/test-dir/test-normal
+ ! test -e $(DPKG_INSTDIR)/test-dir/test-normal.distrib
+ $(DPKG_PURGE) pkg-disappear
+
+test-clean:
+ $(DPKG_PURGE) pkg-divert
+ $(DPKG_PURGE) pkg-disappear
+ $(DPKG_PURGE) pkg-normal
+
diff --git a/tests/t-disappear-diverted/pkg-disappear/DEBIAN/control b/tests/t-disappear-diverted/pkg-disappear/DEBIAN/control
new file mode 100644
index 0000000..78c2a17
--- /dev/null
+++ b/tests/t-disappear-diverted/pkg-disappear/DEBIAN/control
@@ -0,0 +1,8 @@
+Package: pkg-disappear
+Version: 0.0-1
+Section: test
+Priority: extra
+Maintainer: Dpkg Developers <debian-dpkg@lists.debian.org>
+Architecture: all
+Description: test package - disappear
+
diff --git a/tests/t-disappear-diverted/pkg-disappear/test-dir/test-normal b/tests/t-disappear-diverted/pkg-disappear/test-dir/test-normal
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/tests/t-disappear-diverted/pkg-disappear/test-dir/test-normal
diff --git a/tests/t-disappear-diverted/pkg-divert/DEBIAN/control b/tests/t-disappear-diverted/pkg-divert/DEBIAN/control
new file mode 100644
index 0000000..42515eb
--- /dev/null
+++ b/tests/t-disappear-diverted/pkg-divert/DEBIAN/control
@@ -0,0 +1,9 @@
+Package: pkg-divert
+Version: 0.0-1
+Section: test
+Priority: extra
+Maintainer: Dpkg Developers <debian-dpkg@lists.debian.org>
+Architecture: all
+Replaces: pkg-disappear
+Description: test package - divert on disappearing package
+
diff --git a/tests/t-disappear-diverted/pkg-divert/DEBIAN/postrm b/tests/t-disappear-diverted/pkg-divert/DEBIAN/postrm
new file mode 100755
index 0000000..3787c66
--- /dev/null
+++ b/tests/t-disappear-diverted/pkg-divert/DEBIAN/postrm
@@ -0,0 +1,8 @@
+#!/bin/sh
+
+set -e
+
+if [ "$1" = "purge" ] || [ "$1" = "disappear" ]; then
+ dpkg-divert --rename --remove /test-dir/test-normal
+fi
+
diff --git a/tests/t-disappear-diverted/pkg-divert/DEBIAN/preinst b/tests/t-disappear-diverted/pkg-divert/DEBIAN/preinst
new file mode 100755
index 0000000..898c3c5
--- /dev/null
+++ b/tests/t-disappear-diverted/pkg-divert/DEBIAN/preinst
@@ -0,0 +1,8 @@
+#!/bin/sh
+
+set -e
+
+if [ "$1" = "install" ] || [ "$1" = "upgrade" ]; then
+ dpkg-divert --rename --add /test-dir/test-normal
+fi
+
diff --git a/tests/t-disappear-diverted/pkg-divert/test-dir/test-normal b/tests/t-disappear-diverted/pkg-divert/test-dir/test-normal
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/tests/t-disappear-diverted/pkg-divert/test-dir/test-normal
diff --git a/tests/t-disappear-diverted/pkg-normal/DEBIAN/control b/tests/t-disappear-diverted/pkg-normal/DEBIAN/control
new file mode 100644
index 0000000..6d82537
--- /dev/null
+++ b/tests/t-disappear-diverted/pkg-normal/DEBIAN/control
@@ -0,0 +1,9 @@
+Package: pkg-normal
+Version: 0.0-1
+Section: test
+Priority: extra
+Maintainer: Dpkg Developers <debian-dpkg@lists.debian.org>
+Architecture: all
+Replaces: pkg-disappear
+Description: test package - normal
+
diff --git a/tests/t-disappear-diverted/pkg-normal/test-dir/test-normal b/tests/t-disappear-diverted/pkg-normal/test-dir/test-normal
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/tests/t-disappear-diverted/pkg-normal/test-dir/test-normal