summaryrefslogtreecommitdiff
path: root/test/integration/framework
diff options
context:
space:
mode:
authorMichael Vogt <mvo@ubuntu.com>2014-09-29 08:33:33 +0200
committerMichael Vogt <mvo@ubuntu.com>2014-09-29 08:33:33 +0200
commit48f3f1b24b48066cfc23342a5c6470ddf5e0fa6a (patch)
tree60fdc3dc5d238257bc85ea560cc63a697118ace3 /test/integration/framework
parentffbe056dc554b3f1fdf79b4726415a70f6d59dc1 (diff)
parente359fe101e1a66277b340563c96e868451d9d4b5 (diff)
Merge branch 'debian/sid' into debian/experimental
Conflicts: apt-pkg/acquire-item.cc
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 fcdca34ce..e83606fae 100644
--- a/test/integration/framework
+++ b/test/integration/framework
@@ -320,6 +320,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"