summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorDavid Kalnischkies <david@kalnischkies.de>2016-07-20 09:03:09 +0200
committerDavid Kalnischkies <david@kalnischkies.de>2016-07-22 16:04:36 +0200
commite8e5d464623f1c2e1ef96b14e622728bbf4b89af (patch)
treef6fbf65515d407298d03b6584529f0d990f16739 /test
parent36d5299aacb950aeb8cb117fa603abb21643d844 (diff)
allow arch=all to override No-Support-for-Architecture-all
If a user explicitly requests the download of arch:all apt shouldn't get in the way and perform its detection dance if arch:all packages are (also) in arch:any files or not. This e.g. allows setting arch=all on a source with such a field (or one which doesn't support all at all, but has the arch:all files like Debian itself ATM) to get only the arch:all packages from there instead of behaving like a no-op. Reported-By: Helmut Grohne on IRC
Diffstat (limited to 'test')
-rwxr-xr-xtest/integration/test-acquire-binary-all32
-rwxr-xr-xtest/integration/test-apt-sources-deb8226
-rwxr-xr-xtest/integration/test-sourceslist-arch-plusminus-options3
3 files changed, 38 insertions, 3 deletions
diff --git a/test/integration/test-acquire-binary-all b/test/integration/test-acquire-binary-all
index d428c106d..ba47eddc2 100755
--- a/test/integration/test-acquire-binary-all
+++ b/test/integration/test-acquire-binary-all
@@ -18,6 +18,7 @@ Acquire::IndexTargets::deb::Contents {
KeepCompressed "true";
};
EOF
+cp -a rootdir/etc/apt/sources.list.d rootdir/etc/apt/sources.list.d.bak
msgmsg 'Releasefile with Architectures field and all included'
testsuccess apt update
@@ -39,6 +40,16 @@ testequal 'foo-1
foo-2' aptcache pkgnames foo-
rm -rf rootdir/var/lib/apt/lists
+msgmsg 'Releasefile with Architectures field and all included, but arch-=all'
+sed -i 's#^deb\(-src\)\? #deb\1 [arch-=all] #' rootdir/etc/apt/sources.list.d/*
+testsuccesswithnotice apt update
+cp -a rootdir/etc/apt/sources.list.d.bak/* rootdir/etc/apt/sources.list.d/
+cp rootdir/tmp/testsuccess.output aptupdate.output
+testfailure grep '^Get.* all Packages ' aptupdate.output
+testfailure grep '^Get.* all Contents ' aptupdate.output
+testequal 'foo-2' aptcache pkgnames foo-
+
+rm -rf rootdir/var/lib/apt/lists
msgmsg 'Releasefile has all, but forbids its usage'
configarchitecture 'amd64'
sed -i '/^Architectures: / a\
@@ -51,6 +62,16 @@ testsuccess grep '^Get.* all Contents ' aptupdate.output
sed -i '/^No-Support-for-Architecture-all: / d' $(find ./aptarchive -name 'Release')
rm -rf rootdir/var/lib/apt/lists
+msgmsg 'Releasefile has all, forbids its usage, but it is forced with arch=all'
+sed -i 's#^deb\(-src\)\? #deb\1 [arch=all] #' rootdir/etc/apt/sources.list.d/*
+testsuccess apt update
+cp -a rootdir/etc/apt/sources.list.d.bak/* rootdir/etc/apt/sources.list.d/
+cp rootdir/tmp/testsuccess.output aptupdate.output
+testsuccess grep '^Get.* all Packages ' aptupdate.output
+testsuccess grep '^Get.* all Contents ' aptupdate.output
+testequal 'foo-1' aptcache pkgnames foo-
+
+rm -rf rootdir/var/lib/apt/lists
msgmsg 'Releasefile with Architectures field but without all'
configarchitecture 'amd64' 'i386'
getarchitecturesfromreleasefile() { echo "$(getarchitectures)"; }
@@ -70,6 +91,17 @@ testfailure grep '^Get.* all Contents ' aptupdate.output
testequal 'foo-2' aptcache pkgnames foo-
rm -rf rootdir/var/lib/apt/lists
+msgmsg 'Releasefile with Architectures field but without all forced with arch+=all'
+sed -i 's#^deb\(-src\)\? #deb\1 [arch+=all] #' rootdir/etc/apt/sources.list.d/*
+testsuccess apt update
+cp -a rootdir/etc/apt/sources.list.d.bak/* rootdir/etc/apt/sources.list.d/
+cp rootdir/tmp/testsuccess.output aptupdate.output
+testsuccess grep '^Get.* all Packages ' aptupdate.output
+testsuccess grep '^Get.* all Contents ' aptupdate.output
+testequal 'foo-1
+foo-2' aptcache pkgnames foo-
+
+rm -rf rootdir/var/lib/apt/lists
msgmsg 'Releasefile without Architectures field'
getarchitecturesfromreleasefile() { echo -n ''; }
generatereleasefiles
diff --git a/test/integration/test-apt-sources-deb822 b/test/integration/test-apt-sources-deb822
index 9f761cb1c..abb31b793 100755
--- a/test/integration/test-apt-sources-deb822
+++ b/test/integration/test-apt-sources-deb822
@@ -66,9 +66,9 @@ msgcleantest 'Test sources.list' 'old style with options'
echo "deb [trusted=yes arch+=armel,powerpc] http://ftp.debian.org/debian stable main" > $LISTS
testsuccessequal --nomsg "'http://ftp.debian.org/debian/dists/stable/InRelease' ftp.debian.org_debian_dists_stable_InRelease 0
'http://ftp.debian.org/debian/dists/stable/main/binary-i386/Packages.xz' ftp.debian.org_debian_dists_stable_main_binary-i386_Packages 0
-'http://ftp.debian.org/debian/dists/stable/main/binary-all/Packages.xz' ftp.debian.org_debian_dists_stable_main_binary-all_Packages 0
'http://ftp.debian.org/debian/dists/stable/main/binary-armel/Packages.xz' ftp.debian.org_debian_dists_stable_main_binary-armel_Packages 0
'http://ftp.debian.org/debian/dists/stable/main/binary-powerpc/Packages.xz' ftp.debian.org_debian_dists_stable_main_binary-powerpc_Packages 0
+'http://ftp.debian.org/debian/dists/stable/main/binary-all/Packages.xz' ftp.debian.org_debian_dists_stable_main_binary-all_Packages 0
'http://ftp.debian.org/debian/dists/stable/main/i18n/Translation-en.xz' ftp.debian.org_debian_dists_stable_main_i18n_Translation-en 0 " aptget update --print-uris
msgcleantest 'Test sources.list' 'old style with comments'
@@ -197,5 +197,5 @@ echo "Languages-Remove: en" >> $SOURCES
echo "Architectures-Add: armel" >> $SOURCES
testsuccessequal --nomsg "'http://ftp.debian.org/debian/dists/stable/InRelease' ftp.debian.org_debian_dists_stable_InRelease 0
'http://ftp.debian.org/debian/dists/stable/main/binary-i386/Packages.xz' ftp.debian.org_debian_dists_stable_main_binary-i386_Packages 0
-'http://ftp.debian.org/debian/dists/stable/main/binary-all/Packages.xz' ftp.debian.org_debian_dists_stable_main_binary-all_Packages 0
-'http://ftp.debian.org/debian/dists/stable/main/binary-armel/Packages.xz' ftp.debian.org_debian_dists_stable_main_binary-armel_Packages 0 " aptget update --print-uris
+'http://ftp.debian.org/debian/dists/stable/main/binary-armel/Packages.xz' ftp.debian.org_debian_dists_stable_main_binary-armel_Packages 0
+'http://ftp.debian.org/debian/dists/stable/main/binary-all/Packages.xz' ftp.debian.org_debian_dists_stable_main_binary-all_Packages 0 " aptget update --print-uris
diff --git a/test/integration/test-sourceslist-arch-plusminus-options b/test/integration/test-sourceslist-arch-plusminus-options
index 0ce4aa9f1..fdf33cc8c 100755
--- a/test/integration/test-sourceslist-arch-plusminus-options
+++ b/test/integration/test-sourceslist-arch-plusminus-options
@@ -89,3 +89,6 @@ testbinaries 'substract all from arch-set' 'i386'
echo 'deb [arch=i386 arch+=all] http://example.org/debian stable rocks' > rootdir/etc/apt/sources.list
testbinaries 'useless addition of all' 'i386' 'all'
+
+echo 'deb [arch=all] http://example.org/debian stable rocks' > rootdir/etc/apt/sources.list
+testbinaries 'explicit all' 'all'