summaryrefslogtreecommitdiff
path: root/test/integration/framework
diff options
context:
space:
mode:
authorDavid Kalnischkies <david@kalnischkies.de>2014-03-10 00:43:21 +0100
committerDavid Kalnischkies <david@kalnischkies.de>2014-03-13 13:58:45 +0100
commita0975c8d97f06ac116c5cea9a98993817ced0e86 (patch)
tree79146d69ff4e51c6bd17dc28cf7a1981be60caa4 /test/integration/framework
parentb5ee78aec0b13932bdeb710cbbea148b7041203a (diff)
enable mount support for apt-cdrom in the tests
Git-Dch: Ignore
Diffstat (limited to 'test/integration/framework')
-rw-r--r--test/integration/framework13
1 files changed, 10 insertions, 3 deletions
diff --git a/test/integration/framework b/test/integration/framework
index d66171783..bf6fa0218 100644
--- a/test/integration/framework
+++ b/test/integration/framework
@@ -932,16 +932,23 @@ connect = 8080
changetocdrom() {
mkdir -p rootdir/media/cdrom/.disk
local CD="$(readlink -f rootdir/media/cdrom)"
- echo "acquire::cdrom::mount \"${CD}\";" > rootdir/etc/apt/apt.conf.d/00cdrom
- echo 'acquire::cdrom::autodetect 0;' >> rootdir/etc/apt/apt.conf.d/00cdrom
+ echo "acquire::cdrom::mount \"${CD}\";
+acquire::cdrom::${CD}/::mount \"mv ${CD}-unmounted ${CD}\";
+acquire::cdrom::${CD}/::umount \"mv ${CD} ${CD}-unmounted\";
+acquire::cdrom::autodetect 0;" > rootdir/etc/apt/apt.conf.d/00cdrom
echo -n "$1" > ${CD}/.disk/info
if [ ! -d aptarchive/dists ]; then
msgdie 'Flat file archive cdroms can not be created currently'
return 1
fi
- mv aptarchive/dists $CD
+ mv aptarchive/dists "$CD"
ln -s "$(readlink -f ./incoming)" $CD/pool
find rootdir/etc/apt/sources.list.d/ -name 'apt-test-*.list' -delete
+ # start with an unmounted disk
+ mv "${CD}" "${CD}-unmounted"
+ # we don't want the disk to be modifiable
+ addtrap 'prefix' "chmod -f -R +w $PWD/rootdir/media/cdrom/dists/ $PWD/rootdir/media/cdrom-unmounted/dists/ || true;"
+ chmod -R -w rootdir/media/cdrom-unmounted/dists
}
downloadfile() {