summaryrefslogtreecommitdiffstats
path: root/tests/t-triggers-depfarcycle
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--tests/t-triggers-depfarcycle/Makefile36
-rw-r--r--tests/t-triggers-depfarcycle/pkg-depends-a/DEBIAN/control8
-rw-r--r--tests/t-triggers-depfarcycle/pkg-depends-b/DEBIAN/control8
-rw-r--r--tests/t-triggers-depfarcycle/pkg-files/DEBIAN/control8
-rw-r--r--tests/t-triggers-depfarcycle/pkg-files/test/trigger/test-file1
-rw-r--r--tests/t-triggers-depfarcycle/pkg-trigger/DEBIAN/control8
-rwxr-xr-xtests/t-triggers-depfarcycle/pkg-trigger/DEBIAN/postinst16
-rw-r--r--tests/t-triggers-depfarcycle/pkg-trigger/DEBIAN/triggers1
8 files changed, 86 insertions, 0 deletions
diff --git a/tests/t-triggers-depfarcycle/Makefile b/tests/t-triggers-depfarcycle/Makefile
new file mode 100644
index 0000000..65a490c
--- /dev/null
+++ b/tests/t-triggers-depfarcycle/Makefile
@@ -0,0 +1,36 @@
+TESTS_DEB := pkg-depends-a pkg-depends-b pkg-files pkg-trigger
+
+include ../Test.mk
+
+test-case:
+ # The trigger cycle does not affect us here.
+ $(DPKG_INSTALL) pkg-depends-a.deb pkg-files.deb \
+ pkg-depends-b.deb pkg-trigger.deb
+ $(DPKG_UNPACK) pkg-files.deb
+ $(DPKG_CONFIGURE) --pending
+
+ # Make sure everything is left in a correct state.
+ $(call pkg_is_installed,pkg-files)
+ $(call pkg_is_installed,pkg-depends-a)
+ $(call pkg_is_installed,pkg-depends-b)
+ $(call pkg_is_installed,pkg-trigger)
+
+ # Provoke the trigger cycle.
+ $(DPKG_UNPACK) pkg-depends-a.deb
+ $(DPKG_UNPACK) pkg-depends-b.deb
+ $(DPKG_UNPACK) pkg-files.deb
+ ! $(DPKG_CONFIGURE) pkg-trigger
+ $(DPKG) -s pkg-depends-a pkg-depends-b pkg-files pkg-trigger
+ ! $(DPKG_CONFIGURE) --pending
+
+ # Make sure everything is left in a correct state.
+ $(call pkg_is_installed,pkg-files)
+ $(call pkg_is_installed,pkg-depends-a)
+ $(call pkg_is_installed,pkg-depends-b)
+ $(call pkg_status_is,pkg-trigger,install ok half-configured)
+
+ # Cleanup.
+ $(DPKG_PURGE) pkg-trigger pkg-files pkg-depends-a pkg-depends-b
+
+test-clean:
+ -$(DPKG_PURGE) pkg-trigger pkg-files pkg-depends-a pkg-depends-b
diff --git a/tests/t-triggers-depfarcycle/pkg-depends-a/DEBIAN/control b/tests/t-triggers-depfarcycle/pkg-depends-a/DEBIAN/control
new file mode 100644
index 0000000..e8a34db
--- /dev/null
+++ b/tests/t-triggers-depfarcycle/pkg-depends-a/DEBIAN/control
@@ -0,0 +1,8 @@
+Package: pkg-depends-a
+Version: 0
+Section: test
+Priority: extra
+Maintainer: Dpkg Developers <debian-dpkg@lists.debian.org>
+Architecture: all
+Depends: pkg-files
+Description: test package - package to be configured
diff --git a/tests/t-triggers-depfarcycle/pkg-depends-b/DEBIAN/control b/tests/t-triggers-depfarcycle/pkg-depends-b/DEBIAN/control
new file mode 100644
index 0000000..5498857
--- /dev/null
+++ b/tests/t-triggers-depfarcycle/pkg-depends-b/DEBIAN/control
@@ -0,0 +1,8 @@
+Package: pkg-depends-b
+Version: 0
+Section: test
+Priority: extra
+Maintainer: Dpkg Developers <debian-dpkg@lists.debian.org>
+Architecture: all
+Depends: pkg-trigger
+Description: test package - package to be configured
diff --git a/tests/t-triggers-depfarcycle/pkg-files/DEBIAN/control b/tests/t-triggers-depfarcycle/pkg-files/DEBIAN/control
new file mode 100644
index 0000000..7ce4ebc
--- /dev/null
+++ b/tests/t-triggers-depfarcycle/pkg-files/DEBIAN/control
@@ -0,0 +1,8 @@
+Package: pkg-files
+Version: 0
+Section: test
+Priority: extra
+Maintainer: Dpkg Developers <debian-dpkg@lists.debian.org>
+Architecture: all
+Depends: pkg-depends-b
+Description: test package - provides a file under /test/trigger/
diff --git a/tests/t-triggers-depfarcycle/pkg-files/test/trigger/test-file b/tests/t-triggers-depfarcycle/pkg-files/test/trigger/test-file
new file mode 100644
index 0000000..fb67027
--- /dev/null
+++ b/tests/t-triggers-depfarcycle/pkg-files/test/trigger/test-file
@@ -0,0 +1 @@
+sample file
diff --git a/tests/t-triggers-depfarcycle/pkg-trigger/DEBIAN/control b/tests/t-triggers-depfarcycle/pkg-trigger/DEBIAN/control
new file mode 100644
index 0000000..8ed63e6
--- /dev/null
+++ b/tests/t-triggers-depfarcycle/pkg-trigger/DEBIAN/control
@@ -0,0 +1,8 @@
+Package: pkg-trigger
+Version: 0
+Section: test
+Priority: extra
+Maintainer: Dpkg Developers <debian-dpkg@lists.debian.org>
+Architecture: all
+Depends: pkg-depends-a
+Description: test package - interested in files on /test/trigger/
diff --git a/tests/t-triggers-depfarcycle/pkg-trigger/DEBIAN/postinst b/tests/t-triggers-depfarcycle/pkg-trigger/DEBIAN/postinst
new file mode 100755
index 0000000..ffbad78
--- /dev/null
+++ b/tests/t-triggers-depfarcycle/pkg-trigger/DEBIAN/postinst
@@ -0,0 +1,16 @@
+#!/bin/sh
+set -e
+
+case "$1" in
+ triggered)
+ pkg_status=`dpkg-query -f '${Status}' -W pkg-depends-a`
+ if [ "$pkg_status" = "install ok installed" ]; then
+ echo "Pass: pkg-depends is installed"
+ else
+ echo "Fail: pkg-depends is not installed ($pkg_status)"
+ exit 1
+ fi
+ ;;
+esac
+
+exit 0
diff --git a/tests/t-triggers-depfarcycle/pkg-trigger/DEBIAN/triggers b/tests/t-triggers-depfarcycle/pkg-trigger/DEBIAN/triggers
new file mode 100644
index 0000000..3b047af
--- /dev/null
+++ b/tests/t-triggers-depfarcycle/pkg-trigger/DEBIAN/triggers
@@ -0,0 +1 @@
+interest /test/trigger