X-Git-Url: https://git.saurik.com/apt.git/blobdiff_plain/83b880c6505a20247239d897b7387bba37942993..ff86d7df6a53ff6283de4b9a858c1dad98ed887f:/test/integration/test-apt-cdrom diff --git a/test/integration/test-apt-cdrom b/test/integration/test-apt-cdrom index 8d8fdf167..6a218ffb8 100755 --- a/test/integration/test-apt-cdrom +++ b/test/integration/test-apt-cdrom @@ -21,7 +21,7 @@ echo 'Description-de: automatisch generiertes Testpaket testing=0.8.15/stable ' >> Translation-de compressfile Translation-de rm -f Translation-en Translation-de -chmod -R -w . +chmod -R 555 . cd - > /dev/null aptcdromlog() { @@ -29,10 +29,11 @@ aptcdromlog() { test ! -e rootdir/media/cdrom || echo "CD-ROM is mounted, but shouldn't be!" test -e rootdir/media/cdrom-unmounted || echo "Unmounted CD-ROM doesn't exist, but it should!" aptcdrom "$@" -o quiet=1 >rootdir/tmp/apt-cdrom.log 2>&1 /dev/null +} +testcdromusage + # check Idempotence of apt-cdrom (and disabling of Translation dropping) -testequal "$CDROM_PRE +testsuccessequal "$CDROM_PRE Found 2 package indexes, 1 source indexes, 2 translation indexes and 1 signatures $CDROM_POST" aptcdromlog add -o APT::CDROM::DropTranslation=0 # take Translations from previous runs as needed -testequal "$CDROM_PRE +testsuccessequal "$CDROM_PRE Found 2 package indexes, 1 source indexes, 2 translation indexes and 1 signatures $CDROM_POST" aptcdromlog add msgtest 'Test for the german description translation of' 'testing' aptcache show testing -o Acquire::Languages=de | grep -q '^Description-de: ' && msgpass || msgfail rm -rf rootdir/var/lib/apt/lists -mkdir -p rootdir/var/lib/apt/lists/partial -testequal "$CDROM_PRE +testsuccessequal "$CDROM_PRE Found 2 package indexes, 1 source indexes, 1 translation indexes and 1 signatures $CDROM_POST" aptcdromlog add msgtest 'Test for the english description translation of' 'testing' aptcache show testing -o Acquire::Languages=en | grep -q '^Description-en: ' && msgpass || msgfail -# check that we really can install from a 'cdrom' -testdpkgnotinstalled testing -testsuccess aptget install testing -y -testdpkginstalled testing +# ensure cdrom method isn't trying to mount the cdrom +mv rootdir/media/cdrom-unmounted rootdir/media/cdrom-ejected +msgmsg "ensure an update doesn't mess with cdrom sources" +testsuccess aptget update +testfileequal rootdir/tmp/testsuccess.output 'Hit cdrom://Debian APT Testdisk 0.8.15 stable InRelease +Reading package lists...' +mv rootdir/media/cdrom-ejected rootdir/media/cdrom-unmounted +testcdromusage + +msgmsg 'and again to check that it withstands the temptation even if it could mount' +testsuccess aptget update +testfileequal rootdir/tmp/testsuccess.output 'Hit cdrom://Debian APT Testdisk 0.8.15 stable InRelease +Reading package lists...' +testcdromusage + +msgmsg 'Check that nothing touched our' 'CD-ROM' +for file in $(find rootdir/media/cdrom-unmounted/dists); do + testfilestats "$file" '%U:%G:%a' '=' "${TEST_DEFAULT_USER}:${TEST_DEFAULT_GROUP}:555" +done