summaryrefslogtreecommitdiff
path: root/test/integration/framework
diff options
context:
space:
mode:
authorMichael Vogt <mvo@ubuntu.com>2014-09-26 18:09:32 +0200
committerMichael Vogt <mvo@ubuntu.com>2014-09-26 18:09:32 +0200
commit48fd4181ad0261d5f3e8894dcbfccfaea1530645 (patch)
tree9df89db20deaf1ffcaf4846858c2ad126c08aacc /test/integration/framework
parentd916e2a93b798e29d342e9498266767c5be8e2a5 (diff)
parent5f982b9d903b38bb5549479f0111d31e2695090c (diff)
Merge remote-tracking branch 'donkult/feature/generalize-gzipindex' into debian/sid
Diffstat (limited to 'test/integration/framework')
-rw-r--r--test/integration/framework30
1 files changed, 30 insertions, 0 deletions
diff --git a/test/integration/framework b/test/integration/framework
index ff010a5c4..7923e23d9 100644
--- a/test/integration/framework
+++ b/test/integration/framework
@@ -339,6 +339,36 @@ configcompression() {
done > ${TMPWORKINGDIRECTORY}/rootdir/etc/testcase-compressor.conf
}
+forcecompressor() {
+ COMPRESSOR="$1"
+ COMPRESSOR_CMD="$1"
+ case $COMPRESSOR in
+ gzip) COMPRESS='gz';;
+ bzip2) COMPRESS='bz2';;
+ lzma) COMPRESS='lzma';;
+ xz) COMPRESS='xz';;
+ *) msgdie "Compressor $COMPRESSOR is unknown to framework, so can't be forced by forcecompressor!";;
+ esac
+ local CONFFILE="${TMPWORKINGDIRECTORY}/rootdir/etc/apt/apt.conf.d/00force-compressor"
+ echo "Acquire::CompressionTypes::Order { \"${COMPRESS}\"; };
+Dir::Bin::uncompressed \"/does/not/exist\";
+Dir::Bin::gzip \"/does/not/exist\";
+Dir::Bin::bzip2 \"/does/not/exist\";
+Dir::Bin::lzma \"/does/not/exist\";
+Dir::Bin::xz \"/does/not/exist\";" > "$CONFFILE"
+ if [ -e "/bin/${COMPRESSOR}" ]; then
+ echo "Dir::Bin::${COMPRESSOR} \"/bin/${COMPRESSOR}\";" >> "$CONFFILE"
+ elif [ -e "/usr/bin/${COMPRESSOR}" ]; then
+ echo "Dir::Bin::${COMPRESSOR} \"/usr/bin/${COMPRESSOR}\";" >> "$CONFFILE"
+ elif [ "${COMPRESSOR}" = 'lzma' ]; then
+ echo 'Dir::Bin::xz "/usr/bin/xz";' >> "$CONFFILE"
+ COMPRESSOR_CMD='xz --format=lzma'
+ else
+ msgtest 'Test for availability of compressor' "${COMPRESSOR}"
+ msgfail
+ fi
+}
+
setupsimplenativepackage() {
local NAME="$1"
local ARCH="$2"