X-Git-Url: https://git.saurik.com/apt.git/blobdiff_plain/25b86db159fbc3c043628e285c0c1ef24dec2c6e..82153438235144c485a8539b5c035e67bbef96e4:/test/integration/test-apt-cdrom diff --git a/test/integration/test-apt-cdrom b/test/integration/test-apt-cdrom index 9906795ca..a3c3b5ba0 100755 --- a/test/integration/test-apt-cdrom +++ b/test/integration/test-apt-cdrom @@ -1,8 +1,8 @@ #!/bin/sh set -e -TESTDIR=$(readlink -f $(dirname $0)) -. $TESTDIR/framework +TESTDIR="$(readlink -f "$(dirname "$0")")" +. "$TESTDIR/framework" setupenvironment configarchitecture 'amd64' 'i386' @@ -33,11 +33,12 @@ 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!" } +aptautotest_aptcdromlog_add() { aptautotest_aptget_update "$@"; } CDROM_PRE="Using CD-ROM mount point $(readlink -f ./rootdir/media)/cdrom/ Unmounting CD-ROM... Waiting for disc... -Please insert a Disc in the drive and press enter +Please insert a Disc in the drive and press [Enter] Mounting CD-ROM... Scanning disc for index files..." CDROM_POST="This disc is called: @@ -50,7 +51,7 @@ Unmounting CD-ROM... Repeat this process for the rest of the CDs in your set." testsuccessequal "$CDROM_PRE -Found 2 package indexes, 1 source indexes, 1 translation indexes and 1 signatures +Found 3 package indexes, 1 source indexes, 1 translation indexes and 1 signatures Found label 'Debian APT Testdisk 0.8.15' $CDROM_POST" aptcdromlog add @@ -115,33 +116,35 @@ testcdromusage # check Idempotence of apt-cdrom (and disabling of Translation dropping) testsuccessequal "$CDROM_PRE -Found 2 package indexes, 1 source indexes, 2 translation indexes and 1 signatures +Found 3 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 testsuccessequal "$CDROM_PRE -Found 2 package indexes, 1 source indexes, 2 translation indexes and 1 signatures +Found 3 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 testsuccessequal "$CDROM_PRE -Found 2 package indexes, 1 source indexes, 1 translation indexes and 1 signatures +Found 3 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 # ensure cdrom method isn't trying to mount the cdrom mv rootdir/media/cdrom-unmounted rootdir/media/cdrom-ejected -# ensure an update doesn't mess with cdrom sources +msgmsg "ensure an update doesn't mess with cdrom sources" testsuccess aptget update -testfileequal rootdir/tmp/testsuccess.output 'Reading package lists...' +testfileequal rootdir/tmp/testsuccess.output 'Hit:1 cdrom://Debian APT Testdisk 0.8.15 stable InRelease +Reading package lists...' mv rootdir/media/cdrom-ejected rootdir/media/cdrom-unmounted testcdromusage -# and again to check that it withstands the temptation even if it could mount +msgmsg 'and again to check that it withstands the temptation even if it could mount' testsuccess aptget update -testfileequal rootdir/tmp/testsuccess.output 'Reading package lists...' +testfileequal rootdir/tmp/testsuccess.output 'Hit:1 cdrom://Debian APT Testdisk 0.8.15 stable InRelease +Reading package lists...' testcdromusage msgmsg 'Check that nothing touched our' 'CD-ROM'