3 # Ensure that when going from unauthenticated to authenticated all
4 # files are checked again
8 TESTDIR
=$(readlink -f $(dirname $0))
14 configarchitecture
"i386"
16 insertpackage
'unstable' 'foo' 'all' '1.0'
17 insertsource
'unstable' 'foo' 'all' '1.0'
23 # - also check the unauth -> auth success case, i.e. that all files are
26 # start unauthenticated
27 find rootdir
/var
/lib
/apt
/lists
/ -type f
| xargs rm -f
28 rm -f aptarchive
/dists
/unstable
/*Release
*
30 testsuccess aptget update
-qq --allow-insecure-repositories
32 # FIXME: this really shouldn't be needed
33 rm -f rootdir
/var
/lib
/apt
/lists
/partial
/*
35 # become authenticated
39 # move uncompressed away
40 mv aptarchive
/dists
/unstable
/main
/binary
-i386/Packages \
41 aptarchive
/dists
/unstable
/main
/binary
-i386/Packages.uncompressed
43 # and ensure we re-check the downloaded data
45 # change the local packages file
46 PKGS
=$(ls rootdir/var/lib/apt/lists/*Packages*)
48 ls rootdir
/var
/lib
/apt
/lists
/ > lists.before
50 # update and ensure all is reverted on the hashsum failure
51 testfailure aptget update
-o Debug
::Acquire
::Transaction
=0 -o Debug
::pkgAcquire
::Auth
=1 -o Debug
::pkgAcquire
::worker
=0 -o Debug
::acquire
::http
=0
53 # ensure we have before what we have after
54 msgtest
'Check rollback on going from' 'unauth -> auth'
55 ls rootdir
/var
/lib
/apt
/lists
/ > lists.after
56 if cmp lists.before lists.after
; then
59 echo >&2 '### Output of previous apt-get update ###'
60 cat >&2 rootdir
/tmp
/testfailure.output
61 echo >&2 '### Changes in the lists-directory: ###'
62 diff -u >&2 lists.before lists.after
66 # move uncompressed back for release file
67 mv aptarchive
/dists
/unstable
/main
/binary
-i386/Packages.uncompressed \
68 aptarchive
/dists
/unstable
/main
/binary
-i386/Packages
71 for COMPRESSEDINDEXES
in 'false' 'true'; do
72 echo "Acquire::GzipIndexes \"$COMPRESSEDINDEXES\";" > rootdir
/etc
/apt
/apt.conf.d
/compressindexes
73 if $COMPRESSEDINDEXES; then
74 msgmsg
'Run tests with GzipIndexes enabled'
76 msgmsg
'Run tests with GzipIndexes disabled'