summaryrefslogtreecommitdiffstats
path: root/test/integration/test-sourceslist-arch-plusminus-options
blob: fdf33cc8c401a9dc7ca1c47a8dcdc95d6fbefe08 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
#!/bin/sh
set -e

TESTDIR="$(readlink -f "$(dirname "$0")")"
. "$TESTDIR/framework"
setupenvironment
configarchitecture 'amd64'

testbinaries() {
	msgtest 'Test acquired archs for' "$1"
	shift
	rm -f gotarchs.list
	aptget update --print-uris | grep -o '/binary-[a-z0-9-]\+/Packages' | sort > gotarchs.list
	while [ -n "$1" ]; do
		echo "/binary-${1}/Packages"
		shift
	done | sort | checkdiff - gotarchs.list && msgpass || msgfail
}

echo 'deb http://example.org/debian stable rocks' > rootdir/etc/apt/sources.list
testbinaries 'default & native' 'amd64' 'all'
configarchitecture 'amd64' 'i386'
testbinaries 'default & native + foreign' 'amd64' 'i386' 'all'
configarchitecture 'amd64' 'i386' 'armel' 'armhf' 'mips' 'mipsel'
testbinaries 'default & native + many foreigns' 'amd64' 'i386' 'armel' 'armhf' 'mips' 'mipsel' 'all'

echo 'deb [arch=amd64] http://example.org/debian stable rocks' > rootdir/etc/apt/sources.list
testbinaries 'arch=native' 'amd64' 'all'

echo 'deb [arch=mips] http://example.org/debian stable rocks' > rootdir/etc/apt/sources.list
testbinaries 'arch=foreign' 'mips' 'all'

echo 'deb [arch=kfreebsd-armel] http://example.org/debian stable rocks' > rootdir/etc/apt/sources.list
testbinaries 'arch=unknown' 'kfreebsd-armel' 'all'

echo 'deb [arch=amd64,i386] http://example.org/debian stable rocks' > rootdir/etc/apt/sources.list
testbinaries 'arch=native,foreign' 'amd64' 'i386' 'all'

echo 'deb [arch=mips,armhf] http://example.org/debian stable rocks' > rootdir/etc/apt/sources.list
testbinaries 'arch=foreign,foreign' 'mips' 'armhf' 'all'

echo 'deb [arch=kfreebsd-armel,hurd-powerpc,mipsel,armel] http://example.org/debian stable rocks' > rootdir/etc/apt/sources.list
testbinaries 'arch=unknown,unknown,foreign,foreign' 'kfreebsd-armel' 'hurd-powerpc' 'mipsel' 'armel' 'all'

echo 'deb [arch+=amd64] http://example.org/debian stable rocks' > rootdir/etc/apt/sources.list
testbinaries 'arch+=native' 'amd64' 'i386' 'armel' 'armhf' 'mips' 'mipsel' 'all'

echo 'deb [arch+=mips] http://example.org/debian stable rocks' > rootdir/etc/apt/sources.list
testbinaries 'arch+=foreign' 'amd64' 'i386' 'armel' 'armhf' 'mips' 'mipsel' 'all'

echo 'deb [arch+=mips,armhf,i386] http://example.org/debian stable rocks' > rootdir/etc/apt/sources.list
testbinaries 'arch+=foreign,foreign,foreign' 'amd64' 'i386' 'armel' 'armhf' 'mips' 'mipsel' 'all'

echo 'deb [arch+=hurd-powerpc] http://example.org/debian stable rocks' > rootdir/etc/apt/sources.list
testbinaries 'arch+=unknown' 'amd64' 'i386' 'armel' 'armhf' 'mips' 'mipsel' 'hurd-powerpc' 'all'

echo 'deb [arch+=mips,hurd-powerpc,i386] http://example.org/debian stable rocks' > rootdir/etc/apt/sources.list
testbinaries 'arch+=foreign,unknown,foreign' 'amd64' 'i386' 'armel' 'armhf' 'mips' 'mipsel' 'hurd-powerpc' 'all'

echo 'deb [arch-=amd64] http://example.org/debian stable rocks' > rootdir/etc/apt/sources.list
testbinaries 'arch-=native' 'i386' 'armel' 'armhf' 'mips' 'mipsel' 'all'

echo 'deb [arch-=mips] http://example.org/debian stable rocks' > rootdir/etc/apt/sources.list
testbinaries 'arch-=foreign' 'amd64' 'i386' 'armel' 'armhf' 'mipsel' 'all'

echo 'deb [arch-=mips,armhf,i386] http://example.org/debian stable rocks' > rootdir/etc/apt/sources.list
testbinaries 'arch-=foreign,foreign,foreign' 'amd64' 'armel' 'mipsel' 'all'

echo 'deb [arch-=hurd-powerpc] http://example.org/debian stable rocks' > rootdir/etc/apt/sources.list
testbinaries 'arch-=unknown' 'amd64' 'i386' 'armel' 'armhf' 'mips' 'mipsel' 'all'

echo 'deb [arch-=mips,hurd-powerpc,i386] http://example.org/debian stable rocks' > rootdir/etc/apt/sources.list
testbinaries 'arch-=foreign,unknown,foreign' 'amd64' 'armel' 'armhf' 'mipsel' 'all'

echo 'deb [arch=mips,i386 arch-=mips] http://example.org/debian stable rocks' > rootdir/etc/apt/sources.list
testbinaries 'subtract from a arch-set' 'i386' 'all'

echo 'deb [arch=mips,i386 arch-=mips] http://example.org/debian stable rocks' > rootdir/etc/apt/sources.list
testbinaries 'useless subtract from a arch-set' 'i386' 'all'

echo 'deb [arch=mips,i386 arch+=armhf] http://example.org/debian stable rocks' > rootdir/etc/apt/sources.list
testbinaries 'addition to a arch-set' 'i386' 'mips' 'armhf' 'all'

echo 'deb [arch=mips,i386 arch+=mips] http://example.org/debian stable rocks' > rootdir/etc/apt/sources.list
testbinaries 'useless addition to a arch-set' 'i386' 'mips' 'all'

echo 'deb [arch=i386 arch-=all] http://example.org/debian stable rocks' > rootdir/etc/apt/sources.list
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'