summaryrefslogtreecommitdiffstats
path: root/debian/tests
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-27 09:40:32 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-27 09:40:32 +0000
commit76faa357888fc7ac8697e12f151f70fd7227a978 (patch)
tree5cfd018ebeb537a499caa021a008c6e51cc22d73 /debian/tests
parentAdding upstream version 1.20.13. (diff)
downloaddpkg-76faa357888fc7ac8697e12f151f70fd7227a978.tar.xz
dpkg-76faa357888fc7ac8697e12f151f70fd7227a978.zip
Adding debian version 1.20.13.debian/1.20.13debian
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'debian/tests')
-rw-r--r--debian/tests/control15
-rw-r--r--debian/tests/test-func10
-rw-r--r--debian/tests/test-func-root14
-rw-r--r--debian/tests/test-not-root14
-rw-r--r--debian/tests/test-root14
5 files changed, 67 insertions, 0 deletions
diff --git a/debian/tests/control b/debian/tests/control
new file mode 100644
index 0000000..6cd7a7b
--- /dev/null
+++ b/debian/tests/control
@@ -0,0 +1,15 @@
+Tests: test-not-root
+Depends: build-essential, autoconf, pkg-config, file
+Restrictions: superficial skippable
+
+Tests: test-root
+Depends: build-essential, autoconf, pkg-config, file
+Restrictions: superficial needs-root breaks-testbed
+
+Tests: test-func
+Depends: @, eatmydata
+Restrictions: allow-stderr
+
+Tests: test-func-root
+Depends: @, eatmydata
+Restrictions: allow-stderr needs-root breaks-testbed
diff --git a/debian/tests/test-func b/debian/tests/test-func
new file mode 100644
index 0000000..db386cd
--- /dev/null
+++ b/debian/tests/test-func
@@ -0,0 +1,10 @@
+#!/bin/sh
+
+set -e
+
+export DPKG_TESTSUITE_OPTIONS="debug"
+export DPKG_ADMINDIR="$AUTOPKGTEST_TMP/db"
+export DPKG_INSTDIR="$AUTOPKGTEST_TMP/root"
+
+tests/db-regen "$DPKG_ADMINDIR" "$DPKG_INSTDIR"
+eatmydata make -C tests test DPKG_INSTDIR="$DPKG_INSTDIR" DPKG_ADMINDIR="$DPKG_ADMINDIR"
diff --git a/debian/tests/test-func-root b/debian/tests/test-func-root
new file mode 100644
index 0000000..e12297c
--- /dev/null
+++ b/debian/tests/test-func-root
@@ -0,0 +1,14 @@
+#!/bin/sh
+
+set -e
+
+if [ "$(id -u)" != '0' ]; then
+ # Fail, we declared needing root as a restriction.
+ exit 1
+fi
+
+export DPKG_TESTSUITE_OPTIONS="debug as-root"
+export DPKG_ADMINDIR="$AUTOPKGTEST_TMP/db"
+
+tests/db-regen "$DPKG_ADMINDIR" "/"
+eatmydata make -C tests test DPKG_ADMINDIR="$DPKG_ADMINDIR"
diff --git a/debian/tests/test-not-root b/debian/tests/test-not-root
new file mode 100644
index 0000000..e1ca6db
--- /dev/null
+++ b/debian/tests/test-not-root
@@ -0,0 +1,14 @@
+#!/bin/sh
+
+set -e
+
+if [ "$(id -u)" = '0' ]; then
+ # Skip, we cannot declare we do not want root.
+ exit 77
+fi
+
+srcdir="$(pwd)"
+
+cd $AUTOPKGTEST_TMP
+"$srcdir/configure" --disable-nls --disable-dselect
+make installcheck TESTSUITEFLAGS=--verbose
diff --git a/debian/tests/test-root b/debian/tests/test-root
new file mode 100644
index 0000000..d4c658f
--- /dev/null
+++ b/debian/tests/test-root
@@ -0,0 +1,14 @@
+#!/bin/sh
+
+set -e
+
+if [ "$(id -u)" != '0' ]; then
+ # Fail, we declared needing root as a restriction.
+ exit 1
+fi
+
+srcdir="$(pwd)"
+
+cd $AUTOPKGTEST_TMP
+"$srcdir/configure" --disable-nls --disable-dselect
+make installcheck TESTSUITEFLAGS=--verbose