diff options
author | Julian Andres Klode <julian.klode@canonical.com> | 2018-12-10 16:52:59 +0100 |
---|---|---|
committer | Julian Andres Klode <julian.klode@canonical.com> | 2018-12-10 17:31:24 +0100 |
commit | 806e94dcd8dbdf7bf1909657fd4331cfe17b4ab0 (patch) | |
tree | 6c0795c08971f80cd532dd66416b96215d2ae482 /test/integration/test-dpkg-path | |
parent | 37bdbe03d44975951d2518bb9b3d3636081dca6a (diff) |
Set PATH=/usr/sbin:/usr/bin:/sbin:/bin when running dpkg
This avoids a lot of problems from local installations of
scripting languages and other stuff in /usr/local for which
maintainer scripts are not prepared.
[v3: Inherit PATH during tests, check overrides work]
[v2: Add testing]
Diffstat (limited to 'test/integration/test-dpkg-path')
-rwxr-xr-x | test/integration/test-dpkg-path | 35 |
1 files changed, 35 insertions, 0 deletions
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 |