]>
git.saurik.com Git - apt.git/blob - test/integration/test-compressed-indexes
4 TESTDIR
=$(readlink -f $(dirname $0))
8 configarchitecture
"i386"
10 buildsimplenativepackage
"testpkg" "i386" "1.0"
13 local GOODSHOW
="$(aptcache show testpkg)
15 local GOODPOLICY
="$(aptcache policy testpkg)"
16 local GOODSHOWSRC
="$(aptcache showsrc testpkg)
19 test $(echo "$GOODSHOW" | grep -e '^Package: testpkg' -e '^Version: 1.0' -e '^Architecture: i386' | wc -l) -eq 3
20 testequal
"$GOODSHOW" aptcache show testpkg
21 test $(echo "$GOODPOLICY" | grep -e '^testpkg:' -e '^ Candidate:' -e '^ Installed: (none)' -e '500 file:/' | wc -l) -eq 4
22 testequal "$GOODPOLICY" aptcache policy testpkg
23 test $(echo "$GOODSHOWSRC" | grep -e '^Package: testpkg' -e '^Format: 3.0 (native)' -e '^Files:' -e '^Checksums-Sha256:' | wc -l) -eq 4
24 testequal
"$GOODSHOWSRC" aptcache showsrc testpkg
29 if [ -e rootdir
/var
/lib
/apt
/lists
/*localhost
*Release
]; then
30 msgtest
"Check if all index files are" "${1:-uncompressed}"
31 if [ "$1" = "compressed" ]; then
32 ! test -e rootdir
/var
/lib
/apt
/lists
/*_Packages
|| F
=1
33 ! test -e rootdir
/var
/lib
/apt
/lists
/*_Sources
|| F
=1
34 test -e rootdir
/var
/lib
/apt
/lists
/*_Packages.gz
|| F
=1
35 test -e rootdir
/var
/lib
/apt
/lists
/*_Sources.gz
|| F
=1
37 test -e rootdir
/var
/lib
/apt
/lists
/*_Packages
|| F
=1
38 test -e rootdir
/var
/lib
/apt
/lists
/*_Sources
|| F
=1
39 ! test -e rootdir
/var
/lib
/apt
/lists
/*_Packages.gz
|| F
=1
40 ! test -e rootdir
/var
/lib
/apt
/lists
/*_Sources.gz
|| F
=1
43 ls -laR rootdir
/var
/lib
/apt
/lists
/
48 msgtest
"Check if package is downloadable"
49 aptget
install -d testpkg
-qq && msgpass
|| msgfail
50 msgtest
"\tdeb file is present"; test -f rootdir
/var
/cache
/apt
/archives
/testpkg_1.0_i386.deb
&& msgpass
|| msgfail
52 msgtest
"\tdeb file is gone"; ! test -f rootdir
/var
/cache
/apt
/archives
/testpkg_1.0_i386.deb
&& msgpass
|| msgfail
54 rm rootdir
/var
/cache
/apt
/pkgcache.bin rootdir
/var
/cache
/apt
/srcpkgcache.bin
55 testequal
"$GOODSHOW" aptcache show testpkg
56 testequal
"$GOODSHOW" aptcache show testpkg
57 rm rootdir
/var
/cache
/apt
/pkgcache.bin rootdir
/var
/cache
/apt
/srcpkgcache.bin
58 testequal
"$GOODPOLICY" aptcache policy testpkg
59 testequal
"$GOODPOLICY" aptcache policy testpkg
60 rm rootdir
/var
/cache
/apt
/pkgcache.bin rootdir
/var
/cache
/apt
/srcpkgcache.bin
61 testequal
"$GOODSHOWSRC" aptcache showsrc testpkg
62 testequal
"$GOODSHOWSRC" aptcache showsrc testpkg
63 rm -f rootdir
/var
/cache
/apt
/pkgcache.bin rootdir
/var
/cache
/apt
/srcpkgcache.bin
64 rm -rf rootdir
/var
/cache
/apt
/archives
65 msgtest
"Check if the source is aptgetable"
66 aptget
source testpkg
-qq 2> /dev
/null
> /dev
/null
&& msgpass
|| msgfail
67 msgtest
"\tdsc file is present"; test -f testpkg_1.0.dsc
&& msgpass
|| msgfail
68 msgtest
"\tdirectory is present"; test -d testpkg
-1.0
&& msgpass
|| msgfail
72 msgmsg
"File: Test with uncompressed indexes"
75 aptget update
-qq -o Acquire
::Pdiffs
=1
76 msgmsg
"File: Test with uncompressed indexes (update unchanged with pdiffs)"
79 aptget update
-qq -o Acquire
::Pdiffs
=0
80 msgmsg
"File: Test with uncompressed indexes (update unchanged without pdiffs)"
83 rm -rf rootdir
/var
/lib
/apt
/lists
84 echo 'Acquire::CompressionTypes::Order:: "gz";
85 Acquire::GzipIndexes "true";' > rootdir
/etc
/apt
/apt.conf.d
/02compressindex
88 msgmsg
"File: Test with compressed indexes"
91 aptget update
-qq -o Acquire
::Pdiffs
=1
92 msgmsg
"File: Test with compressed indexes (update unchanged with pdiffs)"
95 aptget update
-qq -o Acquire
::Pdiffs
=0
96 msgmsg
"File: Test with compressed indexes (update unchanged without pdiffs)"
99 rm rootdir
/etc
/apt
/apt.conf.d
/02compressindex
102 local GOODPOLICY
="$(aptcache policy testpkg)"
103 test $(echo "$GOODPOLICY" | grep -e '^testpkg:' -e '^ Candidate:' -e '^ Installed: (none)' -e '500 http
://' | wc -l) -eq 4
104 testequal "$GOODPOLICY" aptcache policy testpkg
106 msgmsg "HTTP: Test with uncompressed indexes"
109 aptget update -qq -o Acquire::Pdiffs=1
110 msgmsg "HTTP: Test with uncompressed indexes (update unchanged with pdiffs)"
113 aptget update -qq -o Acquire::Pdiffs=0
114 msgmsg "HTTP: Test with uncompressed indexes (update unchanged without pdiffs)"
117 rm -rf rootdir/var/lib/apt/lists
118 echo 'Acquire
::CompressionTypes
::Order
:: "gz";
119 Acquire
::GzipIndexes
"true";' > rootdir/etc/apt/apt.conf.d/02compressindex
122 msgmsg "HTTP: Test with compressed indexes"
125 aptget update -qq -o Acquire::Pdiffs=1
126 msgmsg "HTTP: Test with compressed indexes (update unchanged with pdiffs)"
129 aptget update -qq -o Acquire::Pdiffs=0
130 msgmsg "HTTP: Test with compressed indexes (update unchanged without pdiffs)"