summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rwxr-xr-xtest/integration/test-apt-cli-show9
-rwxr-xr-xtest/integration/test-apt-sources-deb82246
-rw-r--r--test/libapt/sourcelist_test.cc18
3 files changed, 45 insertions, 28 deletions
diff --git a/test/integration/test-apt-cli-show b/test/integration/test-apt-cli-show
index 0ab3d2e56..91cc9a3c0 100755
--- a/test/integration/test-apt-cli-show
+++ b/test/integration/test-apt-cli-show
@@ -10,20 +10,23 @@ configarchitecture "i386"
DESCR='Some description
That has multiple lines'
insertpackage 'unstable' 'foo' 'all' '1.0' '' '' "$DESCR"
+insertinstalledpackage 'foo' 'all' '1.0'
setupaptarchive
APTARCHIVE=$(readlink -f ./aptarchive)
# note that we do not display Description-md5 with the "apt" cmd
+# and also show some additional fields that are calculated
testequal "Package: foo
Priority: optional
Section: other
-Installed-Size: 42
+Installed-Size: 43.0 kB
Maintainer: Joe Sixpack <joe@example.org>
-Architecture: all
Version: 1.0
-Filename: pool/main/foo/foo_1.0_all.deb
+Download-Size: unknown
+APT-Manual-Installed: yes
+APT-Sources: file:$APTARCHIVE/ unstable/main i386 Packages
Description: Some description
That has multiple lines
" apt show foo
diff --git a/test/integration/test-apt-sources-deb822 b/test/integration/test-apt-sources-deb822
index 723796018..742adb5e2 100755
--- a/test/integration/test-apt-sources-deb822
+++ b/test/integration/test-apt-sources-deb822
@@ -10,15 +10,14 @@ configarchitecture 'i386'
SOURCES='rootdir/etc/apt/sources.list'
BASE='# some comment
# that contains a : as well
-#Type: meep
+#Types: meep
-Type: deb
-URI: http://ftp.debian.org/debian
+Types: deb
+URIs: http://ftp.debian.org/debian
Suites: stable
Sections: main
-Comment: Some random string
- that can be very long'
-
+Description: summay
+ and the long part'
msgtest 'Test old-style sources.list'
echo "deb http://ftp.debian.org/debian stable main" > $SOURCES
@@ -33,15 +32,6 @@ testequal --nomsg "'http://ftp.debian.org/debian/dists/stable/main/binary-i386/P
'http://ftp.debian.org/debian/dists/stable/InRelease' ftp.debian.org_debian_dists_stable_InRelease 0 " aptget update --print-uris
-msgtest 'Test deb822 with two sections' 'seperated by comma'
-echo "$BASE" | sed 's/main/main contrib/' > $SOURCES
-testequal --nomsg "'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 :
-'http://ftp.debian.org/debian/dists/stable/InRelease' ftp.debian.org_debian_dists_stable_InRelease 0 " aptget update --print-uris
-
-
msgtest 'Test deb822 with' 'two entries'
# Two entries
echo "$BASE" > $SOURCES
@@ -78,10 +68,32 @@ echo "deb http://ftp.debian.org" > $SOURCES
testequal --nomsg "E: Malformed line 1 in source list $TMPWORKINGDIRECTORY/rootdir/etc/apt/sources.list (dist)
E: The list of sources could not be read." aptget update --print-uris
-
msgtest 'Test deb822 sources.list file which has' 'malformed URI'
-echo "Type: deb
+echo "Types: deb
Suites: stable
" > $SOURCES
testequal --nomsg "E: Malformed stanza 0 in source list $TMPWORKINGDIRECTORY/rootdir/etc/apt/sources.list (URI parse)
E: The list of sources could not be read." aptget update --print-uris
+
+# with Enabled: false
+echo "$BASE" > $SOURCES
+echo "Enabled: no" >> $SOURCES
+testempty aptget update --print-uris
+
+# multiple URIs
+msgtest 'Test deb822 sources.list file which has' 'Multiple URIs work'
+echo "$BASE" | sed -e 's#http://ftp.debian.org/debian#http://ftp.debian.org/debian http://ftp.de.debian.org/debian#' > $SOURCES
+testequal --nomsg "'http://ftp.de.debian.org/debian/dists/stable/main/binary-i386/Packages.bz2' ftp.de.debian.org_debian_dists_stable_main_binary-i386_Packages 0 :
+'http://ftp.de.debian.org/debian/dists/stable/main/i18n/Translation-en.bz2' ftp.de.debian.org_debian_dists_stable_main_i18n_Translation-en 0 :
+'http://ftp.de.debian.org/debian/dists/stable/InRelease' ftp.de.debian.org_debian_dists_stable_InRelease 0
+'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
+
+# multiple Type in one field
+msgtest 'Test deb822 sources.list file which has' 'Multiple Types work'
+echo "$BASE" | sed -e 's#Types: deb#Types: deb deb-src#' > $SOURCES
+testequal --nomsg "'http://ftp.debian.org/debian/dists/stable/main/source/Sources.bz2' ftp.debian.org_debian_dists_stable_main_source_Sources 0 :
+'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
diff --git a/test/libapt/sourcelist_test.cc b/test/libapt/sourcelist_test.cc
index 701eeeaa7..0300ce929 100644
--- a/test/libapt/sourcelist_test.cc
+++ b/test/libapt/sourcelist_test.cc
@@ -21,18 +21,20 @@ void remove_tmpfile(void)
int main(int argc, char *argv[])
{
+ _config->Set("APT::Sources::Use-Deb822", true);
+
const char contents[] = ""
- "Type: deb\n"
- "URI: http://ftp.debian.org/debian\n"
+ "Types: deb\n"
+ "URIs: http://ftp.debian.org/debian\n"
"Suites: stable\n"
"Sections: main\n"
- "Comment: Some random string\n"
- " that can be very long\n"
+ "Description: short\n"
+ " long description that can be very long\n"
"\n"
- "Type: deb\n"
- "URI: http://ftp.debian.org/debian\n"
- "Suite: unstable\n"
- "Section: main non-free\n"
+ "Types: deb\n"
+ "URIs: http://ftp.debian.org/debian\n"
+ "Suites: unstable\n"
+ "Sections: main non-free\n"
;
FileFd fd;