X-Git-Url: https://git.saurik.com/apt.git/blobdiff_plain/848fd2a65fa2aef296d44c9a19b89ac272ca12fe..8d1cb6da6e21302c654da3f09de3975af7e4a11f:/test/integration/test-apt-get-install-deb diff --git a/test/integration/test-apt-get-install-deb b/test/integration/test-apt-get-install-deb index 65951cede..1e9520fe6 100755 --- a/test/integration/test-apt-get-install-deb +++ b/test/integration/test-apt-get-install-deb @@ -1,32 +1,28 @@ #!/bin/sh set -e -TESTDIR=$(readlink -f $(dirname $0)) -. $TESTDIR/framework +TESTDIR="$(readlink -f "$(dirname "$0")")" +. "$TESTDIR/framework" setupenvironment configarchitecture 'amd64' 'i386' # regression test for #754904 -testfailureequal 'E: Unable to locate package /dev/null' aptget install -qq /dev/null +testfailureequal 'E: Unsupported file /dev/null given on commandline' aptget install -qq /dev/null # only consider .deb files cat > foo.rpm <> ./incoming/$PKG/DEBIAN/control + fi + echo "Package: $PKG +Version: 0 +Priority: extra +Maintainer: No Body +Architecture: all +Description: test package" >> ./incoming/$PKG/DEBIAN/control + if [ -n "$3" ]; then + echo -n "$3" >> ./incoming/$PKG/DEBIAN/control + fi + testsuccess dpkg-deb --build ./incoming/$PKG/ ./incoming + #dpkg-deb -I ./incoming/${PKG}_0_all.deb control +} +createpkg 'as-it-should-be' +createpkg 'leading-newline' ' + +' +createpkg 'trailing-newline' '' ' +' + +testsuccess aptget install ./incoming/pkg-as-it-should-be_0_all.deb +testsuccess aptget install ./incoming/pkg-leading-newline_0_all.deb +testsuccess aptget install ./incoming/pkg-trailing-newline_0_all.deb + +# see if permission dropping is checked before usage +if [ "$(id -u)" = '0' ]; then + apt clean + chmod 711 ./incoming + testsuccess aptget install -y --allow-downgrades ./incoming/pkg-as-it-should-be_0_all.deb + chmod 710 ./incoming + testsuccesswithnotice aptget install -y --allow-downgrades ./incoming/pkg-as-it-should-be_0_all.deb + chmod 700 ./incoming + testsuccesswithnotice aptget install -y --allow-downgrades ./incoming/pkg-as-it-should-be_0_all.deb +fi