summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/integration/framework13
-rwxr-xr-xtest/integration/test-apt-sources-deb82221
2 files changed, 27 insertions, 7 deletions
diff --git a/test/integration/framework b/test/integration/framework
index a28363768..6ada1e9cc 100644
--- a/test/integration/framework
+++ b/test/integration/framework
@@ -948,13 +948,22 @@ testempty() {
test -z "$($* 2>&1)" && msgpass || msgfail
}
-testequal() {
+testequalwithmsg() {
+ local MSG="$1"
+ shift
local COMPAREFILE=$(mktemp)
addtrap "rm $COMPAREFILE;"
echo "$1" > $COMPAREFILE
shift
- msgtest "Test for equality of" "$*"
+ msgtest "$MSG"
$* 2>&1 | checkdiff $COMPAREFILE - && msgpass || msgfail
+}
+
+testequal() {
+ local EXPECTED="$1"
+ shift
+ local MSG="Test for equality of $*"
+ testequalwithmsg "$MSG" "$EXPECTED" $*
}
testequalor2() {
diff --git a/test/integration/test-apt-sources-deb822 b/test/integration/test-apt-sources-deb822
index 6e9700bb0..24fb1bdb0 100755
--- a/test/integration/test-apt-sources-deb822
+++ b/test/integration/test-apt-sources-deb822
@@ -7,7 +7,17 @@ TESTDIR=$(readlink -f $(dirname $0))
setupenvironment
configarchitecture "i386"
-BASE="Type: deb
+echo "deb http://ftp.debian.org/debian stable main" > rootdir/etc/apt/sources.list
+testequalwithmsg "Old style sources.list works" "'http://ftp.debian.org/debian/dists/stable/main/binary-i386/Packages.bz2' ftp.debian.org_debian_dists_stable_main_binary-i386_Packages 0 :
+'http://ftp.debian.org/debian/dists/stable/main/i18n/Translation-en.bz2' ftp.debian.org_debian_dists_stable_main_i18n_Translation-en 0 :
+'http://ftp.debian.org/debian/dists/stable/InRelease' ftp.debian.org_debian_dists_stable_InRelease 0 " aptget update --print-uris
+
+
+BASE="# some comment
+# that contains a : as well
+#Type: meep
+
+Type: deb
URL: http://ftp.debian.org/debian
Dist: stable
Section: main
@@ -17,7 +27,7 @@ Comment: Some random string
# simple case
echo "$BASE" > rootdir/etc/apt/sources.list
-testequal "'http://ftp.debian.org/debian/dists/stable/main/binary-i386/Packages.bz2' ftp.debian.org_debian_dists_stable_main_binary-i386_Packages 0 :
+testequalwithmsg "Simple deb822 sources.list works" "'http://ftp.debian.org/debian/dists/stable/main/binary-i386/Packages.bz2' ftp.debian.org_debian_dists_stable_main_binary-i386_Packages 0 :
'http://ftp.debian.org/debian/dists/stable/main/i18n/Translation-en.bz2' ftp.debian.org_debian_dists_stable_main_i18n_Translation-en 0 :
'http://ftp.debian.org/debian/dists/stable/InRelease' ftp.debian.org_debian_dists_stable_InRelease 0 " aptget update --print-uris
@@ -25,7 +35,7 @@ testequal "'http://ftp.debian.org/debian/dists/stable/main/binary-i386/Packages.
# two sections (we support both "," and " " as seperator)
echo "$BASE" | sed s/main/"main,contrib"/ > rootdir/etc/apt/sources.list
-testequal "'http://ftp.debian.org/debian/dists/stable/main/binary-i386/Packages.bz2' ftp.debian.org_debian_dists_stable_main_binary-i386_Packages 0 :
+testequalwithmsg "Two sections deb822 sources.list work" "'http://ftp.debian.org/debian/dists/stable/main/binary-i386/Packages.bz2' ftp.debian.org_debian_dists_stable_main_binary-i386_Packages 0 :
'http://ftp.debian.org/debian/dists/stable/contrib/binary-i386/Packages.bz2' ftp.debian.org_debian_dists_stable_contrib_binary-i386_Packages 0 :
'http://ftp.debian.org/debian/dists/stable/contrib/i18n/Translation-en.bz2' ftp.debian.org_debian_dists_stable_contrib_i18n_Translation-en 0 :
'http://ftp.debian.org/debian/dists/stable/main/i18n/Translation-en.bz2' ftp.debian.org_debian_dists_stable_main_i18n_Translation-en 0 :
@@ -37,7 +47,7 @@ echo "$BASE" > rootdir/etc/apt/sources.list
echo "" >> rootdir/etc/apt/sources.list
echo "$BASE" | sed s/stable/unstable/ >> rootdir/etc/apt/sources.list
-testequal "'http://ftp.debian.org/debian/dists/stable/main/binary-i386/Packages.bz2' ftp.debian.org_debian_dists_stable_main_binary-i386_Packages 0 :
+testequalwithmsg "Multiple entries in deb822 sources.list work" "'http://ftp.debian.org/debian/dists/stable/main/binary-i386/Packages.bz2' ftp.debian.org_debian_dists_stable_main_binary-i386_Packages 0 :
'http://ftp.debian.org/debian/dists/stable/main/i18n/Translation-en.bz2' ftp.debian.org_debian_dists_stable_main_i18n_Translation-en 0 :
'http://ftp.debian.org/debian/dists/stable/InRelease' ftp.debian.org_debian_dists_stable_InRelease 0
'http://ftp.debian.org/debian/dists/unstable/main/binary-i386/Packages.bz2' ftp.debian.org_debian_dists_unstable_main_binary-i386_Packages 0 :
@@ -49,7 +59,8 @@ testequal "'http://ftp.debian.org/debian/dists/stable/main/binary-i386/Packages.
echo "$BASE" > rootdir/etc/apt/sources.list
echo "Arch: amd64,armel" >> rootdir/etc/apt/sources.list
-testequal "'http://ftp.debian.org/debian/dists/stable/main/binary-amd64/Packages.bz2' ftp.debian.org_debian_dists_stable_main_binary-amd64_Packages 0 :
+testequalwithmsg "Arch: option in deb822 sources.list works" "'http://ftp.debian.org/debian/dists/stable/main/binary-amd64/Packages.bz2' ftp.debian.org_debian_dists_stable_main_binary-amd64_Packages 0 :
'http://ftp.debian.org/debian/dists/stable/main/binary-armel/Packages.bz2' ftp.debian.org_debian_dists_stable_main_binary-armel_Packages 0 :
'http://ftp.debian.org/debian/dists/stable/main/i18n/Translation-en.bz2' ftp.debian.org_debian_dists_stable_main_i18n_Translation-en 0 :
'http://ftp.debian.org/debian/dists/stable/InRelease' ftp.debian.org_debian_dists_stable_InRelease 0 " aptget update --print-uris
+