X-Git-Url: https://git.saurik.com/apt.git/blobdiff_plain/67da93c38eb3904b36537e025e2f63f77d830e20..21248c0f00ee71412dbadc6ebf84011cf974346d:/test/integration/test-apt-get-changelog?ds=sidebyside diff --git a/test/integration/test-apt-get-changelog b/test/integration/test-apt-get-changelog index 0a80cc08c..7e81c71b6 100755 --- a/test/integration/test-apt-get-changelog +++ b/test/integration/test-apt-get-changelog @@ -9,28 +9,40 @@ configarchitecture "i386" buildsimplenativepackage 'apt' 'all' '1.0' 'stable' -setupaptarchive +setupaptarchive --no-update changetowebserver -aptget update -qq +testsuccess aptget update -echo 'Apt::Changelogs::Server "http://localhost:8080/";' >> ./aptconfig.conf +# simulate normal user with non-existent root-owned directories +rm -rf rootdir/var/cache/apt/archives/ +mkdir rootdir/var/cache/apt/archives/ +addtrap 'prefix' "chmod -f -R +w $PWD/rootdir/var/cache/apt/archives || true;" +chmod -R -w rootdir/var/cache/apt/archives -testequal "'http://localhost:8080//pool/apt_1.0/changelog'" aptget changelog apt --print-uris +echo 'Apt::Changelogs::Server "http://localhost:8080/";' > rootdir/etc/apt/apt.conf.d/changelog.conf -aptget changelog apt -qq > apt.changelog -testfileequal 'apt.changelog' "$(cat aptarchive/pool/apt_1.0/changelog)" -rm apt.changelog +testsuccessequal "'http://localhost:8080/pool/apt_1.0/changelog'" aptget changelog apt --print-uris -aptget changelog apt -d -qq -testfileequal 'apt.changelog' "$(cat aptarchive/pool/apt_1.0/changelog)" -rm apt.changelog aptarchive/pool/apt_1.0/changelog +testsuccessequal "'http://localhost:8080/pool/apt_1.0/changelog' +'http://localhost:8080/pool/apt_1.0/changelog'" aptget changelog apt apt --print-uris -aptget changelog apt -qq -o APT::Changelogs::Server='http://not-on-the-main-server:8080/' > apt.changelog -testfileequal 'apt.changelog' "$(cat aptarchive/pool/apt_1.0.changelog)" -rm apt.changelog +cd downloaded -aptget changelog apt -d -qq -testfileequal 'apt.changelog' "$(cat aptarchive/pool/apt_1.0.changelog)" -rm apt.changelog aptarchive/pool/apt_1.0.changelog +testsuccess aptget changelog apt -qq +testfileequal '../rootdir/tmp/testsuccess.output' "$(cat ../aptarchive/pool/apt_1.0/changelog)" -testequal 'E: changelog download failed' aptget changelog apt -qq -o APT::Changelogs::Server='http://not-on-the-main-server:8080/' +testsuccess aptget changelog apt -d +testfileequal 'apt.changelog' "$(cat ../aptarchive/pool/apt_1.0/changelog)" +testfilestats 'apt.changelog' '%U:%G:%a' '=' "${TEST_DEFAULT_USER}:${TEST_DEFAULT_GROUP}:644" +rm -f apt.changelog ../aptarchive/pool/apt_1.0/changelog + +testequal "$(cat ../aptarchive/pool/apt_1.0.changelog)" aptget changelog apt \ + -qq -o APT::Changelogs::Server='http://not-on-the-main-server:8080/' + +testsuccess aptget changelog apt -d +testfileequal 'apt.changelog' "$(cat ../aptarchive/pool/apt_1.0.changelog)" +testfilestats 'apt.changelog' '%U:%G:%a' '=' "${TEST_DEFAULT_USER}:${TEST_DEFAULT_GROUP}:644" +rm -f apt.changelog ../aptarchive/pool/apt_1.0.changelog + +testequal 'E: changelog download failed' aptget changelog apt -qq -d -o APT::Changelogs::Server='http://not-on-the-main-server:8080/' +testfailure test -e apt.changelog