summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorJulian Andres Klode <jak@debian.org>2018-12-10 17:35:33 +0000
committerJulian Andres Klode <jak@debian.org>2018-12-10 17:35:33 +0000
commitd57834a36e6adebbad28819360a984819995b376 (patch)
tree36a39bad37db8082f26427659817d882a6b0b8d8 /test
parent294b5e77a25d2600e7f3ce12a996d1694b5be817 (diff)
parent806e94dcd8dbdf7bf1909657fd4331cfe17b4ab0 (diff)
Merge branch 'pu/dpkg-path' into 'master'
Set PATH=/usr/sbin:/usr/bin:/sbin:/bin when running dpkg See merge request apt-team/apt!38
Diffstat (limited to 'test')
-rw-r--r--test/integration/framework3
-rwxr-xr-xtest/integration/test-dpkg-path35
2 files changed, 38 insertions, 0 deletions
diff --git a/test/integration/framework b/test/integration/framework
index 8ec2e80cf..e7b82c273 100644
--- a/test/integration/framework
+++ b/test/integration/framework
@@ -482,6 +482,9 @@ EOF
unset GREP_OPTIONS POSIXLY_CORRECT
unset http_proxy HTTP_PROXY https_proxy HTTPS_PROXY no_proxy
+ # Make dpkg inherit testing path
+ echo 'DPkg::Path "";\n' >> aptconfig.conf
+
# Make gcov shut up
export GCOV_ERROR_FILE=/dev/null
diff --git a/test/integration/test-dpkg-path b/test/integration/test-dpkg-path
new file mode 100755
index 000000000..b17b59421
--- /dev/null
+++ b/test/integration/test-dpkg-path
@@ -0,0 +1,35 @@
+#!/bin/sh
+set -e
+
+TESTDIR="$(readlink -f "$(dirname "$0")")"
+. "$TESTDIR/framework"
+
+setupenvironment
+configarchitecture 'native'
+configdpkgnoopchroot
+
+# create a bunch of test pkgs
+createtestpkg() {
+ setupsimplenativepackage "testpkg-$1" 'native' '1.0' 'unstable'
+ BUILDDIR="incoming/testpkg-$1-1.0"
+ echo '#!/bin/sh
+echo PATH=$PATH' > "${BUILDDIR}/debian/preinst"
+ buildpackage "$BUILDDIR" 'unstable' 'main' 'native'
+ rm -rf "$BUILDDIR"
+}
+
+createtestpkg 'one'
+createtestpkg 'two'
+
+setupaptarchive
+
+
+# Inherit from environment
+testsuccess aptget install testpkg-one -y -o DPkg::Path=""
+cp rootdir/tmp/testsuccess.output apt.log
+testsuccess grep "PATH=$PATH" apt.log
+
+# Set a custom value
+testsuccess aptget install testpkg-two -y -o DPkg::Path="foobar:$PATH"
+cp rootdir/tmp/testsuccess.output apt.log
+testsuccess grep "PATH=foobar:$PATH" apt.log