From 1e071c30340ef6b0f8279440a9fd369f27e9b34b Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Sat, 8 Mar 2014 17:42:11 +0100 Subject: simplify apt-cdrom testcode Git-Dch: Ignore --- test/integration/test-apt-cdrom | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) (limited to 'test/integration/test-apt-cdrom') diff --git a/test/integration/test-apt-cdrom b/test/integration/test-apt-cdrom index cc3483f9b..caaa351c0 100755 --- a/test/integration/test-apt-cdrom +++ b/test/integration/test-apt-cdrom @@ -24,9 +24,13 @@ cd - > /dev/null addtrap 'prefix' "chmod -R +w $PWD/rootdir/media/cdrom/dists/;" chmod -R -w rootdir/media/cdrom/dists -aptcdrom add -m -o quiet=1 > apt-cdrom.log 2>&1 -sed -i -e '/^Using CD-ROM/ d' -e '/gpgv/ d' -e '/^Identifying/ d' -e '/Reading / d' apt-cdrom.log -testfileequal apt-cdrom.log "Scanning disc for index files.. +aptcdromlog() { + rm -f rootdir/tmp/apt-cdrom.log + aptcdrom "$@" -o quiet=1 >rootdir/tmp/apt-cdrom.log 2>&1 + sed -e '/^Using CD-ROM/ d' -e '/gpgv/ d' -e '/^Identifying/ d' -e '/Reading / d' rootdir/tmp/apt-cdrom.log +} + +testequal "Scanning disc for index files.. Found 2 package indexes, 1 source indexes, 1 translation indexes and 1 signatures Found label 'Debian APT Testdisk 0.8.15' This disc is called: @@ -35,7 +39,9 @@ Writing new source list Source list entries for this disc are: deb cdrom:[Debian APT Testdisk 0.8.15]/ stable main deb-src cdrom:[Debian APT Testdisk 0.8.15]/ stable main -Repeat this process for the rest of the CDs in your set." +Repeat this process for the rest of the CDs in your set." aptcdromlog add -m + +testequal 'Stored label: Debian APT Testdisk 0.8.15' aptcdromlog ident -m testequal 'Reading package lists... Building dependency tree... @@ -54,9 +60,7 @@ Inst testing:i386 (0.8.15 stable [i386]) Conf testing:i386 (0.8.15 stable [i386])' aptget install testing:i386 -s # check Idempotence of apt-cdrom (and disabling of Translation dropping) -aptcdrom add -m -o quiet=1 -o APT::CDROM::DropTranslation=0 > apt-cdrom.log 2>&1 -sed -i -e '/^Using CD-ROM/ d' -e '/gpgv/ d' -e '/^Identifying/ d' -e '/Reading / d' apt-cdrom.log -testfileequal apt-cdrom.log "Scanning disc for index files.. +testequal "Scanning disc for index files.. Found 2 package indexes, 1 source indexes, 2 translation indexes and 1 signatures This disc is called: 'Debian APT Testdisk 0.8.15' @@ -64,12 +68,10 @@ Writing new source list Source list entries for this disc are: deb cdrom:[Debian APT Testdisk 0.8.15]/ stable main deb-src cdrom:[Debian APT Testdisk 0.8.15]/ stable main -Repeat this process for the rest of the CDs in your set." +Repeat this process for the rest of the CDs in your set." aptcdromlog add -m -o APT::CDROM::DropTranslation=0 # take Translations from previous runs as needed -aptcdrom add -m -o quiet=1 > apt-cdrom.log 2>&1 -sed -i -e '/^Using CD-ROM/ d' -e '/gpgv/ d' -e '/^Identifying/ d' -e '/Reading / d' apt-cdrom.log -testfileequal apt-cdrom.log "Scanning disc for index files.. +testequal "Scanning disc for index files.. Found 2 package indexes, 1 source indexes, 2 translation indexes and 1 signatures This disc is called: 'Debian APT Testdisk 0.8.15' @@ -77,14 +79,12 @@ Writing new source list Source list entries for this disc are: deb cdrom:[Debian APT Testdisk 0.8.15]/ stable main deb-src cdrom:[Debian APT Testdisk 0.8.15]/ stable main -Repeat this process for the rest of the CDs in your set." +Repeat this process for the rest of the CDs in your set." aptcdromlog add -m 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 -aptcdrom add -m -o quiet=1 > apt-cdrom.log 2>&1 -sed -i -e '/^Using CD-ROM/ d' -e '/gpgv/ d' -e '/^Identifying/ d' -e '/Reading / d' apt-cdrom.log -testfileequal apt-cdrom.log "Scanning disc for index files.. +testequal "Scanning disc for index files.. Found 2 package indexes, 1 source indexes, 1 translation indexes and 1 signatures This disc is called: 'Debian APT Testdisk 0.8.15' @@ -92,7 +92,7 @@ Writing new source list Source list entries for this disc are: deb cdrom:[Debian APT Testdisk 0.8.15]/ stable main deb-src cdrom:[Debian APT Testdisk 0.8.15]/ stable main -Repeat this process for the rest of the CDs in your set." +Repeat this process for the rest of the CDs in your set." aptcdromlog add -m msgtest 'Test for the english description translation of' 'testing' aptcache show testing -o Acquire::Languages=en | grep -q '^Description-en: ' && msgpass || msgfail -- cgit v1.2.3 From a0975c8d97f06ac116c5cea9a98993817ced0e86 Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Mon, 10 Mar 2014 00:43:21 +0100 Subject: enable mount support for apt-cdrom in the tests Git-Dch: Ignore --- test/integration/test-apt-cdrom | 78 ++++++++++++++++++++++------------------- 1 file changed, 41 insertions(+), 37 deletions(-) (limited to 'test/integration/test-apt-cdrom') diff --git a/test/integration/test-apt-cdrom b/test/integration/test-apt-cdrom index caaa351c0..fddd26bd9 100755 --- a/test/integration/test-apt-cdrom +++ b/test/integration/test-apt-cdrom @@ -12,36 +12,59 @@ setupaptarchive --no-update changetocdrom 'Debian APT Testdisk 0.8.15' # -de is not in the Release file, but picked up anyway for compatibility -cd rootdir/media/cdrom/dists/stable/main/i18n +cd rootdir/media/cdrom-unmounted/dists/stable/main/i18n +chmod +w . sed -e '/^Description-en:/ d' -e '/^ / d' -e '/^$/ d' Translation-en > Translation-de echo 'Description-de: automatisch generiertes Testpaket testing=0.8.15/stable Diese Pakete sind nur für das testen von APT gedacht, sie erfüllen keinen Zweck auf einem normalen System… ' >> Translation-de compressfile Translation-de -rm Translation-en Translation-de +rm -f Translation-en Translation-de +chmod -R -w . cd - > /dev/null -addtrap 'prefix' "chmod -R +w $PWD/rootdir/media/cdrom/dists/;" -chmod -R -w rootdir/media/cdrom/dists aptcdromlog() { rm -f rootdir/tmp/apt-cdrom.log - aptcdrom "$@" -o quiet=1 >rootdir/tmp/apt-cdrom.log 2>&1 - sed -e '/^Using CD-ROM/ d' -e '/gpgv/ d' -e '/^Identifying/ d' -e '/Reading / d' rootdir/tmp/apt-cdrom.log + 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 Date: Mon, 10 Mar 2014 02:54:33 +0100 Subject: msgstr with elipses need three dots fixes some messages and their translation so that all of them have three dots for messages with an elipse. Many translations already had this. --- test/integration/test-apt-cdrom | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'test/integration/test-apt-cdrom') diff --git a/test/integration/test-apt-cdrom b/test/integration/test-apt-cdrom index fddd26bd9..8d8fdf167 100755 --- a/test/integration/test-apt-cdrom +++ b/test/integration/test-apt-cdrom @@ -35,11 +35,11 @@ aptcdromlog() { } CDROM_PRE="Using CD-ROM mount point $(readlink -f ./rootdir/media)/cdrom/ -Unmounting CD-ROM +Unmounting CD-ROM... Waiting for disc... Please insert a Disc in the drive and press enter Mounting CD-ROM... -Scanning disc for index files.." +Scanning disc for index files..." CDROM_POST="This disc is called: 'Debian APT Testdisk 0.8.15' Writing new source list -- cgit v1.2.3