summaryrefslogtreecommitdiffstats
path: root/tests/atoms.test
blob: c57a53dd0f4aeeb1e15a46dae93e97a7d62eb37f (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
. "$TESTSDIR"/test.inc

# different tests to check the error messages when accessing
# architectures components or packagetypes...

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

cat > conf/distributions <<EOF
Codename: codename
Architectures: te/st all source
Components: component
EOF

testrun - -b . update 3<<EOF
*=Error parsing ./conf/distributions, line 2, column 16: Malformed Architectures element 'te/st': '/' is not allowed
-v0*=There have been errors!
return 255
EOF

sed -i -e 's#te/st#test#' conf/distributions

testrun - -b . update 3<<EOF
*=Error: Distribution codename contains an architecture called 'all'.
-v0*=There have been errors!
return 255
EOF

sed -i -e 's#\<all\>#a|l#' conf/distributions

testrun - -b . update 3<<EOF
*=Error parsing ./conf/distributions, line 2, column 21: Malformed Architectures element 'a|l': '|' is not allowed
-v0*=There have been errors!
return 255
EOF

sed -i -e 's#\<a|l\>##' -e 's#component#compo|nent#' conf/distributions

testrun - -b . update 3<<EOF
*=Error parsing ./conf/distributions, line 3, column 13: Malformed Components element 'compo|nent': '|' is not allowed
-v0*=There have been errors!
return 255
EOF

sed -i -e 's#compo|nent#.#' conf/distributions

testrun - -b . update 3<<EOF
*=Error parsing ./conf/distributions, line 3, column 13: Malformed Components element '.': '.' is not allowed as directory part
-v0*=There have been errors!
return 255
EOF

sed -i -e 's# .$# ./test#' conf/distributions

testrun - -b . update 3<<EOF
*=Error parsing ./conf/distributions, line 3, column 13: Malformed Components element './test': '.' is not allowed as directory part
-v0*=There have been errors!
return 255
EOF

sed -i -e 's# ./test$# bla/./test#' conf/distributions

testrun - -b . update 3<<EOF
*=Error parsing ./conf/distributions, line 3, column 13: Malformed Components element 'bla/./test': '.' is not allowed as directory part
-v0*=There have been errors!
return 255
EOF

sed -i -e 's# bla/./test$# bla/../test#' conf/distributions

testrun - -b . update 3<<EOF
*=Error parsing ./conf/distributions, line 3, column 13: Malformed Components element 'bla/../test': '..' is not allowed as directory part
-v0*=There have been errors!
return 255
EOF

sed -i -e 's#/test$##' conf/distributions

testrun - -b . update 3<<EOF
*=Error parsing ./conf/distributions, line 3, column 13: Malformed Components element 'bla/..': '..' is not allowed as directory part
-v0*=There have been errors!
return 255
EOF

sed -i -e 's#bla/##' conf/distributions

testrun - -b . update 3<<EOF
*=Error parsing ./conf/distributions, line 3, column 13: Malformed Components element '..': '..' is not allowed as directory part
-v0*=There have been errors!
return 255
EOF

sed -i -e 's#\.\.#component#' -e 's#Components#UdebComponents#' conf/distributions

testrun - -b . update 3<<EOF
*=Error parsing ./conf/distributions, line 3, column 16:
*= A 'UDebComponents'-field is only allowed after a 'Components'-field.
-v0*=There have been errors!
return 255
EOF

ed -s conf/distributions <<EOF
/Codename/a
Components: test
.
w
q
EOF

testrun - -b . update 3<<EOF
*=Error parsing ./conf/distributions, line 4, column 17: 'component' not allowed in UDebComponents as it was not in Components.
-v0*=There have been errors!
return 255
EOF

sed -i -e 's#test$#test component#' conf/distributions
cat >> conf/distributions <<EOF
ContentsArchitectures: bla
EOF

testrun - -b . update 3<<EOF
*=Error parsing ./conf/distributions, line 5, column 24: 'bla' not allowed in ContentsArchitectures as it was not in Architectures.
-v0*=There have been errors!
return 255
EOF

sed -i -e 's#ContentsArchitectures#ContentsComponents#' conf/distributions

testrun - -b . update 3<<EOF
*=Error parsing ./conf/distributions, line 5, column 21: 'bla' not allowed in ContentsComponents as it was not in Components.
-v0*=There have been errors!
return 255
EOF

sed -i -e 's#ContentsComponents: bla#ContentsUComponents: test#' conf/distributions

testrun - -b . update 3<<EOF
*=Error parsing ./conf/distributions, line 5, column 22: 'test' not allowed in ContentsUComponents as it was not in UDebComponents.
-v0*=There have been errors!
return 255
EOF

sed -i -e 's#ContentsUComponents: test#ContentsUComponents: component#' conf/distributions

testrun - -b . -A test export 3<<EOF
*=Action 'export' cannot be restricted to an architecture!
*=neither --archiecture nor -A make sense here.
*=To ignore use --ignore=unusedoption.
-v0*=There have been errors!
return 255
EOF
testrun - -b . -C test export 3<<EOF
*=Action 'export' cannot be restricted to a component!
*=neither --component nor -C make sense here.
*=To ignore use --ignore=unusedoption.
-v0*=There have been errors!
return 255
EOF
testrun - -b . -T dsc export 3<<EOF
*=Action 'export' cannot be restricted to a packagetype!
*=neither --packagetype nor -T make sense here.
*=To ignore use --ignore=unusedoption.
-v0*=There have been errors!
return 255
EOF
mkdir db
testrun - -b . -A test remove codename nothing 3<<EOF
-v0*=Not removed as not found: nothing
EOF
testrun - -b . -A bla remove codename nothing 3<<EOF
*=Error: Architecture 'bla' as given to --architecture is not know.
*=(it does not appear as architecture in ./conf/distributions (did you mistype?))
-v0*=There have been errors!
returns 255
EOF

rm -r conf db
testsuccess