diff options
Diffstat (limited to 'test')
19 files changed, 391 insertions, 78 deletions
diff --git a/test/integration/framework b/test/integration/framework index cfd621105..b0456096c 100644 --- a/test/integration/framework +++ b/test/integration/framework @@ -475,8 +475,11 @@ EOF # prefer our apt binaries over the system apt binaries export PATH="${BUILDDIRECTORY}:${PATH}:/usr/local/sbin:/usr/sbin:/sbin" export LC_ALL=C - unset LANGUAGE APT_CONFIG - unset GREP_OPTIONS DEB_BUILD_PROFILES + unset LANGUAGE COLUMNS NLSPATH + unset APT_CONFIG DPKG_ADMINDIR DPKG_COLORS + unset DEB_CHECK_COMMAND DEB_SIGN_KEYID DEB_BUILD_OPTIONS DEB_BUILD_PROFILES + unset DH_VERBOSE DH_QUIET DH_COMPAT DH_NO_ACT DH_OPTIONS DH_EXTRA_ADDONS + unset GREP_OPTIONS POSIXLY_CORRECT unset http_proxy HTTP_PROXY https_proxy HTTPS_PROXY no_proxy # Make gcov shut up diff --git a/test/integration/test-apt-acquire-additional-files b/test/integration/test-apt-acquire-additional-files index ff04b6346..928c703e1 100755 --- a/test/integration/test-apt-acquire-additional-files +++ b/test/integration/test-apt-acquire-additional-files @@ -214,9 +214,12 @@ testequal "$(readfile Contents-all)" aptget indextargets --format '$(FILENAME)' testsuccess cmp "rootdir/var/lib/apt/lists/localhost:${APTHTTPPORT}_dists_unstable_main_Contents-all" 'aptarchive/dists/unstable/main/Contents-all' rm ./rootdir/var/lib/apt/lists/localhost:${APTHTTPPORT}_dists_unstable_main_Contents-all -rm -f rootdir/etc/apt/apt.conf.d/content-target.conf msgmsg "No Contents file" - +cat > rootdir/etc/apt/apt.conf.d/content-target-notdefault.conf <<EOF +Acquire::IndexTargets::deb::Contents::DefaultEnabled "no"; +Acquire::IndexTargets::deb::Contents2::DefaultEnabled "no"; +Acquire::IndexTargets::deb::Contents3::DefaultEnabled "no"; +EOF testequal "'http://localhost:${APTHTTPPORT}/dists/unstable/InRelease' localhost:${APTHTTPPORT}_dists_unstable_InRelease 0 'http://localhost:${APTHTTPPORT}/dists/unstable/main/source/Sources.xz' localhost:${APTHTTPPORT}_dists_unstable_main_source_Sources 0 'http://localhost:${APTHTTPPORT}/dists/unstable/main/binary-amd64/Packages.xz' localhost:${APTHTTPPORT}_dists_unstable_main_binary-amd64_Packages 0 @@ -227,3 +230,17 @@ testsuccessequal "Hit:1 http://localhost:${APTHTTPPORT} unstable InRelease Reading package lists..." aptget update testempty find rootdir/var/lib/apt/lists -name '*Contents*' + +msgmsg "Order of Contents files" +sameupdateoutput() { + testsuccessequal "'http://localhost:${APTHTTPPORT}/dists/unstable/InRelease' localhost:${APTHTTPPORT}_dists_unstable_InRelease 0 +'http://localhost:${APTHTTPPORT}/dists/unstable/main/Contents-i386.xz' localhost:${APTHTTPPORT}_dists_unstable_main_Contents-i386 0 " aptget update --print-uris +} +sed -i -e 's#deb\(-src\)\? http#deb\1 [target=Contents3,Contents2,Contents] http#' rootdir/etc/apt/sources.list.d/* +sameupdateoutput +sed -i -e 's#deb\(-src\)\? \[target=[^]]\+\] http#deb\1 [target=Contents2,Contents3,Contents] http#' rootdir/etc/apt/sources.list.d/* +sameupdateoutput +sed -i -e 's#deb\(-src\)\? \[target=[^]]\+\] http#deb\1 [target=Contents3,Contents,Contents2] http#' rootdir/etc/apt/sources.list.d/* +sameupdateoutput +sed -i -e 's#deb\(-src\)\? \[target=[^]]\+\] http#deb\1 [target=Contents,Contents3,Contents2] http#' rootdir/etc/apt/sources.list.d/* +sameupdateoutput diff --git a/test/integration/test-apt-cli-list b/test/integration/test-apt-cli-list index f87208a08..3a9ca2c15 100755 --- a/test/integration/test-apt-cli-list +++ b/test/integration/test-apt-cli-list @@ -5,7 +5,7 @@ TESTDIR="$(readlink -f "$(dirname "$0")")" . "$TESTDIR/framework" setupenvironment -configarchitecture "i386" +configarchitecture 'i386' 'armel' insertpackage 'unstable' 'foo' 'all' '1.0' insertinstalledpackage 'bar' 'i386' '1.0' @@ -17,6 +17,10 @@ insertinstalledpackage 'baz' 'all' '0.1' insertpackage 'testing' 'baz' 'all' '1.0' insertpackage 'unstable' 'baz' 'all' '2.0' +insertinstalledpackage 'foreign' 'armel' '1.0' 'Multi-Arch: foreign' +insertpackage 'unstable' 'foreign' 'i386,armel' '2.0' 'Multi-Arch: foreign' +insertpackage 'unstable' 'lib' 'i386,armel' '2.0' 'Multi-Arch: same' + setupaptarchive testsuccessequal "Listing... @@ -24,7 +28,11 @@ bar/now 1.0 i386 [installed,local] baz/unstable 2.0 all [upgradable from: 0.1] dpkg/now 1.16.2+fake all [installed,local] foo/unstable 1.0 all -foobar/unstable 2.0 i386 [upgradable from: 1.0]" apt list +foobar/unstable 2.0 i386 [upgradable from: 1.0] +foreign/unstable 2.0 armel [upgradable from: 1.0] +foreign/unstable 2.0 i386 +lib/unstable 2.0 armel +lib/unstable 2.0 i386" apt list testsuccessequal "Listing... foo/unstable 1.0 all @@ -32,15 +40,17 @@ foobar/unstable 2.0 i386 [upgradable from: 1.0]" apt list "foo*" testsuccessequal "Listing... baz/unstable 2.0 all [upgradable from: 0.1] -foobar/unstable 2.0 i386 [upgradable from: 1.0]" apt list --upgradable +foobar/unstable 2.0 i386 [upgradable from: 1.0] +foreign/unstable 2.0 armel [upgradable from: 1.0]" apt list --upgradable # FIXME: hm, hm - does it make sense to have this different? shouldn't -# we use "installed,upgradable" consitently? +# we use "installed,upgradable" consistently? testsuccessequal "Listing... bar/now 1.0 i386 [installed,local] baz/now 0.1 all [installed,upgradable to: 2.0] dpkg/now 1.16.2+fake all [installed,local] -foobar/now 1.0 i386 [installed,upgradable to: 2.0]" apt list --installed +foobar/now 1.0 i386 [installed,upgradable to: 2.0] +foreign/now 1.0 armel [installed,upgradable to: 2.0]" apt list --installed testsuccessequal "Listing... bar/now 1.0 i386 [installed,local] @@ -72,3 +82,12 @@ baz/now 0.1 all [installed,upgradable to: 2.0] # test format strings for machine parseable output testsuccessequal 'bar - 1.0 - 1.0 baz - 0.1 - 2.0' apt list -qq bar baz -o APT::Cmd::use-format=true -o APT::Cmd::format="\${Package} - \${installed:Version} - \${candidate:Version}" + + +insertinstalledpackage 'lib' 'i386,armel' '1.0' 'Multi-Arch: same' +testsuccessequal 'Listing... +baz/unstable 2.0 all [upgradable from: 0.1] +foobar/unstable 2.0 i386 [upgradable from: 1.0] +foreign/unstable 2.0 armel [upgradable from: 1.0] +lib/unstable 2.0 armel [upgradable from: 1.0] +lib/unstable 2.0 i386 [upgradable from: 1.0]' apt list --upgradeable diff --git a/test/integration/test-apt-cli-show b/test/integration/test-apt-cli-show index 935d93d86..a37dbd8e6 100755 --- a/test/integration/test-apt-cli-show +++ b/test/integration/test-apt-cli-show @@ -7,11 +7,19 @@ TESTDIR="$(readlink -f "$(dirname "$0")")" setupenvironment configarchitecture 'i386' 'amd64' +generatelotsofnames() { + for i in $(seq 0 10000); do + printf ', this-is-a-long-pkg-name-%s (= 0.a.long.version)' "$i" + done +} + DESCR='Some description That has multiple lines' insertpackage 'unstable' 'foo' 'all' '1.0' '' '' "$DESCR" insertpackage 'unstable' 'bar' 'i386,amd64' '1' '' '' "$DESCR" insertpackage 'unstable' 'big' 'i386,amd64' '1' 'Installed-Size: 4129421' '' "$DESCR" +insertpackage 'unstable' 'large' 'all' '1' "Provides: pkga$(generatelotsofnames)" '' "$DESCR" +insertpackage 'unstable' 'large2' 'all' '1' "Provides: foobar, pkga$(generatelotsofnames)" '' "$DESCR" insertinstalledpackage 'foo' 'all' '1.0' setupaptarchive @@ -66,6 +74,31 @@ Description: Some description That has multiple lines " apt show big:amd64 +testsuccessequal "Package: large +Version: 1 +Priority: optional +Section: other +Maintainer: Joe Sixpack <joe@example.org> +Installed-Size: 43.0 kB +Provides: pkga$(generatelotsofnames) +Download-Size: unknown +APT-Sources: file:$APTARCHIVE unstable/main all Packages +Description: Some description + That has multiple lines +" apt show large +testsuccessequal "Package: large2 +Version: 1 +Priority: optional +Section: other +Maintainer: Joe Sixpack <joe@example.org> +Installed-Size: 43.0 kB +Provides: foobar, pkga$(generatelotsofnames) +Download-Size: unknown +APT-Sources: file:$APTARCHIVE unstable/main all Packages +Description: Some description + That has multiple lines +" apt show large2 + # this is the default, but disabled by the testcases testsuccess apt show foo -o Apt::Cmd::Disable-Script-Warning=0 cp rootdir/tmp/testsuccess.output aptshow.output diff --git a/test/integration/test-apt-get-changelog b/test/integration/test-apt-get-changelog index 2a632d6db..15c3dd50f 100755 --- a/test/integration/test-apt-get-changelog +++ b/test/integration/test-apt-get-changelog @@ -18,8 +18,8 @@ setupaptarchive --no-update changetowebserver testsuccess aptget update -testsuccessequal "'http://metadata.ftp-master.debian.org/changelogs/main/f/foo/foo_1.0_changelog' foo.changelog -'http://metadata.ftp-master.debian.org/changelogs/main/libb/libbar/libbar_1.0_changelog' libbar.changelog" aptget changelog foo libbar --print-uris +testsuccessequal "'https://metadata.ftp-master.debian.org/changelogs/main/f/foo/foo_1.0_changelog' foo.changelog +'https://metadata.ftp-master.debian.org/changelogs/main/libb/libbar/libbar_1.0_changelog' libbar.changelog" aptget changelog foo libbar --print-uris releasechanger() { # modifying the Release files in lists… bad stuff. Good that this is only a test… diff --git a/test/integration/test-apt-key b/test/integration/test-apt-key index 1e2c8362b..d690a9026 100755 --- a/test/integration/test-apt-key +++ b/test/integration/test-apt-key @@ -192,7 +192,7 @@ gpg: unchanged: 1' aptkey --fakeroot update ${TESTSTATE} aptkey --fakeroot add "${KEYDIR}/marvin paránöid.pub.${EXT}" testaptkeys 'Joe Sixpack' 'Marvin Paranoid' cp -a "${ROOTDIR}/etc/apt/trusted.gpg" "${KEYDIR}/testcase-multikey.pub.gpg" # store for reuse - gpg --no-default-keyring --keyring "${KEYDIR}/testcase-multikey.pub.gpg" --armor --export > "${KEYDIR}/testcase-multikey.pub.asc" + aptkey --keyring "${KEYDIR}/testcase-multikey.pub.gpg" export > "${KEYDIR}/testcase-multikey.pub.asc" msgtest 'Test key removal with' 'multi key in real file' cleanplate diff --git a/test/integration/test-apt-progress-fd b/test/integration/test-apt-progress-fd index 57728ca81..4c19a7b00 100755 --- a/test/integration/test-apt-progress-fd +++ b/test/integration/test-apt-progress-fd @@ -10,7 +10,7 @@ configarchitecture 'amd64' 'i386' buildsimplenativepackage 'testing' 'amd64' '0.1' 'stable' buildsimplenativepackage 'testing' 'amd64' '0.8.15' 'stable' buildsimplenativepackage 'testing2' 'amd64,i386' '0.8.15' 'stable' -setupaptarchive +setupaptarchive # install native exec 3> apt-progress.log @@ -18,14 +18,13 @@ testsuccess aptget install testing=0.1 -y -o APT::Status-Fd=3 testfileequal './apt-progress.log' 'dlstatus:1:0.0000:Retrieving file 1 of 1 dlstatus:1:100.0000:Retrieving file 1 of 1 pmstatus:dpkg-exec:0.0000:Running dpkg -pmstatus:testing:0.0000:Installing testing (amd64) -pmstatus:testing:16.6667:Preparing testing (amd64) -pmstatus:testing:33.3333:Unpacking testing (amd64) -pmstatus:testing:50.0000:Preparing to configure testing (amd64) -pmstatus:dpkg-exec:50.0000:Running dpkg -pmstatus:testing:50.0000:Configuring testing (amd64) -pmstatus:testing:66.6667:Configuring testing (amd64) -pmstatus:testing:83.3333:Installed testing (amd64)' +pmstatus:testing:0.0000:Preparing testing (amd64) +pmstatus:testing:20.0000:Unpacking testing (amd64) +pmstatus:testing:40.0000:Installing testing (amd64) +pmstatus:dpkg-exec:40.0000:Running dpkg +pmstatus:testing:40.0000:Preparing to configure testing (amd64) +pmstatus:testing:60.0000:Configuring testing (amd64) +pmstatus:testing:80.0000:Installed testing (amd64)' # upgrade exec 3> apt-progress.log @@ -33,14 +32,13 @@ testsuccess aptget install testing=0.8.15 -y -o APT::Status-Fd=3 testfileequal './apt-progress.log' 'dlstatus:1:0.0000:Retrieving file 1 of 1 dlstatus:1:100.0000:Retrieving file 1 of 1 pmstatus:dpkg-exec:0.0000:Running dpkg -pmstatus:testing:0.0000:Installing testing (amd64) -pmstatus:testing:16.6667:Preparing testing (amd64) -pmstatus:testing:33.3333:Unpacking testing (amd64) -pmstatus:testing:50.0000:Preparing to configure testing (amd64) -pmstatus:dpkg-exec:50.0000:Running dpkg -pmstatus:testing:50.0000:Configuring testing (amd64) -pmstatus:testing:66.6667:Configuring testing (amd64) -pmstatus:testing:83.3333:Installed testing (amd64)' +pmstatus:testing:0.0000:Preparing testing (amd64) +pmstatus:testing:20.0000:Unpacking testing (amd64) +pmstatus:testing:40.0000:Installing testing (amd64) +pmstatus:dpkg-exec:40.0000:Running dpkg +pmstatus:testing:40.0000:Preparing to configure testing (amd64) +pmstatus:testing:60.0000:Configuring testing (amd64) +pmstatus:testing:80.0000:Installed testing (amd64)' # reinstall exec 3> apt-progress.log @@ -48,24 +46,22 @@ testsuccess aptget install testing=0.8.15 --reinstall -y -o APT::Status-Fd=3 testfileequal './apt-progress.log' 'dlstatus:1:0.0000:Retrieving file 1 of 1 dlstatus:1:100.0000:Retrieving file 1 of 1 pmstatus:dpkg-exec:0.0000:Running dpkg -pmstatus:testing:0.0000:Installing testing (amd64) -pmstatus:testing:16.6667:Preparing testing (amd64) -pmstatus:testing:33.3333:Unpacking testing (amd64) -pmstatus:testing:50.0000:Preparing to configure testing (amd64) -pmstatus:dpkg-exec:50.0000:Running dpkg -pmstatus:testing:50.0000:Configuring testing (amd64) -pmstatus:testing:66.6667:Configuring testing (amd64) -pmstatus:testing:83.3333:Installed testing (amd64)' +pmstatus:testing:0.0000:Preparing testing (amd64) +pmstatus:testing:20.0000:Unpacking testing (amd64) +pmstatus:testing:40.0000:Installing testing (amd64) +pmstatus:dpkg-exec:40.0000:Running dpkg +pmstatus:testing:40.0000:Preparing to configure testing (amd64) +pmstatus:testing:60.0000:Configuring testing (amd64) +pmstatus:testing:80.0000:Installed testing (amd64)' # and remove exec 3> apt-progress.log testsuccess aptget remove testing -y -o APT::Status-Fd=3 testfileequal './apt-progress.log' 'pmstatus:dpkg-exec:0.0000:Running dpkg -pmstatus:testing:0.0000:Removing testing (amd64) -pmstatus:testing:25.0000:Preparing for removal of testing (amd64) -pmstatus:testing:50.0000:Removing testing (amd64) -pmstatus:testing:75.0000:Removed testing (amd64) -pmstatus:dpkg-exec:75.0000:Running dpkg' +pmstatus:testing:0.0000:Preparing for removal of testing (amd64) +pmstatus:testing:33.3333:Removing testing (amd64) +pmstatus:testing:66.6667:Removing testing (amd64) +pmstatus:dpkg-exec:66.6667:Running dpkg' # install non-native and ensure we get proper progress info exec 3> apt-progress.log @@ -73,13 +69,12 @@ testsuccess aptget install testing2:i386 -y -o APT::Status-Fd=3 testfileequal './apt-progress.log' 'dlstatus:1:0.0000:Retrieving file 1 of 1 dlstatus:1:100.0000:Retrieving file 1 of 1 pmstatus:dpkg-exec:0.0000:Running dpkg -pmstatus:testing2:0.0000:Installing testing2 (i386) -pmstatus:testing2:16.6667:Preparing testing2 (i386) -pmstatus:testing2:33.3333:Unpacking testing2 (i386) -pmstatus:testing2:50.0000:Preparing to configure testing2 (i386) -pmstatus:dpkg-exec:50.0000:Running dpkg -pmstatus:testing2:50.0000:Configuring testing2 (i386) -pmstatus:testing2:66.6667:Configuring testing2 (i386) -pmstatus:testing2:83.3333:Installed testing2 (i386)' +pmstatus:testing2:0.0000:Preparing testing2 (i386) +pmstatus:testing2:20.0000:Unpacking testing2 (i386) +pmstatus:testing2:40.0000:Installing testing2 (i386) +pmstatus:dpkg-exec:40.0000:Running dpkg +pmstatus:testing2:40.0000:Preparing to configure testing2 (i386) +pmstatus:testing2:60.0000:Configuring testing2 (i386) +pmstatus:testing2:80.0000:Installed testing2 (i386)' rm -f apt-progress*.log diff --git a/test/integration/test-apt-progress-fd-deb822 b/test/integration/test-apt-progress-fd-deb822 index d9a4505d1..dd66e28a9 100755 --- a/test/integration/test-apt-progress-fd-deb822 +++ b/test/integration/test-apt-progress-fd-deb822 @@ -10,7 +10,7 @@ configarchitecture 'amd64' 'i386' buildsimplenativepackage 'testing' 'amd64' '0.1' 'stable' buildsimplenativepackage 'testing' 'all' '0.8.15' 'stable' buildsimplenativepackage 'testing2' 'amd64,i386' '0.8.15' 'stable' -setupaptarchive +setupaptarchive # install native exec 3> apt-progress.log @@ -23,40 +23,35 @@ Message: Running dpkg Status: progress Package: testing:amd64 Percent: 0.0000 -Message: Installing testing (amd64) - -Status: progress -Package: testing:amd64 -Percent: 16.6667 Message: Preparing testing (amd64) Status: progress Package: testing:amd64 -Percent: 33.3333 +Percent: 20.0000 Message: Unpacking testing (amd64) Status: progress Package: testing:amd64 -Percent: 50.0000 -Message: Preparing to configure testing (amd64) +Percent: 40.0000 +Message: Installing testing (amd64) Status: progress -Percent: 50.0000 +Percent: 40.0000 Message: Running dpkg Status: progress Package: testing:amd64 -Percent: 50.0000 -Message: Configuring testing (amd64) +Percent: 40.0000 +Message: Preparing to configure testing (amd64) Status: progress Package: testing:amd64 -Percent: 66.6667 +Percent: 60.0000 Message: Configuring testing (amd64) Status: progress Package: testing:amd64 -Percent: 83.3333 +Percent: 80.0000 Message: Installed testing (amd64) ' diff --git a/test/integration/test-apt-progress-fd-error b/test/integration/test-apt-progress-fd-error index 4439c042a..39c1053a1 100755 --- a/test/integration/test-apt-progress-fd-error +++ b/test/integration/test-apt-progress-fd-error @@ -18,8 +18,8 @@ setupaptarchive exec 3> apt-progress.log testfailure aptget install foo1 foo2 -y -o APT::Status-Fd=3 -msgtest 'Ensure correct error message' -testsuccess --nomsg grep "foo2_0.8.15_[^.]\+.deb:36.3636:trying to overwrite '/usr/bin/file-conflict', which is also in package foo1 0.8.15" apt-progress.log +msgtest 'Ensure correct error message' 'file-conflict' +testsuccess --nomsg grep "foo2_0.8.15_[^.]\+.deb:[0-9.]\+:trying to overwrite '/usr/bin/file-conflict', which is also in package foo1 0.8.15" apt-progress.log testsuccess test -s rootdir/var/crash/foo2.0.crash testsuccess grep '^Package: foo2 0.8.15$' rootdir/var/crash/foo2.0.crash diff --git a/test/integration/test-bug-624218-Translation-file-handling b/test/integration/test-bug-624218-Translation-file-handling index b629dd665..c116278ee 100755 --- a/test/integration/test-bug-624218-Translation-file-handling +++ b/test/integration/test-bug-624218-Translation-file-handling @@ -6,24 +6,78 @@ TESTDIR="$(readlink -f "$(dirname "$0")")" setupenvironment configarchitecture 'i386' -buildsimplenativepackage 'coolstuff' 'all' '1.0' 'unstable' +insertpackage 'unstable' 'unrelated' 'i386' '1' +insertpackage 'unstable' 'ancientstuff' 'all' '1' +insertpackage 'unstable' 'boringstuff' 'all' '1' '' '' 'shared short description' +insertpackage 'unstable' 'coolstuff' 'all' '1' +insertpackage 'unstable' 'dullstuff' 'all' '1' '' '' 'shared short description' +insertpackage 'unstable' 'evilstuff' 'all' '1' +insertpackage 'unstable' 'foostuff' 'all' '1' '' '' 'shared short description' +insertpackage 'unstable' 'goodstuff' 'all' '1' +insertpackage 'unstable' "longdesc" 'all' '1' '' '' "$(for i in $(seq 0 100); do printf '%s' 'lorem ipsum '; done)" setupaptarchive --no-update - changetowebserver + +testsuccess aptget update +PKGORDER='coolstuff foostuff coolstuff foostuff' +msgtest 'Prepare expectation for' 'aptcache show' +if aptcache show $PKGORDER | grep -v '^ ' > aptcacheshow.out 2>&1; then + msgpass +else + cat aptcacheshow.out || true + msgfail +fi +testsuccessequal '4' grep -c '^Package: ' aptcacheshow.out +msgtest 'Prepare expectation for' 'apt show' +if apt show $PKGORDER | grep -v -e '^ ' -e '^[A-Z][a-z]\+-Size: ' > aptshow.out 2>&1; then + msgpass +else + cat aptshow.out || true + msgfail +fi +testsuccessequal '4' grep -c '^Package: ' aptshow.out rm -rf rootdir/var/lib/apt/lists +checkaptshow() { + testsuccess aptcache show $PKGORDER + sed -i -e 's#^Description: #Description-en: #' rootdir/tmp/testsuccess.output + testequal "$(cat aptcacheshow.out) +" grep -v '^ ' rootdir/tmp/testsuccess.output + + testsuccess apt show $PKGORDER + sed -i -e 's#^Description-en: #Description: #' rootdir/tmp/testsuccess.output + testequal "$(cat aptshow.out) +" grep -v -e '^ ' -e '^[A-Z][a-z]\+-Size: ' rootdir/tmp/testsuccess.output + + if [ -n "$(ls rootdir/var/lib/apt/lists/*Translation* 2>/dev/null)" ]; then + testsuccess find rootdir/var/lib/apt/lists/ -name '*Translation*' -delete + + testsuccess aptcache show $PKGORDER + sed -i -e 's#^Description: #Description-en: #' rootdir/tmp/testsuccess.output + testequal "$(cat aptcacheshow.out) +" grep -v '^ ' rootdir/tmp/testsuccess.output + + testsuccess apt show $PKGORDER + sed -i -e 's#^Description-en: #Description: #' rootdir/tmp/testsuccess.output + testequal "$(cat aptshow.out) +" grep -v -e '^ ' -e '^[A-Z][a-z]\+-Size: ' rootdir/tmp/testsuccess.output + fi +} + translationslisted() { msgtest 'No download of non-existent locals' "$1" export LC_ALL="" testsuccess --nomsg aptget update -o Acquire::Languages=en testfailure grep -q -e 'Translation-[^e][^n] ' rootdir/tmp/testsuccess.output + checkaptshow rm -rf rootdir/var/lib/apt/lists msgtest 'Download of existent locals' "$1" testsuccess --nomsg aptget update cp rootdir/tmp/testsuccess.output testsuccess.output testsuccess grep -q -e 'Translation-en ' testsuccess.output + checkaptshow rm -rf rootdir/var/lib/apt/lists msgtest 'Download of en in LC_ALL=C' "$1" @@ -31,6 +85,7 @@ translationslisted() { testsuccess --nomsg aptget update cp rootdir/tmp/testsuccess.output testsuccess.output testsuccess grep -q -e 'Translation-en ' testsuccess.output + checkaptshow rm -rf rootdir/var/lib/apt/lists unset LC_ALL @@ -38,21 +93,25 @@ translationslisted() { testsuccess --nomsg aptget update -o Acquire::Languages=en cp rootdir/tmp/testsuccess.output testsuccess.output testsuccess grep -q -e 'Translation-en ' testsuccess.output + checkaptshow rm -rf rootdir/var/lib/apt/lists msgtest 'Download of nothing else in forced language' "$1" testsuccess --nomsg aptget update -o Acquire::Languages=en testfailure grep -q -e 'Translation-[^e][^n] ' rootdir/tmp/testsuccess.output + checkaptshow rm -rf rootdir/var/lib/apt/lists msgtest 'Download no Translation- if forced language is non-existent' "$1" testsuccess --nomsg aptget update -o Acquire::Languages=ast_DE testfailure grep -q -e 'Translation-' rootdir/tmp/testsuccess.output + checkaptshow rm -rf rootdir/var/lib/apt/lists msgtest 'Download of nothing if none is forced' "$1" testsuccess --nomsg aptget update -o Acquire::Languages=none testfailure grep -q -e 'Translation' rootdir/tmp/testsuccess.output + checkaptshow rm -rf rootdir/var/lib/apt/lists } @@ -66,26 +125,31 @@ echo 'Acquire::AllowInsecureRepositories "true";' > rootdir/etc/apt/apt.conf.d/ msgtest 'Download of en as forced language' 'without Index' testwarning --nomsg aptget update -o Acquire::Languages=en testsuccess grep -q -e 'Translation-en ' rootdir/tmp/testwarning.output +checkaptshow rm -rf rootdir/var/lib/apt/lists msgtest 'Download of nothing else in forced language' 'without Index' testwarning --nomsg aptget update -o Acquire::Languages=en testfailure grep -q -e 'Translation-[^e][^n] ' rootdir/tmp/testwarning.output +checkaptshow rm -rf rootdir/var/lib/apt/lists msgtest 'Download of ast_DE as forced language' 'without Index' testwarning --nomsg aptget update -o Acquire::Languages=ast_DE testsuccess grep -q -e 'Translation-ast_DE$' rootdir/tmp/testwarning.output +checkaptshow rm -rf rootdir/var/lib/apt/lists msgtest 'Download of nothing else in forced language' 'without Index' testwarning --nomsg aptget update -o Acquire::Languages=ast_DE testfailure grep -q -e 'Translation-[^a][^s]' rootdir/tmp/testwarning.output +checkaptshow rm -rf rootdir/var/lib/apt/lists msgtest 'Download of nothing if none is forced' 'without Index' testwarning --nomsg aptget update -o Acquire::Languages=none testfailure grep -q -e 'Translation' rootdir/tmp/testwarning.output +checkaptshow rm -rf rootdir/var/lib/apt/lists mkdir -p rootdir/var/lib/apt/lists @@ -94,6 +158,7 @@ touch rootdir/var/lib/apt/lists/localhost:${APTHTTPPORT}_dists_unstable_main_i18 msgtest 'Download of builtin files' 'without Index' testwarning --nomsg aptget update testsuccess grep -q -e 'Translation-ast_DE' rootdir/tmp/testwarning.output +checkaptshow rm -rf rootdir/var/lib/apt/lists mkdir -p rootdir/var/lib/apt/lists @@ -102,4 +167,5 @@ touch rootdir/var/lib/apt/lists/localhost:${APTHTTPPORT}_dists_unstable_main_i18 msgtest 'Download of nothing (even builtin) if none is forced' 'without Index' testwarning --nomsg aptget update -o Acquire::Languages=none testfailure grep -q -e 'Translation' rootdir/tmp/testwarning.output +checkaptshow rm -rf rootdir/var/lib/apt/lists diff --git a/test/integration/test-bug-722207-print-uris-even-if-very-quiet b/test/integration/test-bug-722207-print-uris-even-if-very-quiet index 82c1d715f..8d17507cb 100755 --- a/test/integration/test-bug-722207-print-uris-even-if-very-quiet +++ b/test/integration/test-bug-722207-print-uris-even-if-very-quiet @@ -23,7 +23,7 @@ testsuccessequal "'file://${APTARCHIVE}/pool/main/apt/apt_2_all.deb' apt_2_all.d testsuccessequal "'file://${APTARCHIVE}/pool/main/apt/apt_2_all.deb' apt_2_all.deb 0 SHA256:0000000000000000000000000000000000000000000000000000000000000000" aptget download apt -qq --print-uris testsuccessequal "'file://${APTARCHIVE}/apt_2.dsc' apt_2.dsc 9 SHA256:7776436a6d741497f1cd958014e1a05b352224231428152aae39da3c17fd2fd4 'file://${APTARCHIVE}/apt_2.tar.gz' apt_2.tar.gz 12 SHA256:f57f565eabe3fde0ec6e6e0bcc8db1d86fe2b4d6344a380a23520ddbb7728e99" aptget source apt -qq --print-uris -testsuccessequal "'http://metadata.ftp-master.debian.org/changelogs/main/a/apt/apt_2_changelog' apt.changelog" aptget changelog apt -qq --print-uris +testsuccessequal "'https://metadata.ftp-master.debian.org/changelogs/main/a/apt/apt_2_changelog' apt.changelog" aptget changelog apt -qq --print-uris testsuccessequal "'file://${APTARCHIVE}/apt_2.dsc' apt_2.dsc 9 SHA256:7776436a6d741497f1cd958014e1a05b352224231428152aae39da3c17fd2fd4 'file://${APTARCHIVE}/apt_2.tar.gz' apt_2.tar.gz 12 SHA256:f57f565eabe3fde0ec6e6e0bcc8db1d86fe2b4d6344a380a23520ddbb7728e99 diff --git a/test/integration/test-cve-2018-0501-mirror-alternatives b/test/integration/test-cve-2018-0501-mirror-alternatives new file mode 100755 index 000000000..f15454765 --- /dev/null +++ b/test/integration/test-cve-2018-0501-mirror-alternatives @@ -0,0 +1,31 @@ +#!/bin/sh +set -e +TESTDIR="$(readlink -f "$(dirname "$0")")" +. "$TESTDIR/framework" + +setupenvironment +configarchitecture "i386" + +buildsimplenativepackage 'foo' 'all' '1' 'stable' +setupaptarchive --no-update +changetohttpswebserver + +# User has mirror method configured in apt >= 1.6~alpha6 & +# Eve has enough MITM control over the network to +# a) have the mirror file include at least two mirrors and +# b) can send her bad InRelease files for both mirrors +sed -i -e 's# https:# mirror+https:#' -e 's#/ stable#/mirror.txt stable#' rootdir/etc/apt/sources.list.d/*-stable-* +echo "http://localhost:${APTHTTPPORT} +https://localhost:${APTHTTPSPORT}" > aptarchive/mirror.txt + +# real Eve would do something worse… +sed -i "/^Date: / a\ +Evil: yes" $(find ./aptarchive -name 'Release' -o -name 'InRelease') + +# progress display shows that the InRelease file was bad, +# but it is used anyhow as the bad file causes a fallback to +# a request to the second mirror which completes successful +# causing apt to believe the verify completed successfully… +testfailure apt update +testfailure grep '^Evil:' rootdir/var/lib/apt/lists/*Release +testfailure apt show foo diff --git a/test/integration/test-frontend-lock b/test/integration/test-frontend-lock new file mode 100755 index 000000000..939344afc --- /dev/null +++ b/test/integration/test-frontend-lock @@ -0,0 +1,80 @@ +#!/bin/sh +set -e + +TESTDIR="$(readlink -f "$(dirname "$0")")" +. "$TESTDIR/framework" + +setupenvironment +configarchitecture 'i386' + +insertinstalledpackage 'package1' 'i386' '1.0' +insertinstalledpackage 'package2' 'i386' '1.0' +insertinstalledpackage 'package3' 'i386' '1.0' +insertinstalledpackage 'package4' 'i386' '1.0' +insertinstalledpackage 'package5' 'i386' '1.0' +insertinstalledpackage 'package6' 'i386' '1.0' +buildsimplenativepackage 'foo' 'all' '1' + +setupaptarchive + +buildsimplenativepackage 'bar' 'all' '1' + + +# Checks that the correct variable is set +msgmsg 'Post-Invoke script has DPKG_FRONTEND_LOCKED set' +testsuccess aptget -q -y -o Dpkg::Post-Invoke::="echo DPKG_FRONTEND_LOCKED=\$DPKG_FRONTEND_LOCKED" remove package1 +cp rootdir/tmp/testsuccess.output install.output +testsuccess grep DPKG_FRONTEND_LOCKED=true install.output + +msgmsg 'Pre-Invoke script has DPKG_FRONTEND_LOCKED set' +testsuccess aptget -q -y -o Dpkg::Pre-Invoke::="echo DPKG_FRONTEND_LOCKED=\$DPKG_FRONTEND_LOCKED" remove package2 +cp rootdir/tmp/testsuccess.output install.output +testsuccess grep DPKG_FRONTEND_LOCKED=true install.output + +msgmsg 'Pre-Install-Pkgs script has DPKG_FRONTEND_LOCKED set' +testsuccess aptget -q -y -o DPkg::Pre-Install-Pkgs::="echo DPKG_FRONTEND_LOCKED=\$DPKG_FRONTEND_LOCKED" remove package3 +cp rootdir/tmp/testsuccess.output install.output +testsuccess grep DPKG_FRONTEND_LOCKED=true install.output + + +# Check that the frontend lock is hold by apt-get +msgmsg 'Post-Invoke script runs while frontend is locked' +testfailure aptget -q -y -o Dpkg::Post-Invoke::="apt-get remove" remove package4 +cp rootdir/tmp/testfailure.output install.output +testsuccess grep "E: Unable to acquire the dpkg frontend lock (${TMPWORKINGDIRECTORY}/rootdir/var/lib/dpkg/lock-frontend), is another process using it?" install.output +testsuccess grep "E: Problem executing scripts DPkg::Post-Invoke 'apt-get remove'" install.output + +msgmsg 'Pre-Invoke script runs while frontend is locked' +testfailure aptget -q -y -o Dpkg::Pre-Invoke::="apt-get remove" remove package5 +cp rootdir/tmp/testfailure.output install.output +testsuccess grep "E: Unable to acquire the dpkg frontend lock (${TMPWORKINGDIRECTORY}/rootdir/var/lib/dpkg/lock-frontend), is another process using it?" install.output +testsuccess grep "E: Problem executing scripts DPkg::Pre-Invoke 'apt-get remove'" install.output + +msgmsg 'Pre-Install-Pkgs runs while frontend is locked' +testfailure aptget -q -y -o DPkg::Pre-Install-Pkgs::="apt-get remove" remove package6 +cp rootdir/tmp/testfailure.output install.output +testsuccess grep "E: Unable to acquire the dpkg frontend lock (${TMPWORKINGDIRECTORY}/rootdir/var/lib/dpkg/lock-frontend), is another process using it?" install.output +testsuccess grep "E: Sub-process apt-get remove returned an error code (100)" install.output +testsuccess grep "Failure running script apt-get remove" install.output + + +# Applied test case from DonKult +msgmsg 'Applied case of frontend locking' +cat > ./post-invoke <<EOF +#!/bin/sh +set -e +#export DPKG_FRONTEND_LOCKED=true +${TMPWORKINGDIRECTORY}/rootdir/usr/bin/dpkg -i ${TMPWORKINGDIRECTORY}/incoming/bar_1_all.deb +EOF +chmod +x ./post-invoke +echo "dpkg::post-invoke:: \"${TMPWORKINGDIRECTORY}/post-invoke\";" > rootdir/etc/apt/apt.conf.d/01dpkgpostinvoke + +testdpkgnotinstalled 'foo' 'bar' +testsuccess apt show foo +testfailure apt show bar + +testsuccess apt install foo -s +testdpkgnotinstalled 'foo' 'bar' + +testsuccess apt install foo +testdpkginstalled 'foo' 'bar' diff --git a/test/integration/test-method-gpgv b/test/integration/test-method-gpgv index 86559b7cb..5e00b1f13 100755 --- a/test/integration/test-method-gpgv +++ b/test/integration/test-method-gpgv @@ -40,6 +40,20 @@ testrun() { testgpgv 'Good signed with fingerprint' 'Good: GOODSIG 34A8E9D18DB320F367E8EAA05A90D141DBAC8DAE,' '[GNUPG:] GOODSIG 34A8E9D18DB320F367E8EAA05A90D141DBAC8DAE Joe Sixpack (APT Testcases Dummy) <joe@example.org> [GNUPG:] VALIDSIG 34A8E9D18DB320F367E8EAA05A90D141DBAC8DAE 2016-09-01 1472742625 0 4 0 1 11 00 34A8E9D18DB320F367E8EAA05A90D141DBAC8DAE' + testgpgv 'Untrusted signed with long keyid' 'Worthless: 34A8E9D18DB320F367E8EAA05A90D141DBAC8DAE,' '[GNUPG:] GOODSIG 5A90D141DBAC8DAE Joe Sixpack (APT Testcases Dummy) <joe@example.org> +[GNUPG:] VALIDSIG 34A8E9D18DB320F367E8EAA05A90D141DBAC8DAE 2016-09-01 1472742625 0 4 0 1 1 00 34A8E9D18DB320F367E8EAA05A90D141DBAC8DAE' + testsuccess grep '^\s\+Good:\s\+$' method.output + testgpgv 'Untrusted signed with fingerprint' 'Worthless: 34A8E9D18DB320F367E8EAA05A90D141DBAC8DAE,' '[GNUPG:] GOODSIG 34A8E9D18DB320F367E8EAA05A90D141DBAC8DAE Joe Sixpack (APT Testcases Dummy) <joe@example.org> +[GNUPG:] VALIDSIG 34A8E9D18DB320F367E8EAA05A90D141DBAC8DAE 2016-09-01 1472742625 0 4 0 1 1 00 34A8E9D18DB320F367E8EAA05A90D141DBAC8DAE' + testsuccess grep '^\s\+Good:\s\+$' method.output + + testgpgv 'Weak signed with long keyid' 'Good: GOODSIG 5A90D141DBAC8DAE,' '[GNUPG:] GOODSIG 5A90D141DBAC8DAE Joe Sixpack (APT Testcases Dummy) <joe@example.org> +[GNUPG:] VALIDSIG 34A8E9D18DB320F367E8EAA05A90D141DBAC8DAE 2016-09-01 1472742625 0 4 0 1 2 00 34A8E9D18DB320F367E8EAA05A90D141DBAC8DAE' + testsuccess grep '^Message: Signature by key 34A8E9D18DB320F367E8EAA05A90D141DBAC8DAE uses weak digest algorithm (SHA1)$' method.output + testgpgv 'Weak signed with fingerprint' 'Good: GOODSIG 34A8E9D18DB320F367E8EAA05A90D141DBAC8DAE,' '[GNUPG:] GOODSIG 34A8E9D18DB320F367E8EAA05A90D141DBAC8DAE Joe Sixpack (APT Testcases Dummy) <joe@example.org> +[GNUPG:] VALIDSIG 34A8E9D18DB320F367E8EAA05A90D141DBAC8DAE 2016-09-01 1472742625 0 4 0 1 2 00 34A8E9D18DB320F367E8EAA05A90D141DBAC8DAE' + testsuccess grep '^Message: Signature by key 34A8E9D18DB320F367E8EAA05A90D141DBAC8DAE uses weak digest algorithm (SHA1)$' method.output + testgpgv 'No Pubkey with long keyid' 'NoPubKey: NO_PUBKEY E8525D47528144E2,' '[GNUPG:] ERRSIG E8525D47528144E2 1 11 00 1472744666 9 [GNUPG:] NO_PUBKEY E8525D47528144E2' testgpgv 'No Pubkey with fingerprint' 'NoPubKey: NO_PUBKEY DE66AECA9151AFA1877EC31DE8525D47528144E2,' '[GNUPG:] ERRSIG DE66AECA9151AFA1877EC31DE8525D47528144E2 1 11 00 1472744666 9 @@ -55,6 +69,7 @@ gpgvmethod() { echo '601 Configuration Config-Item: Debug::Acquire::gpgv=1 Config-Item: Dir::Bin::apt-key=./faked-apt-key +Config-Item: APT::Hashes::SHA1::Weak=true 600 URI Acquire URI: file:///dev/null @@ -67,6 +82,7 @@ gpgvmethod() { echo '601 Configuration Config-Item: Debug::Acquire::gpgv=1 Config-Item: Dir::Bin::apt-key=./faked-apt-key +Config-Item: APT::Hashes::SHA1::Weak=true 600 URI Acquire URI: file:///dev/null @@ -75,3 +91,12 @@ Signed-By: 34A8E9D18DB320F367E8EAA05A90D141DBAC8DAE ' | runapt "${METHODSDIR}/gpgv" } testrun + +testgpgv 'Good signed with long keyid but not signed-by key' 'NoPubKey: GOODSIG 4BC0A39C27CE74F9,' '[GNUPG:] GOODSIG 4BC0A39C27CE74F9 Rex Expired <rex@example.org> +[GNUPG:] VALIDSIG 891CC50E605796A0C6E733F74BC0A39C27CE74F9 2016-09-01 1472742625 0 4 0 1 11 00 891CC50E605796A0C6E733F74BC0A39C27CE74F9' +testsuccess grep '^\s\+Good:\s\+$' method.output +testsuccess grep 'verified because the public key is not available: GOODSIG' method.output +testgpgv 'Good signed with fingerprint' 'NoPubKey: GOODSIG 891CC50E605796A0C6E733F74BC0A39C27CE74F9,' '[GNUPG:] GOODSIG 891CC50E605796A0C6E733F74BC0A39C27CE74F9 Rex Expired <rex@example.org> +[GNUPG:] VALIDSIG 891CC50E605796A0C6E733F74BC0A39C27CE74F9 2016-09-01 1472742625 0 4 0 1 11 00 891CC50E605796A0C6E733F74BC0A39C27CE74F9' +testsuccess grep '^\s\+Good:\s\+$' method.output +testsuccess grep 'verified because the public key is not available: GOODSIG' method.output diff --git a/test/integration/test-method-mirror b/test/integration/test-method-mirror index 38d6be9a9..56c9a10a0 100755 --- a/test/integration/test-method-mirror +++ b/test/integration/test-method-mirror @@ -196,6 +196,7 @@ msgmsg 'The prefix for the mirrorlist is' 'passed on' echo 'Dir::Bin::Methods::foo+mirror+file "mirror"; Dir::Bin::Methods::foo+mirror+http "mirror"; Dir::Bin::Methods::foo+http "http"; +Dir::Bin::Methods::foo+https "https"; ' > rootdir/etc/apt/apt.conf.d/99add-foo-method echo "http://localhost:${APTHTTPPORT}/redirectme " > aptarchive/mirror.txt @@ -241,3 +242,14 @@ Building dependency tree... Reading state information... All packages are up to date." apt update testrundownload 'foo=2' + +echo "https://localhost:${APTHTTPSPORT}/ +http://localhost:${APTHTTPPORT}/redirectme" > aptarchive/mirror.txt +rm -rf rootdir/var/lib/apt/lists +sed -i -e "s# foo+# [signed-by=$(readlink -f ./keys/joesixpack.pub)] foo+#g" rootdir/etc/apt/sources.list.d/apt-test-unstable-deb* +testsuccess apt update +testrundownload 'foo=2' + +rm -rf rootdir/var/lib/apt/lists +sed -i -e "s# \[signed-by=[^]]\+\] foo+# [signed-by=$(readlink -f ./keys/marvinparanoid.pub)] foo+#g" rootdir/etc/apt/sources.list.d/apt-test-unstable-deb* +testfailure apt update diff --git a/test/integration/test-no-fds-leaked-to-maintainer-scripts b/test/integration/test-no-fds-leaked-to-maintainer-scripts index 747af69ff..85b3d0ee1 100755 --- a/test/integration/test-no-fds-leaked-to-maintainer-scripts +++ b/test/integration/test-no-fds-leaked-to-maintainer-scripts @@ -55,7 +55,15 @@ checkinstall() { tail -n +3 rootdir/var/log/apt/term.log | head -n -1 > terminal.log testfileequal 'terminal.log' "$(cat terminal.output)" - testequal "startup archives unpack + testequalor2 "startup archives unpack +install $PKGNAME <none> 1.0 +status half-installed $PKGNAME 1.0 +status unpacked $PKGNAME 1.0 +startup packages configure +configure $PKGNAME 1.0 <none> +status unpacked $PKGNAME 1.0 +status half-configured $PKGNAME 1.0 +status installed $PKGNAME 1.0" "startup archives unpack install $PKGNAME <none> 1.0 status half-installed $PKGNAME 1.0 status unpacked $PKGNAME 1.0 @@ -78,7 +86,18 @@ checkpurge() { testfileequal 'terminal.log' "$(cat terminal.output)" if dpkg --compare-versions "$(dpkg_version)" 'ge' '1.18.11'; then - testequal "startup packages remove + testequalor2 "startup packages remove +status installed $PKGNAME 1.0 +remove $PKGNAME 1.0 <none> +status half-configured $PKGNAME 1.0 +status half-installed $PKGNAME 1.0 +status config-files $PKGNAME 1.0 +startup packages configure +startup packages purge +purge $PKGNAME 1.0 <none> +status config-files $PKGNAME 1.0 +status not-installed $PKGNAME <none> +startup packages configure" "startup packages remove status installed $PKGNAME 1.0 remove $PKGNAME 1.0 <none> status half-configured $PKGNAME 1.0 @@ -96,7 +115,19 @@ status config-files $PKGNAME 1.0 status not-installed $PKGNAME <none> startup packages configure" cut -f 3- -d' ' rootdir/var/log/dpkg.log else - testequal "startup packages remove + testequalor2 "startup packages remove +status installed $PKGNAME 1.0 +remove $PKGNAME 1.0 <none> +status half-configured $PKGNAME 1.0 +status half-installed $PKGNAME 1.0 +status config-files $PKGNAME 1.0 +startup packages configure +startup packages purge +remove $PKGNAME 1.0 <none> +purge $PKGNAME 1.0 <none> +status config-files $PKGNAME 1.0 +status not-installed $PKGNAME <none> +startup packages configure" "startup packages remove status installed $PKGNAME 1.0 remove $PKGNAME 1.0 <none> status half-configured $PKGNAME 1.0 diff --git a/test/integration/test-sourceslist-target-plusminus-options b/test/integration/test-sourceslist-target-plusminus-options index e4ce8e282..5c79af2d9 100755 --- a/test/integration/test-sourceslist-target-plusminus-options +++ b/test/integration/test-sourceslist-target-plusminus-options @@ -122,3 +122,7 @@ testtargets 'explicit + activate' 'Packages' 'Contents' 'Contents2' echo 'deb [Contents=yes,target+=Contents] http://example.org/debian stable rocks' > rootdir/etc/apt/sources.list testtargets 'duplications are okay' 'Packages' 'Translations' 'Contents' 'Contents2' + +# we can't check if it really reorders here +echo 'deb [target+=Contents2,Contents] http://example.org/debian stable rocks' > rootdir/etc/apt/sources.list +testtargets 'reordered fallback order' 'Packages' 'Translations' 'Contents' 'Contents2' diff --git a/test/interactive-helper/aptwebserver.cc b/test/interactive-helper/aptwebserver.cc index 4bc344178..461484f6e 100644 --- a/test/interactive-helper/aptwebserver.cc +++ b/test/interactive-helper/aptwebserver.cc @@ -956,6 +956,7 @@ int main(int const argc, const char * argv[]) _config->CndSet("aptwebserver::response-header::Server", "APT webserver"); _config->CndSet("aptwebserver::response-header::Accept-Ranges", "bytes"); _config->CndSet("aptwebserver::directoryindex", "index.html"); + APT::Configuration::getCompressors(); size_t id = 0; while (true) diff --git a/test/libapt/CMakeLists.txt b/test/libapt/CMakeLists.txt index cc1d024f8..035ff07b1 100644 --- a/test/libapt/CMakeLists.txt +++ b/test/libapt/CMakeLists.txt @@ -1,3 +1,4 @@ +set(PROJECT_TEST_LIBRARIES apt-private apt-inst) find_path(GTEST_ROOT src/gtest.cc /usr/src/googletest/googletest /usr/src/gtest @@ -31,13 +32,13 @@ if(GTEST_FOUND) # is expanded at CMake time, so you have to rerun cmake if you add or remove # a file (you can just run cmake . in the build directory) file(GLOB files gtest_runner.cc *-helpers.cc *_test.cc) - add_executable(libapt_test ${files}) - target_include_directories(libapt_test PRIVATE ${GTEST_INCLUDE_DIRS}) - target_link_libraries(libapt_test ${GTEST_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT} apt-private apt-inst) + add_executable(lib${PROJECT_NAME}_test ${files}) + target_include_directories(lib${PROJECT_NAME}_test PRIVATE ${GTEST_INCLUDE_DIRS}) + target_link_libraries(lib${PROJECT_NAME}_test ${GTEST_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT} ${PROJECT_TEST_LIBRARIES}) if (GTEST_DEPENDENCIES) - add_dependencies(libapt_test ${GTEST_DEPENDENCIES}) + add_dependencies(lib${PROJECT_NAME}_test ${GTEST_DEPENDENCIES}) endif() - add_test(NAME AptTests - COMMAND libapt_test + add_test(NAME ${PROJECT_NAME}Tests + COMMAND lib${PROJECT_NAME}_test WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}) endif() |