summaryrefslogtreecommitdiff
path: root/test/integration/test-apt-cdrom
diff options
context:
space:
mode:
authorMichael Vogt <mvo@debian.org>2015-08-18 11:54:05 +0200
committerMichael Vogt <mvo@debian.org>2015-08-18 11:54:05 +0200
commit21248c0f00ee71412dbadc6ebf84011cf974346d (patch)
tree7dc1f5904399482d2128765b5b86d57a4ac5b3e1 /test/integration/test-apt-cdrom
parente5f34ad3b043abf033c1626eb8449b75955d6760 (diff)
parent4fc6b7570c3e97b65c118b58cdf6729fa94c9b03 (diff)
Merge branch 'debian/experimental' into feature/srv-records
Conflicts: cmdline/apt-helper.cc cmdline/makefile
Diffstat (limited to 'test/integration/test-apt-cdrom')
-rwxr-xr-xtest/integration/test-apt-cdrom76
1 files changed, 60 insertions, 16 deletions
diff --git a/test/integration/test-apt-cdrom b/test/integration/test-apt-cdrom
index 8d8fdf167..34b35f745 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
- sed -e '/gpgv/ d' -e '/^Identifying/ d' -e '/Reading / d' rootdir/tmp/apt-cdrom.log
+ sed -e '/gpgv\?: Signature made/ d' -e '/gpgv\?: Good signature/ 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!"
}
+aptautotest_aptcdromlog_add() { aptautotest_aptget_update "$@"; }
CDROM_PRE="Using CD-ROM mount point $(readlink -f ./rootdir/media)/cdrom/
Unmounting CD-ROM...
@@ -49,12 +50,12 @@ deb-src cdrom:[Debian APT Testdisk 0.8.15]/ stable main
Unmounting CD-ROM...
Repeat this process for the rest of the CDs in your set."
-testequal "$CDROM_PRE
+testsuccessequal "$CDROM_PRE
Found 2 package indexes, 1 source indexes, 1 translation indexes and 1 signatures
Found label 'Debian APT Testdisk 0.8.15'
$CDROM_POST" aptcdromlog add
-testequal "Using CD-ROM mount point $(readlink -f ./rootdir/media)/cdrom/
+testsuccessequal "Using CD-ROM mount point $(readlink -f ./rootdir/media)/cdrom/
Mounting CD-ROM...
Stored label: Debian APT Testdisk 0.8.15
Unmounting CD-ROM..." aptcdromlog ident
@@ -63,45 +64,88 @@ Unmounting CD-ROM..." aptcdromlog ident
ident="$(LC_ALL=C aptcdrom ident 2>&1 )"
CD_ID="$(echo "$ident" | grep "^Identifying" | head -n1 | cut -d" " -f2 | tr --delete '[]')"
CD_LABEL="$(echo "$ident" | grep "^Stored label:" | head -n1 | sed "s/^[^:]*: //")"
-testequal "CD::${CD_ID} \"${CD_LABEL}\";
-CD::${CD_ID}::Label \"${CD_LABEL}\";" cat rootdir/var/lib/apt/cdroms.list
+testfileequal rootdir/var/lib/apt/cdroms.list "CD::${CD_ID} \"${CD_LABEL}\";
+CD::${CD_ID}::Label \"${CD_LABEL}\";"
-testequal 'Reading package lists...
+testcdromusage() {
+ touch rootdir/var/lib/apt/extended_states
+
+ testsuccessequal 'Reading package lists...
Building dependency tree...
+Reading state information...
The following NEW packages will be installed:
testing
0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
Inst testing (0.8.15 stable [amd64])
Conf testing (0.8.15 stable [amd64])' aptget install testing -s
-testequal 'Reading package lists...
+ testdpkgnotinstalled testing
+ testsuccess aptget install testing -y
+ testdpkginstalled testing
+ testsuccess aptget purge testing -y
+ testdpkgnotinstalled testing
+
+ testsuccessequal 'Reading package lists...
Building dependency tree...
+Reading state information...
The following NEW packages will be installed:
testing:i386
0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
Inst testing:i386 (0.8.15 stable [i386])
Conf testing:i386 (0.8.15 stable [i386])' aptget install testing:i386 -s
+ testdpkgnotinstalled testing:i386
+ testsuccess aptget install testing:i386 -y
+ testdpkginstalled testing:i386
+ testsuccess aptget purge testing:i386 -y
+ testdpkgnotinstalled testing:i386
+
+ cd downloaded
+ rm -f testing_0.8.15_amd64.deb
+ testsuccess aptget download testing
+ testsuccess test -s testing_0.8.15_amd64.deb
+ rm -f testing_0.8.15_amd64.deb
+
+ rm -f testing_0.8.15.dsc
+ testsuccess aptget source testing --dsc-only -d
+ testsuccess test -s testing_0.8.15.dsc
+ rm -f testing_0.8.15.dsc
+ cd - >/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 '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 '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