diff options
Diffstat (limited to 'test')
-rwxr-xr-x | test/integration/test-apt-get-install-deb | 6 | ||||
-rwxr-xr-x | test/integration/test-apt-get-satisfy | 72 | ||||
-rwxr-xr-x | test/integration/test-proxy-connect | 22 | ||||
-rw-r--r-- | test/interactive-helper/CMakeLists.txt | 4 | ||||
-rw-r--r-- | test/libapt/CMakeLists.txt | 4 | ||||
-rw-r--r-- | test/libapt/stringview_test.cc | 3 |
6 files changed, 102 insertions, 9 deletions
diff --git a/test/integration/test-apt-get-install-deb b/test/integration/test-apt-get-install-deb index 844f1d7c5..002c1aef8 100755 --- a/test/integration/test-apt-get-install-deb +++ b/test/integration/test-apt-get-install-deb @@ -22,9 +22,9 @@ done mv foo.rpm foo.deb for exe in apt aptget; do for cmd in install remove purge upgrade full-upgrade; do - testfailuremsg "E: Sub-process Popen returned an error code (2) -E: Encountered a section with no Package: header -E: Problem with MergeList ${TMPWORKINGDIRECTORY}/foo.deb + testfailuremsg "E: Invalid archive signature +E: Internal error, could not locate member control.tar.{zstlz4gzxzbz2lzma} +E: Could not read meta data from ${TMPWORKINGDIRECTORY}/foo.deb E: The package lists or status file could not be parsed or opened." $exe $cmd ./foo.deb done done diff --git a/test/integration/test-apt-get-satisfy b/test/integration/test-apt-get-satisfy new file mode 100755 index 000000000..f2e04d789 --- /dev/null +++ b/test/integration/test-apt-get-satisfy @@ -0,0 +1,72 @@ +#!/bin/sh +set -e + +TESTDIR="$(readlink -f "$(dirname "$0")")" +. "$TESTDIR/framework" + +setupenvironment +configarchitecture 'i386' 'amd64' + +insertpackage 'stable' 'depends' 'i386' '1' +insertpackage 'stable' 'depends' 'amd64' '1' +insertinstalledpackage 'conflicts' 'i386' '1' 'Multi-Arch: same' +insertinstalledpackage 'conflicts' 'amd64' '1' 'Multi-Arch: same' +setupaptarchive + + +testsuccessequal "Reading package lists... +Building dependency tree... +The following packages will be REMOVED: + conflicts +The following NEW packages will be installed: + depends +0 upgraded, 1 newly installed, 1 to remove and 0 not upgraded. +Remv conflicts [1] +Inst depends (1 stable [i386]) +Conf depends (1 stable [i386])" aptget satisfy --simulate "depends (>= 1)" "Conflicts: conflicts:i386 (>= 1) [i386], conflicts:amd64 (>= 1) [amd64]" + +testsuccessequal "Reading package lists... +Building dependency tree... +The following packages will be REMOVED: + conflicts:amd64 +The following NEW packages will be installed: + depends:amd64 +0 upgraded, 1 newly installed, 1 to remove and 0 not upgraded. +Remv conflicts:amd64 [1] +Inst depends:amd64 (1 stable [amd64]) +Conf depends:amd64 (1 stable [amd64])" aptget satisfy --simulate "depends (>= 1)" "Conflicts: conflicts:i386 (>= 1) [i386], conflicts:amd64 (>= 1) [amd64]" --host-architecture amd64 + +msgmsg "Build profile" + +testsuccessequal "Reading package lists... +Building dependency tree... +0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded." aptget satisfy --simulate "depends:amd64 <a>, depends:i386 <i>" + +testsuccessequal "Reading package lists... +Building dependency tree... +The following NEW packages will be installed: + depends:amd64 +0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded. +Inst depends:amd64 (1 stable [amd64]) +Conf depends:amd64 (1 stable [amd64])" aptget satisfy --simulate "depends:amd64 <a>, depends:i386 <i>" -P a + +testsuccessequal "Reading package lists... +Building dependency tree... +The following NEW packages will be installed: + depends +0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded. +Inst depends (1 stable [i386]) +Conf depends (1 stable [i386])" aptget satisfy --simulate "depends:amd64 <a>, depends:i386 <i>" -P i + + +msgmsg "Broken syntax" +testfailureequal "E: Problem parsing dependency: apt (>= 2" aptget satisfy 'foo' 'apt (>= 2' -s +testfailureequal "E: Problem parsing dependency: Conflicts: apt (>= 2" aptget satisfy 'foo' 'Conflicts: apt (>= 2' -s + + +msgmsg "Legacy operators" +testfailureequal "E: Invalid operator '<' at offset 5, did you mean '<<' or '<='? - in: foo (< 1)" aptget satisfy 'foo (< 1)' -s +testfailureequal "E: Invalid operator '>' at offset 5, did you mean '>>' or '>='? - in: foo (> 1)" aptget satisfy 'foo (> 1)' -s + +msgmsg "Unsupported dependency type" +testfailureequal "E: Problem parsing dependency: Recommends: foo" aptget satisfy 'Recommends: foo' -s diff --git a/test/integration/test-proxy-connect b/test/integration/test-proxy-connect new file mode 100755 index 000000000..17927c9db --- /dev/null +++ b/test/integration/test-proxy-connect @@ -0,0 +1,22 @@ +#!/bin/sh +set -e + +TESTDIR="$(readlink -f "$(dirname "$0")")" +. "$TESTDIR/framework" +setupenvironment +configarchitecture 'amd64' + +buildsimplenativepackage 'unrelated' 'all' '0.5~squeeze1' 'unstable' + +setupaptarchive +changetowebserver --request-absolute='uri' + + +msgmsg 'Check that host header we send for CONNECT is for target, not proxy' +echo "deb https://example.example/ example example" > rootdir/etc/apt/sources.list +rm -f rootdir/etc/apt/sources.list.d/* +echo "Acquire::http::Proxy \"http://localhost:${APTHTTPPORT}\";" > rootdir/etc/apt/apt.conf.d/99proxy + +aptget update >/dev/null 2>&1 +testsuccessequal "CONNECT example.example:443 HTTP/1.1\r +Host: example.example:443\r" grep -A1 "^CONNECT" aptarchive/webserver.log diff --git a/test/interactive-helper/CMakeLists.txt b/test/interactive-helper/CMakeLists.txt index 5a32ca17e..f4238665d 100644 --- a/test/interactive-helper/CMakeLists.txt +++ b/test/interactive-helper/CMakeLists.txt @@ -1,9 +1,9 @@ add_executable(mthdcat mthdcat.cc) target_link_libraries(mthdcat apt-pkg) add_executable(testdeb testdeb.cc) -target_link_libraries(testdeb apt-pkg apt-inst) +target_link_libraries(testdeb apt-pkg) add_executable(extract-control extract-control.cc) -target_link_libraries(extract-control apt-pkg apt-inst) +target_link_libraries(extract-control apt-pkg) add_executable(aptwebserver aptwebserver.cc) target_link_libraries(aptwebserver apt-pkg ${CMAKE_THREAD_LIBS_INIT}) add_executable(aptdropprivs aptdropprivs.cc) diff --git a/test/libapt/CMakeLists.txt b/test/libapt/CMakeLists.txt index 035ff07b1..d44d77ad4 100644 --- a/test/libapt/CMakeLists.txt +++ b/test/libapt/CMakeLists.txt @@ -1,4 +1,4 @@ -set(PROJECT_TEST_LIBRARIES apt-private apt-inst) +set(PROJECT_TEST_LIBRARIES apt-private) find_path(GTEST_ROOT src/gtest.cc /usr/src/googletest/googletest /usr/src/gtest @@ -27,6 +27,8 @@ if(GTEST_FOUND) # so disable the offending warnings while compiling tests for now add_optional_compile_options(Wno-undef) add_optional_compile_options(Wno-ctor-dtor-privacy) + # Do not force override for gtest, gtest is missing override specifiers + add_optional_compile_options(Wno-suggest-override) # Definition of the C++ files used to build the test binary - note that this # is expanded at CMake time, so you have to rerun cmake if you add or remove diff --git a/test/libapt/stringview_test.cc b/test/libapt/stringview_test.cc index 95fbe8906..03d82517b 100644 --- a/test/libapt/stringview_test.cc +++ b/test/libapt/stringview_test.cc @@ -1,6 +1,3 @@ -#if !(defined APT_PKG_EXPOSE_STRING_VIEW) - #define APT_PKG_EXPOSE_STRING_VIEW -#endif #include <config.h> #include <apt-pkg/string_view.h> |