diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-07 14:58:51 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-07 14:58:51 +0000 |
commit | cbffab246997fb5a06211dfb706b54e5ae5bb59f (patch) | |
tree | 0573c5d96f58d74d76a49c0f2a70398e389a36d3 /tests/t-triggers-depcycle | |
parent | Initial commit. (diff) | |
download | dpkg-cbffab246997fb5a06211dfb706b54e5ae5bb59f.tar.xz dpkg-cbffab246997fb5a06211dfb706b54e5ae5bb59f.zip |
Adding upstream version 1.21.22.upstream/1.21.22upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to '')
10 files changed, 90 insertions, 0 deletions
diff --git a/tests/t-triggers-depcycle/Makefile b/tests/t-triggers-depcycle/Makefile new file mode 100644 index 0000000..5b1f0fb --- /dev/null +++ b/tests/t-triggers-depcycle/Makefile @@ -0,0 +1,25 @@ +TESTS_DEB := \ + pkg-depends-0 pkg-depends-1 \ + pkg-files-0 pkg-files-1 \ + pkg-trigger + +include ../Test.mk + +test-case: + # Now provoke the trigger cycle + $(DPKG_INSTALL) pkg-depends-0.deb + $(DPKG_INSTALL) pkg-trigger.deb pkg-files-0.deb + $(DPKG_UNPACK) pkg-files-1.deb + ! $(DPKG_CONFIGURE) --pending + + # Make sure everything is left in the expected state. + $(call pkg_is_installed,pkg-files) + $(call pkg_is_installed,pkg-depends) + $(call pkg_status_is,pkg-trigger,install ok half-configured) + + # Cleanup. + $(DPKG_PURGE) pkg-trigger pkg-files + $(DPKG_PURGE) pkg-depends + +test-clean: + -$(DPKG_PURGE) --force-all pkg-trigger pkg-files pkg-depends diff --git a/tests/t-triggers-depcycle/pkg-depends-0/DEBIAN/control b/tests/t-triggers-depcycle/pkg-depends-0/DEBIAN/control new file mode 100644 index 0000000..27c429f --- /dev/null +++ b/tests/t-triggers-depcycle/pkg-depends-0/DEBIAN/control @@ -0,0 +1,7 @@ +Package: pkg-depends +Version: 0 +Section: test +Priority: extra +Maintainer: Dpkg Developers <debian-dpkg@lists.debian.org> +Architecture: all +Description: test package - package to be configured diff --git a/tests/t-triggers-depcycle/pkg-depends-1/DEBIAN/control b/tests/t-triggers-depcycle/pkg-depends-1/DEBIAN/control new file mode 100644 index 0000000..2b3a8f3 --- /dev/null +++ b/tests/t-triggers-depcycle/pkg-depends-1/DEBIAN/control @@ -0,0 +1,8 @@ +Package: pkg-depends +Version: 1 +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-depcycle/pkg-files-0/DEBIAN/control b/tests/t-triggers-depcycle/pkg-files-0/DEBIAN/control new file mode 100644 index 0000000..9668941 --- /dev/null +++ b/tests/t-triggers-depcycle/pkg-files-0/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-trigger +Description: test package - provides a file under /test/trigger/ diff --git a/tests/t-triggers-depcycle/pkg-files-0/test/trigger/test-file b/tests/t-triggers-depcycle/pkg-files-0/test/trigger/test-file new file mode 100644 index 0000000..fb67027 --- /dev/null +++ b/tests/t-triggers-depcycle/pkg-files-0/test/trigger/test-file @@ -0,0 +1 @@ +sample file diff --git a/tests/t-triggers-depcycle/pkg-files-1/DEBIAN/control b/tests/t-triggers-depcycle/pkg-files-1/DEBIAN/control new file mode 100644 index 0000000..f4312fa --- /dev/null +++ b/tests/t-triggers-depcycle/pkg-files-1/DEBIAN/control @@ -0,0 +1,8 @@ +Package: pkg-files +Version: 1 +Section: test +Priority: extra +Maintainer: Dpkg Developers <debian-dpkg@lists.debian.org> +Architecture: all +Depends: pkg-trigger +Description: test package - provides a file under /test/trigger/ diff --git a/tests/t-triggers-depcycle/pkg-files-1/test/trigger/test-file b/tests/t-triggers-depcycle/pkg-files-1/test/trigger/test-file new file mode 100644 index 0000000..fb67027 --- /dev/null +++ b/tests/t-triggers-depcycle/pkg-files-1/test/trigger/test-file @@ -0,0 +1 @@ +sample file diff --git a/tests/t-triggers-depcycle/pkg-trigger/DEBIAN/control b/tests/t-triggers-depcycle/pkg-trigger/DEBIAN/control new file mode 100644 index 0000000..72221a7 --- /dev/null +++ b/tests/t-triggers-depcycle/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, pkg-files +Description: test package - interested in files on /test/trigger/ diff --git a/tests/t-triggers-depcycle/pkg-trigger/DEBIAN/postinst b/tests/t-triggers-depcycle/pkg-trigger/DEBIAN/postinst new file mode 100755 index 0000000..716cdd5 --- /dev/null +++ b/tests/t-triggers-depcycle/pkg-trigger/DEBIAN/postinst @@ -0,0 +1,23 @@ +#!/bin/sh +set -e + +case "$1" in + triggered) + pkg_status=`dpkg-query -f '${Status}' -W pkg-depends` + 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 + pkg_status=`dpkg-query -f '${Status}' -W pkg-files` + if [ "$pkg_status" = "install ok installed" ]; then + echo "Pass: pkg-files is installed" + else + echo "Fail: pkg-files is not installed ($pkg_status)" + exit 1 + fi + ;; +esac + +exit 0 diff --git a/tests/t-triggers-depcycle/pkg-trigger/DEBIAN/triggers b/tests/t-triggers-depcycle/pkg-trigger/DEBIAN/triggers new file mode 100644 index 0000000..3b047af --- /dev/null +++ b/tests/t-triggers-depcycle/pkg-trigger/DEBIAN/triggers @@ -0,0 +1 @@ +interest /test/trigger |