diff options
author | David Kalnischkies <david@kalnischkies.de> | 2015-08-27 10:41:19 +0200 |
---|---|---|
committer | David Kalnischkies <david@kalnischkies.de> | 2015-08-27 11:27:45 +0200 |
commit | e6a12ff73a2e3246b9e475d9772e88c79a6249f7 (patch) | |
tree | 2f7614aa4d9d80ba0de716ee3a7f369ef74c38ec /test/integration/test-sourceslist-target-plusminus-options | |
parent | b47b1222a3d23d74d59465b98d97f8871c7c8ad2 (diff) |
allow explicit dis/enable of IndexTargets in sources options
While Target{,-Add,-Remove} is available for configuring IndexTargets
already, allow Targets to be mentioned explicitely as yes/no options as
well, so that the Target 'Contents' can be disabled via 'Contents: no'
as well as 'Target-Remove: Contents'.
Diffstat (limited to 'test/integration/test-sourceslist-target-plusminus-options')
-rwxr-xr-x | test/integration/test-sourceslist-target-plusminus-options | 66 |
1 files changed, 66 insertions, 0 deletions
diff --git a/test/integration/test-sourceslist-target-plusminus-options b/test/integration/test-sourceslist-target-plusminus-options new file mode 100755 index 000000000..00d9085a0 --- /dev/null +++ b/test/integration/test-sourceslist-target-plusminus-options @@ -0,0 +1,66 @@ +#!/bin/sh +set -e + +TESTDIR=$(readlink -f $(dirname $0)) +. $TESTDIR/framework +setupenvironment +configarchitecture 'amd64' + +testtargets() { + msgtest 'Test acquired targets for' "$1" + shift + while [ -n "$1" ]; do + echo "$1" + shift + done | sort -u > expectedtargets.lst + aptget indextargets --no-release-info --format='$(CREATED_BY)' | sort -u > gottargets.lst + testfileequal --nomsg ./expectedtargets.lst "$(cat ./gottargets.lst)" +} + +echo 'deb http://example.org/debian stable rocks' > rootdir/etc/apt/sources.list +testtargets 'default' 'Packages' 'Translations' + +cat > rootdir/etc/apt/apt.conf.d/content-target.conf <<EOF +Acquire::IndexTargets::deb::Contents { + MetaKey "\$(COMPONENT)/Contents-\$(ARCHITECTURE)"; + ShortDescription "Contents"; + Description "\$(RELEASE)/\$(COMPONENT) \$(ARCHITECTURE) Contents"; +}; +EOF +testtargets 'default + Contents' 'Packages' 'Translations' 'Contents' + +echo 'deb [target=Packages] http://example.org/debian stable rocks' > rootdir/etc/apt/sources.list +testtargets 'force Packages target' 'Packages' + +echo 'deb [target=Contents] http://example.org/debian stable rocks' > rootdir/etc/apt/sources.list +testtargets 'force Contents target' 'Contents' + +echo 'deb [target=Translations,Contents] http://example.org/debian stable rocks' > rootdir/etc/apt/sources.list +testtargets 'force two targets' 'Contents' 'Translations' + +echo 'deb [target+=Translations,Contents] http://example.org/debian stable rocks' > rootdir/etc/apt/sources.list +testtargets 'add existing' 'Packages' 'Contents' 'Translations' + +echo 'deb [target+=AppStream] http://example.org/debian stable rocks' > rootdir/etc/apt/sources.list +testtargets 'add non-existing' 'Packages' 'Contents' 'Translations' + +echo 'deb [target-=Translations,Contents] http://example.org/debian stable rocks' > rootdir/etc/apt/sources.list +testtargets 'remove existing' 'Packages' + +echo 'deb [target-=AppStream] http://example.org/debian stable rocks' > rootdir/etc/apt/sources.list +testtargets 'remove non-existing' 'Packages' 'Contents' 'Translations' + +echo 'deb [AppStream=yes] http://example.org/debian stable rocks' > rootdir/etc/apt/sources.list +testtargets 'activate non-existing' 'Packages' 'Contents' 'Translations' + +echo 'deb [AppStream=no] http://example.org/debian stable rocks' > rootdir/etc/apt/sources.list +testtargets 'deactivate non-existing' 'Packages' 'Contents' 'Translations' + +echo 'deb [Contents=yes] http://example.org/debian stable rocks' > rootdir/etc/apt/sources.list +testtargets 'activate existing' 'Packages' 'Contents' 'Translations' + +echo 'deb [Contents=no] http://example.org/debian stable rocks' > rootdir/etc/apt/sources.list +testtargets 'deactivate existing' 'Packages' 'Translations' + +echo 'deb [target=Packages Contents=yes] http://example.org/debian stable rocks' > rootdir/etc/apt/sources.list +testtargets 'explicit + activate' 'Packages' 'Contents' |