]> git.saurik.com Git - apt.git/blobdiff - test/integration/test-apt-ftparchive-cachedb
accept ../ on the cmdline as start for a deb file as well
[apt.git] / test / integration / test-apt-ftparchive-cachedb
index 147272a2c4d0f5599b0bfb1b60f779514ef7eea9..889e45cbec1d977d3b2df970d1bc31357827c605 100755 (executable)
@@ -3,20 +3,20 @@ set -e
 
 ensure_correct_packages_file() {
     testequal "Package: foo
 
 ensure_correct_packages_file() {
     testequal "Package: foo
+Architecture: i386
+Version: 1
 Priority: optional
 Section: others
 Priority: optional
 Section: others
-Installed-Size: 29
 Maintainer: Joe Sixpack <joe@example.org>
 Maintainer: Joe Sixpack <joe@example.org>
-Architecture: i386
-Version: 1
-Filename: pool/main/foo_1_i386.deb" head -n8 ./aptarchive/dists/test/main/binary-i386/Packages 
+$(dpkg-deb -I ./aptarchive/pool/main/foo_1_i386.deb | grep 'Installed-Size:' | sed 's#^ ##')
+Filename: pool/main/foo_1_i386.deb" head -n8 ./aptarchive/dists/test/main/binary-i386/Packages
 }
 
 ensure_correct_contents_file() {
 }
 
 ensure_correct_contents_file() {
-    testequal "usr/bin/foo-i386                                            others/foo
+    testfileequal ./aptarchive/dists/test/Contents-i386 "usr/bin/foo-i386                                          others/foo
 usr/share/doc/foo/FEATURES                                 others/foo
 usr/share/doc/foo/changelog                                others/foo
 usr/share/doc/foo/FEATURES                                 others/foo
 usr/share/doc/foo/changelog                                others/foo
-usr/share/doc/foo/copyright                                others/foo" cat ./aptarchive/dists/test/Contents-i386
+usr/share/doc/foo/copyright                                others/foo"
 }
 
 #
 }
 
 #
@@ -25,7 +25,7 @@ usr/share/doc/foo/copyright                               others/foo" cat ./aptarchive/dists/test/Conte
 TESTDIR=$(readlink -f $(dirname $0))
 . $TESTDIR/framework
 setupenvironment
 TESTDIR=$(readlink -f $(dirname $0))
 . $TESTDIR/framework
 setupenvironment
-configarchitecture "i386"
+configarchitecture 'i386'
 
 mkdir -p aptarchive/dists/test/main/i18n/
 mkdir -p aptarchive/dists/test/main/source/
 
 mkdir -p aptarchive/dists/test/main/i18n/
 mkdir -p aptarchive/dists/test/main/source/
@@ -69,32 +69,35 @@ buildsimplenativepackage 'foo' 'i386' '1' 'test'
 mv incoming/* aptarchive/pool/main/
 
 # generate (empty cachedb)
 mv incoming/* aptarchive/pool/main/
 
 # generate (empty cachedb)
-aptftparchive generate ftparchive.conf -o APT::FTPArchive::ShowCacheMisses=1 2> stats-out.txt
+testsuccess aptftparchive generate ftparchive.conf -o APT::FTPArchive::ShowCacheMisses=1
+cp rootdir/tmp/testsuccess.output stats-out.txt
 ensure_correct_packages_file
 ensure_correct_contents_file
 ensure_correct_packages_file
 ensure_correct_contents_file
-testequal " Misses in Cache: 2
- dists/test/Contents-i386: New 402 B  Misses in Cache: 0" grep Misses stats-out.txt
+testsuccessequal ' Misses in Cache: 2
+ dists/test/Contents-i386: New 402 B  Misses in Cache: 0' grep Misses stats-out.txt
 
 # generate again
 
 # generate again
-aptftparchive generate ftparchive.conf -o APT::FTPArchive::ShowCacheMisses=1 2> stats-out.txt
+testsuccess aptftparchive generate ftparchive.conf -o APT::FTPArchive::ShowCacheMisses=1
+cp rootdir/tmp/testsuccess.output stats-out.txt
 ensure_correct_packages_file
 ensure_correct_contents_file
 ensure_correct_packages_file
 ensure_correct_contents_file
-testequal " Misses in Cache: 0
- dists/test/Contents-i386:  Misses in Cache: 0" grep Misses stats-out.txt
+testsuccessequal ' Misses in Cache: 0
+ dists/test/Contents-i386:  Misses in Cache: 0' grep Misses stats-out.txt
 
 # and again (with removing the Packages file)
 rm -f ./aptarchive/dists/test/main/binary-i386/*
 rm -f ./aptarchive/dists/test/Contents-i386
 
 # and again (with removing the Packages file)
 rm -f ./aptarchive/dists/test/main/binary-i386/*
 rm -f ./aptarchive/dists/test/Contents-i386
-aptftparchive generate ftparchive.conf -o APT::FTPArchive::ShowCacheMisses=1 2> stats-out.txt
+testsuccess aptftparchive generate ftparchive.conf -o APT::FTPArchive::ShowCacheMisses=1
+cp rootdir/tmp/testsuccess.output stats-out.txt
 ensure_correct_packages_file
 ensure_correct_contents_file
 ensure_correct_packages_file
 ensure_correct_contents_file
-testequal " Misses in Cache: 0
- dists/test/Contents-i386: New 402 B  Misses in Cache: 0" grep Misses stats-out.txt
+testsuccessequal ' Misses in Cache: 0
+ dists/test/Contents-i386: New 402 B  Misses in Cache: 0' grep Misses stats-out.txt
 
 # and clean
 rm -rf aptarchive/pool/main/*
 
 # and clean
 rm -rf aptarchive/pool/main/*
-testequal "packages-main-i386.db" aptftparchive clean ftparchive.conf
-aptftparchive clean ftparchive.conf -o Debug::APT::FTPArchive::Clean=1 > clean-out.txt 2>&1 
-testequal "0   Number of unique keys in the tree" grep unique clean-out.txt
-testequal "packages-main-i386.db" grep packages-main-i386.db clean-out.txt
-
+testsuccessequal "packages-main-i386.db" aptftparchive clean ftparchive.conf
+testsuccess aptftparchive clean ftparchive.conf -o Debug::APT::FTPArchive::Clean=1
+cp rootdir/tmp/testsuccess.output clean-out.txt
+testsuccessequal "0    Number of unique keys in the tree" grep unique clean-out.txt
+testsuccessequal "packages-main-i386.db" grep packages-main-i386.db clean-out.txt