summaryrefslogtreecommitdiffstats
path: root/tests/srcfilterlist.test
blob: 0808dfd0b6fe4383b51bd8ab480b8df5dde6c329 (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
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
set -u
. "$TESTSDIR"/test.inc

mkdir conf
cat > conf/options <<EOF
export silent-never
EOF

cat > conf/distributions <<EOF
Codename: test
Architectures: abacus source
Components: main

Codename: a
Architectures: abacus source
Components: main
Pull: a

Codename: b
Architectures: abacus source
Components: main
Pull: b

Codename: c
Architectures: abacus source
Components: main
Pull: c

Codename: d
Architectures: abacus source
Components: main
Pull: d

Codename: e
Architectures: abacus source
Components: main
Pull: e

Codename: f
Architectures: abacus source
Components: main
Pull: f
EOF

DISTRI=test PACKAGE=a VERSION=1 REVISION=-1 FAKEVER=7-1 SECTION=base genpackage.sh
mkdir -p pool/main/a/a
testrun - --delete include test test.changes 3<<EOF
stdout
$(odb)
$(ofa pool/main/a/a/a_1-1.tar.gz)
$(ofa pool/main/a/a/a_1-1.dsc)
$(ofa pool/main/a/a/a_1-1_abacus.deb)
$(ofa pool/main/a/a/a-addons_7-1_all.deb)
$(opa a 1-1 test main source dsc)
$(opa a 1-1 test main abacus deb)
$(opa a-addons 7-1 test main abacus deb)
EOF
DISTRI=test PACKAGE=b VERSION=1 REVISION=-1 FAKEVER=7-1 SECTION=base genpackage.sh
mkdir -p pool/main/b/b
testrun - --delete include test test.changes 3<<EOF
stdout
$(ofa pool/main/b/b/b_1-1.tar.gz)
$(ofa pool/main/b/b/b_1-1.dsc)
$(ofa pool/main/b/b/b_1-1_abacus.deb)
$(ofa pool/main/b/b/b-addons_7-1_all.deb)
$(opa b 1-1 test main source dsc)
$(opa b 1-1 test main abacus deb)
$(opa b-addons 7-1 test main abacus deb)
EOF

dodo test ! -d dists

cat > conf/pulls <<EOF
Name: a
From: test
FilterList: deinstall bin

Name: b
From: test
FilterSrcList: deinstall src

Name: c
From: test
FilterList: deinstall bin
FilterSrcList: deinstall src

Name: d
From: test

Name: e
From: test
FilterList: hold

Name: f
From: test
FilterList: deinstall
EOF
cat > conf/bin <<EOF
a = 1-1
a-addons = 7-1
b-addons = 1-1
b = 7-1
EOF
cat > conf/src <<EOF
b = 1-1
a = 7-1
a-addons = 7-1
EOF

testout - --restrict-bin a=1-1 dumppull 3</dev/null
cat > results.expected <<EOF
Updates needed for 'a|main|source':
Updates needed for 'a|main|abacus':
add 'a' - '1-1' 'a'
Updates needed for 'b|main|source':
Updates needed for 'b|main|abacus':
Updates needed for 'c|main|source':
Updates needed for 'c|main|abacus':
add 'a' - '1-1' 'c'
Updates needed for 'd|main|source':
Updates needed for 'd|main|abacus':
add 'a' - '1-1' 'd'
Updates needed for 'e|main|source':
Updates needed for 'e|main|abacus':
add 'a' - '1-1' 'e'
Updates needed for 'f|main|source':
Updates needed for 'f|main|abacus':
EOF
dodiff results.expected results

testout - --restrict-file-bin /dev/stdin dumppull 3</dev/null <<EOF
a = 1-1
EOF
cat > results.expected <<EOF
Updates needed for 'a|main|source':
Updates needed for 'a|main|abacus':
add 'a' - '1-1' 'a'
Updates needed for 'b|main|source':
Updates needed for 'b|main|abacus':
Updates needed for 'c|main|source':
Updates needed for 'c|main|abacus':
add 'a' - '1-1' 'c'
Updates needed for 'd|main|source':
Updates needed for 'd|main|abacus':
add 'a' - '1-1' 'd'
Updates needed for 'e|main|source':
Updates needed for 'e|main|abacus':
add 'a' - '1-1' 'e'
Updates needed for 'f|main|source':
Updates needed for 'f|main|abacus':
EOF
dodiff results.expected results

testout - --restrict a=1-1 --restrict-bin b=1-1 dumppull 3</dev/null
cat > results.expected <<EOF
Updates needed for 'a|main|source':
add 'a' - '1-1' 'a'
Updates needed for 'a|main|abacus':
add 'a' - '1-1' 'a'
add 'a-addons' - '7-1' 'a'
Updates needed for 'b|main|source':
Updates needed for 'b|main|abacus':
add 'b' - '1-1' 'b'
Updates needed for 'c|main|source':
Updates needed for 'c|main|abacus':
add 'a' - '1-1' 'c'
add 'a-addons' - '7-1' 'c'
Updates needed for 'd|main|source':
add 'a' - '1-1' 'd'
Updates needed for 'd|main|abacus':
add 'a' - '1-1' 'd'
add 'a-addons' - '7-1' 'd'
add 'b' - '1-1' 'd'
Updates needed for 'e|main|source':
add 'a' - '1-1' 'e'
Updates needed for 'e|main|abacus':
add 'a' - '1-1' 'e'
add 'a-addons' - '7-1' 'e'
add 'b' - '1-1' 'e'
Updates needed for 'f|main|source':
Updates needed for 'f|main|abacus':
EOF
dodiff results.expected results

testrun - pull 3<<EOF
stdout
-v0*=Calculating packages to pull...
-v3*=  pulling into 'a|main|source'
-v5*=  looking what to get from 'test|main|source'
-v3*=  pulling into 'a|main|abacus'
-v5*=  looking what to get from 'test|main|abacus'
-v3*=  pulling into 'b|main|source'
-v3*=  pulling into 'b|main|abacus'
-v3*=  pulling into 'c|main|source'
-v3*=  pulling into 'c|main|abacus'
-v3*=  pulling into 'd|main|source'
-v3*=  pulling into 'd|main|abacus'
-v3*=  pulling into 'e|main|source'
-v3*=  pulling into 'e|main|abacus'
-v3*=  pulling into 'f|main|source'
-v3*=  pulling into 'f|main|abacus'
-v0*=Installing (and possibly deleting) packages...
$(opa a 1-1 d main source dsc)
$(opa a 1-1 d main abacus deb)
$(opa a-addons 7-1 d main abacus deb)
$(opa b 1-1 d main source dsc)
$(opa b 1-1 d main abacus deb)
$(opa b-addons 7-1 d main abacus deb)
$(opa a 1-1 a main source dsc)
$(opa a 1-1 a main abacus deb)
$(opa a-addons 7-1 a main abacus deb)
$(opa b 1-1 b main source dsc)
$(opa b 1-1 b main abacus deb)
$(opa b-addons 7-1 b main abacus deb)
$(opa a 1-1 c main abacus deb)
$(opa a-addons 7-1 c main abacus deb)
$(opa b 1-1 c main source dsc)
EOF

rm -r db pool
testsuccess