summaryrefslogtreecommitdiff
path: root/test/integration
diff options
context:
space:
mode:
Diffstat (limited to 'test/integration')
-rwxr-xr-xtest/integration/test-apt-ftparchive-cachedb30
-rwxr-xr-xtest/integration/test-apt-ftparchive-src-cachedb60
2 files changed, 46 insertions, 44 deletions
diff --git a/test/integration/test-apt-ftparchive-cachedb b/test/integration/test-apt-ftparchive-cachedb
index 0e1986bcd..866e5a469 100755
--- a/test/integration/test-apt-ftparchive-cachedb
+++ b/test/integration/test-apt-ftparchive-cachedb
@@ -69,32 +69,38 @@ buildsimplenativepackage 'foo' 'i386' '1' 'test'
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 -q=0 -o APT::FTPArchive::ShowCacheMisses=1
+cp rootdir/tmp/testsuccess.output stats-out.txt
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
+testsuccess grep Misses stats-out.txt
+testfileequal 'rootdir/tmp/testsuccess.output' ' Misses in Cache: 2
+ dists/test/Contents-i386: New 402 B Misses in Cache: 0'
# generate again
-aptftparchive generate ftparchive.conf -o APT::FTPArchive::ShowCacheMisses=1 2> stats-out.txt
+testsuccess aptftparchive generate ftparchive.conf -q=0 -o APT::FTPArchive::ShowCacheMisses=1
+cp rootdir/tmp/testsuccess.output stats-out.txt
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
+testsuccess grep Misses stats-out.txt
+testfileequal 'rootdir/tmp/testsuccess.output' ' Misses in Cache: 0
+ dists/test/Contents-i386: Misses in Cache: 0'
# 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 -q=0 -o APT::FTPArchive::ShowCacheMisses=1
+cp rootdir/tmp/testsuccess.output stats-out.txt
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
+testsuccess grep Misses stats-out.txt
+testfileequal 'rootdir/tmp/testsuccess.output' ' Misses in Cache: 0
+ dists/test/Contents-i386: New 402 B Misses in Cache: 0'
# 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 "packages-main-i386.db" aptftparchive clean ftparchive.conf -q=0
+testsuccess aptftparchive clean ftparchive.conf -q=0 -o Debug::APT::FTPArchive::Clean=1
+cp rootdir/tmp/testsuccess.output clean-out.txt
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
-
diff --git a/test/integration/test-apt-ftparchive-src-cachedb b/test/integration/test-apt-ftparchive-src-cachedb
index e7b148530..6e857c0cb 100755
--- a/test/integration/test-apt-ftparchive-src-cachedb
+++ b/test/integration/test-apt-ftparchive-src-cachedb
@@ -106,28 +106,22 @@ mkdir -p aptarchive/dists/test/main/source/
mkdir aptarchive-overrides
mkdir aptarchive-cache
-
-
-# generate with --db option
-(cd aptarchive && aptftparchive --db ./test.db sources pool/main/ \
- -o APT::FTPArchive::ShowCacheMisses=1 \
- > dists/test/main/source/Sources \
- 2> stats-out.txt
- testequal " Misses in Cache: 2" grep Misses stats-out.txt
-)
+msgtest 'generate with --db option'
+cd aptarchive
+aptftparchive --db ./test.db sources pool/main/ -q=0 -o APT::FTPArchive::ShowCacheMisses=1 > dists/test/main/source/Sources 2>stats-out.txt && msgpass || msgfail
+testsuccess grep Misses stats-out.txt
+testfileequal '../rootdir/tmp/testsuccess.output' ' Misses in Cache: 2'
+cd ..
assert_correct_sources_file
-# generate with --db option (again to ensure its in the cache)
-(cd aptarchive && aptftparchive --db ./test.db sources pool/main/ \
- -o APT::FTPArchive::ShowCacheMisses=1 \
- > dists/test/main/source/Sources \
- 2> stats-out.txt
- testequal " Misses in Cache: 0" grep Misses stats-out.txt
-)
+msgtest 'generate with --db option (again to ensure its in the cache)'
+cd aptarchive
+aptftparchive --db ./test.db sources pool/main/ -q=0 -o APT::FTPArchive::ShowCacheMisses=1 > dists/test/main/source/Sources 2>stats-out.txt && msgpass || msgfail
+testsuccess grep Misses stats-out.txt
+testfileequal '../rootdir/tmp/testsuccess.output' ' Misses in Cache: 0'
+cd ..
assert_correct_sources_file
-
-
# get ready for the "apt-ftparchive generate" command
cat > apt-ftparchive.conf <<"EOF"
Dir {
@@ -159,20 +153,21 @@ Tree "dists/test" {
};
EOF
-# generate (empty cachedb)
-aptftparchive generate apt-ftparchive.conf -o APT::FTPArchive::ShowCacheMisses=1 2> stats-out.txt
-testequal " Misses in Cache: 2" grep Misses stats-out.txt
+msgtest 'generate (empty cachedb)'
+testsuccess aptftparchive generate apt-ftparchive.conf -q=0 -o APT::FTPArchive::ShowCacheMisses=1
+cp rootdir/tmp/testsuccess.output stats-out.txt
+testsuccess grep Misses stats-out.txt
+testfileequal rootdir/tmp/testsuccess.output ' Misses in Cache: 2'
assert_correct_sources_file
-
-# generate again out of the cache
+msgtest 'generate again out of the cache'
rm -f ./aptarchive/dists/test/main/source/Sources
-aptftparchive generate apt-ftparchive.conf -o APT::FTPArchive::ShowCacheMisses=1 2> stats-out.txt
-testequal " Misses in Cache: 0" grep Misses stats-out.txt
+testsuccess aptftparchive generate apt-ftparchive.conf -q=0 -o APT::FTPArchive::ShowCacheMisses=1
+cp rootdir/tmp/testsuccess.output stats-out.txt
+testsuccess grep Misses stats-out.txt
+testfileequal rootdir/tmp/testsuccess.output ' Misses in Cache: 0'
assert_correct_sources_file
-
-
# generate invalid files
mkdir aptarchive/pool/invalid
printf "meep" > aptarchive/pool/invalid/invalid_1.0.dsc
@@ -191,8 +186,9 @@ E: DSC file 'aptarchive/pool/invalid/toobig_1.0.dsc' is too large!" aptftparchiv
# ensure clean works
rm -f aptarchive/pool/main/*
-aptftparchive clean apt-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 "sources-main.db" grep sources-main.db clean-out.txt
-
-
+testsuccess aptftparchive clean apt-ftparchive.conf -q=0 -o Debug::APT::FTPArchive::Clean=1
+cp rootdir/tmp/testsuccess.output clean-out.txt
+testsuccess grep unique clean-out.txt
+testfileequal 'rootdir/tmp/testsuccess.output' "0 Number of unique keys in the tree"
+testsuccess grep sources-main.db clean-out.txt
+testfileequal 'rootdir/tmp/testsuccess.output' "sources-main.db"