summaryrefslogtreecommitdiff
path: root/test/integration
diff options
context:
space:
mode:
Diffstat (limited to 'test/integration')
-rw-r--r--test/integration/framework3
-rwxr-xr-xtest/integration/test-apt-config14
-rwxr-xr-xtest/integration/test-apt-get-autoremove15
-rwxr-xr-xtest/integration/test-apt-get-changelog5
-rwxr-xr-xtest/integration/test-apt-sources-deb8222
-rwxr-xr-xtest/integration/test-authentication-basic13
-rwxr-xr-xtest/integration/test-dpkg-path35
-rwxr-xr-xtest/integration/test-pdiff-usage8
8 files changed, 92 insertions, 3 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-apt-config b/test/integration/test-apt-config
index f2068b789..12df63de1 100755
--- a/test/integration/test-apt-config
+++ b/test/integration/test-apt-config
@@ -34,3 +34,17 @@ testsuccessequal 'nodoc
stage1' aptconfig dump --no-empty --format='%v%n' APT::Build-Profiles
unset DEB_BUILD_PROFILES
testempty aptconfig dump --no-empty --format='%v%n' APT::Build-Profiles
+
+cat > spaces.conf <<EOF
+Spaces::Test::"Foo Bar" "1 1";
+Spaces::Test2::" Bar Baz " "B B" {
+ A%20B "C C";
+ "B C" "A A";
+};
+EOF
+testsuccessequal 'Spaces::Test "";
+Spaces::Test::Foo%20Bar "1 1";
+Spaces::Test2 "";
+Spaces::Test2::%20Bar%20Baz%20 "B B";
+Spaces::Test2::%20Bar%20Baz%20::A%20B "C C";
+Spaces::Test2::%20Bar%20Baz%20::B%20C "A A";' aptconfig dump -c spaces.conf Spaces::Test Spaces::Test2
diff --git a/test/integration/test-apt-get-autoremove b/test/integration/test-apt-get-autoremove
index 4dba4f164..5546958a0 100755
--- a/test/integration/test-apt-get-autoremove
+++ b/test/integration/test-apt-get-autoremove
@@ -219,5 +219,20 @@ Remv foo-multi2-2 [1]
Remv foo-plus-1 [1]
Remv foo-plus-2 [1]' apt autoremove -s
+
+testsuccessequal 'Reading package lists...
+Building dependency tree...
+Reading state information...
+The following packages will be REMOVED:
+ foo-multi1-1* foo-multi1-2* foo-multi2-1* foo-multi2-2* foo-plus-1*
+ foo-plus-2*
+0 upgraded, 0 newly installed, 6 to remove and 0 not upgraded.
+Purg foo-multi1-1 [1]
+Purg foo-multi1-2 [1]
+Purg foo-multi2-1 [1]
+Purg foo-multi2-2 [1]
+Purg foo-plus-1 [1]
+Purg foo-plus-2 [1]' apt autopurge -s
+
testdpkgstatus 'pi' '1' 'unrelated'
testsuccess apt purge unrelated -y
diff --git a/test/integration/test-apt-get-changelog b/test/integration/test-apt-get-changelog
index 15c3dd50f..9ac9b063a 100755
--- a/test/integration/test-apt-get-changelog
+++ b/test/integration/test-apt-get-changelog
@@ -132,3 +132,8 @@ testfilestats 'dpkg.changelog' '%U:%G:%a' '=' "${TEST_DEFAULT_USER}:${TEST_DEFAU
head -n 3 dpkg.changelog > dpkg.change
testfileequal 'dpkg.change' "$(apthelper cat-file 'rootdir/usr/share/doc/dpkg/changelog' | head -n 3)"
rm -f dpkg.change dpkg.changelog
+
+# no package specified
+testfailureequal 'E: No packages found' aptget changelog
+testfailureequal 'E: Unable to locate package clclclclc
+E: No packages found' aptget changelog clclclclc
diff --git a/test/integration/test-apt-sources-deb822 b/test/integration/test-apt-sources-deb822
index e2cf4d980..fdf26fe97 100755
--- a/test/integration/test-apt-sources-deb822
+++ b/test/integration/test-apt-sources-deb822
@@ -19,7 +19,7 @@ Types: deb
URIs: http://ftp.debian.org/debian
Suites: stable
Components: main
-Description: summay
+Description: summary
# comments are ignored
and the long part'
diff --git a/test/integration/test-authentication-basic b/test/integration/test-authentication-basic
index 011f205af..211c73e35 100755
--- a/test/integration/test-authentication-basic
+++ b/test/integration/test-authentication-basic
@@ -53,7 +53,8 @@ Conf foo (1 unstable [all])' aptget install foo -s
}
authfile() {
- local AUTHCONF='rootdir/etc/apt/auth.conf'
+ local AUTHCONF="${2:-rootdir/etc/apt/auth.conf}"
+ mkdir -p "$(dirname "$AUTHCONF")"
rm -f "$AUTHCONF"
printf '%s' "$1" > "$AUTHCONF"
chmod 600 "$AUTHCONF"
@@ -85,6 +86,16 @@ machine localhost
login star@irc
password hunter2'
testauthsuccess "$1"
+
+ # delete file, make sure it fails; add auth.conf.d snippet, works again.
+ rm rootdir/etc/apt/auth.conf
+ testauthfailure "$1"
+
+ authfile 'machine localhost
+login star@irc
+password hunter2' rootdir/etc/apt/auth.conf.d/myauth.conf
+ testauthsuccess "$1"
+ rm rootdir/etc/apt/auth.conf.d/myauth.conf
}
msgmsg 'server basic auth'
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
diff --git a/test/integration/test-pdiff-usage b/test/integration/test-pdiff-usage
index 7cda2ee45..c5726dd08 100755
--- a/test/integration/test-pdiff-usage
+++ b/test/integration/test-pdiff-usage
@@ -251,7 +251,13 @@ SHA256-Download:
cp Packages-future aptarchive/Packages
rm -f rootdir/var/lib/apt/lists/*_Contents-*
webserverconfig 'aptwebserver::overwrite::.*Contents-.*::filename' '/hacked-i386.gz'
- testfailure apt update "$@"
+ # This should work in at least 4% of the cases...
+ for i in $(seq 25); do
+ testfailure apt update "$@"
+ if ! grep 'rred:600' rootdir/tmp/testfailure.output; then
+ break
+ fi
+ done
webserverconfig 'aptwebserver::overwrite::.*Contents-.*::filename' '/Contents-i386.gz'
cp rootdir/tmp/testfailure.output patchdownload.output
testfailure grep 'rred:600' patchdownload.output