summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authormartin@piware.de <>2010-06-17 13:41:48 +0200
committermartin@piware.de <>2010-06-17 13:41:48 +0200
commit0311890f60a1075222acf066a6405cb452b475d0 (patch)
tree61c95b60b38ab53e3132f4ce88745170f9e5dab7 /test
parenteee5ab3cb4a20a26468e6a0dc78ca0706b2b4ec6 (diff)
test-indexes.sh: Also test compressed index mode with apt.conf.d file
Diffstat (limited to 'test')
-rwxr-xr-xtest/test-indexes.sh29
1 files changed, 27 insertions, 2 deletions
diff --git a/test/test-indexes.sh b/test/test-indexes.sh
index 84413d2dd..ce2c36481 100755
--- a/test/test-indexes.sh
+++ b/test/test-indexes.sh
@@ -33,12 +33,16 @@ check_update() {
rm -f etc/apt/trusted.gpg etc/apt/secring.gpg
touch etc/apt/trusted.gpg etc/apt/secring.gpg
find var/lib/apt/lists/ -type f | xargs -r rm
+
+ # first attempt should fail, no trusted GPG key
out=$($APT_GET "$@" update 2>&1)
echo "$out" | grep -q NO_PUBKEY
key=$(echo "$out" | sed -n '/NO_PUBKEY/ { s/^.*NO_PUBKEY \([[:alnum:]]\+\)$/\1/; p}')
+
# get keyring
gpg -q --no-options --no-default-keyring --secret-keyring etc/apt/secring.gpg --trustdb-name etc/apt/trustdb.gpg --keyring etc/apt/trusted.gpg --primary-keyring etc/apt/trusted.gpg --keyserver $GPG_KEYSERVER --recv-keys $key
+ # now it should work
echo "--- apt-get update $@ (with trusted keys)"
find var/lib/apt/lists/ -type f | xargs -r rm
$APT_GET "$@" update
@@ -130,7 +134,6 @@ echo 'RootDir ".";' > apt_config
export APT_CONFIG=`pwd`/apt_config
echo "===== uncompressed indexes ====="
-# first attempt should fail, no trusted GPG key
check_update
check_indexes
check_cache
@@ -147,7 +150,7 @@ $APT_GET -o Acquire::PDiffs=true update
check_indexes
check_cache
-echo "===== compressed indexes ====="
+echo "===== compressed indexes (CLI option) ====="
check_update -o Acquire::GzipIndexes=true
check_indexes compressed
check_cache
@@ -164,4 +167,26 @@ $APT_GET -o Acquire::GzipIndexes=true -o Acquire::PDiffs=true update
check_indexes compressed
check_cache
+echo "===== compressed indexes (apt.conf.d option) ====="
+cat <<EOF > etc/apt/apt.conf.d/02compress-indexes
+Acquire::GzipIndexes "true";
+Acquire::CompressionTypes::Order:: "gz";
+EOF
+
+check_update
+check_indexes compressed
+check_cache
+check_install
+check_get_source
+
+echo "--- apt-get update with preexisting indexes"
+$APT_GET update
+check_indexes compressed
+check_cache
+
+echo "--- apt-get update with preexisting indexes and pdiff mode"
+$APT_GET -o Acquire::PDiffs=true update
+check_indexes compressed
+check_cache
+
echo "===== ALL TESTS PASSED ====="