mirror of
https://github.com/yaobinwen/dpkg.git
synced 2026-01-12 08:20:35 +00:00
debian: Hook the functional test suite into autopkgtest
We add two tests, one for normal user and directory root operation, and another one for unprivileged and DPKG_ROOT operation.
This commit is contained in:
@ -94,6 +94,8 @@ EXTRA_DIST = \
|
||||
debian/shlibs.default \
|
||||
debian/shlibs.override \
|
||||
debian/tests/control \
|
||||
debian/tests/test-func \
|
||||
debian/tests/test-func-root \
|
||||
debian/tests/test-not-root \
|
||||
debian/tests/test-root \
|
||||
po/its/polkit.its \
|
||||
|
||||
8
debian/tests/control
vendored
8
debian/tests/control
vendored
@ -5,3 +5,11 @@ 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
|
||||
|
||||
10
debian/tests/test-func
vendored
Normal file
10
debian/tests/test-func
vendored
Normal file
@ -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"
|
||||
14
debian/tests/test-func-root
vendored
Normal file
14
debian/tests/test-func-root
vendored
Normal file
@ -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"
|
||||
Reference in New Issue
Block a user