~ubuntu-branches/ubuntu/raring/reprepro/raring

« back to all changes in this revision

Viewing changes to tests/testatoms.sh

  • Committer: Bazaar Package Importer
  • Author(s): Bernhard R. Link
  • Date: 2011-05-05 16:34:23 UTC
  • mfrom: (21.1.5 sid)
  • Revision ID: james.westby@ubuntu.com-20110505163423-x49kbdijyoubai4x
Tags: 4.6.0-1
* new release
- general cleanup
- new FilterSrcList
* increase Standards-Version, no changes needed

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
#!/bin/bash
2
 
 
3
 
set -e
4
 
if [ "x$TESTINCSETUP" != "xissetup" ] ; then
5
 
        source $(dirname $0)/test.inc
6
 
fi
7
 
 
8
 
# different tests to check the error messages when accessing
9
 
# architectures components or packagetypes...
10
 
 
11
 
mkdir conf
12
 
cat > conf/options <<EOF
13
 
export never
14
 
EOF
15
 
 
16
 
cat > conf/distributions <<EOF
17
 
Codename: codename
18
 
Architectures: te/st all source
19
 
Components: component
20
 
EOF
21
 
 
22
 
testrun - -b . update 3<<EOF
23
 
*=Error parsing ./conf/distributions, line 2, column 16: Malformed Architectures element 'te/st': '/' is not allowed
24
 
-v0*=There have been errors!
25
 
return 255
26
 
EOF
27
 
 
28
 
sed -i -e 's#te/st#test#' conf/distributions
29
 
 
30
 
testrun - -b . update 3<<EOF
31
 
*=Error: Distribution codename contains an architecture called 'all'.
32
 
-v0*=There have been errors!
33
 
return 255
34
 
EOF
35
 
 
36
 
sed -i -e 's#\<all\>#a|l#' conf/distributions
37
 
 
38
 
testrun - -b . update 3<<EOF
39
 
*=Error parsing ./conf/distributions, line 2, column 21: Malformed Architectures element 'a|l': '|' is not allowed
40
 
-v0*=There have been errors!
41
 
return 255
42
 
EOF
43
 
 
44
 
sed -i -e 's#\<a|l\>##' -e 's#component#compo|nent#' conf/distributions
45
 
 
46
 
testrun - -b . update 3<<EOF
47
 
*=Error parsing ./conf/distributions, line 3, column 13: Malformed Components element 'compo|nent': '|' is not allowed
48
 
-v0*=There have been errors!
49
 
return 255
50
 
EOF
51
 
 
52
 
sed -i -e 's#compo|nent#.#' conf/distributions
53
 
 
54
 
testrun - -b . update 3<<EOF
55
 
*=Error parsing ./conf/distributions, line 3, column 13: Malformed Components element '.': '.' is not allowed as directory part
56
 
-v0*=There have been errors!
57
 
return 255
58
 
EOF
59
 
 
60
 
sed -i -e 's# .$# ./test#' conf/distributions
61
 
 
62
 
testrun - -b . update 3<<EOF
63
 
*=Error parsing ./conf/distributions, line 3, column 13: Malformed Components element './test': '.' is not allowed as directory part
64
 
-v0*=There have been errors!
65
 
return 255
66
 
EOF
67
 
 
68
 
sed -i -e 's# ./test$# bla/./test#' conf/distributions
69
 
 
70
 
testrun - -b . update 3<<EOF
71
 
*=Error parsing ./conf/distributions, line 3, column 13: Malformed Components element 'bla/./test': '.' is not allowed as directory part
72
 
-v0*=There have been errors!
73
 
return 255
74
 
EOF
75
 
 
76
 
sed -i -e 's# bla/./test$# bla/../test#' conf/distributions
77
 
 
78
 
testrun - -b . update 3<<EOF
79
 
*=Error parsing ./conf/distributions, line 3, column 13: Malformed Components element 'bla/../test': '..' is not allowed as directory part
80
 
-v0*=There have been errors!
81
 
return 255
82
 
EOF
83
 
 
84
 
sed -i -e 's#/test$##' conf/distributions
85
 
 
86
 
testrun - -b . update 3<<EOF
87
 
*=Error parsing ./conf/distributions, line 3, column 13: Malformed Components element 'bla/..': '..' is not allowed as directory part
88
 
-v0*=There have been errors!
89
 
return 255
90
 
EOF
91
 
 
92
 
sed -i -e 's#bla/##' conf/distributions
93
 
 
94
 
testrun - -b . update 3<<EOF
95
 
*=Error parsing ./conf/distributions, line 3, column 13: Malformed Components element '..': '..' is not allowed as directory part
96
 
-v0*=There have been errors!
97
 
return 255
98
 
EOF
99
 
 
100
 
sed -i -e 's#\.\.#component#' -e 's#Components#UdebComponents#' conf/distributions
101
 
 
102
 
testrun - -b . update 3<<EOF
103
 
*=Error parsing ./conf/distributions, line 3, column 16:
104
 
*= A 'UDebComponents'-field is only allowed after a 'Components'-field.
105
 
-v0*=There have been errors!
106
 
return 255
107
 
EOF
108
 
 
109
 
ed -s conf/distributions <<EOF
110
 
/Codename/a
111
 
Components: test
112
 
.
113
 
w
114
 
q
115
 
EOF
116
 
 
117
 
testrun - -b . update 3<<EOF
118
 
*=Error parsing ./conf/distributions, line 4, column 17: 'component' not allowed in UDebComponents as it was not in Components.
119
 
-v0*=There have been errors!
120
 
return 255
121
 
EOF
122
 
 
123
 
sed -i -e 's#test$#test component#' conf/distributions
124
 
cat >> conf/distributions <<EOF
125
 
ContentsArchitectures: bla
126
 
EOF
127
 
 
128
 
testrun - -b . update 3<<EOF
129
 
*=Error parsing ./conf/distributions, line 5, column 24: 'bla' not allowed in ContentsArchitectures as it was not in Architectures.
130
 
-v0*=There have been errors!
131
 
return 255
132
 
EOF
133
 
 
134
 
sed -i -e 's#ContentsArchitectures#ContentsComponents#' conf/distributions
135
 
 
136
 
testrun - -b . update 3<<EOF
137
 
*=Error parsing ./conf/distributions, line 5, column 21: 'bla' not allowed in ContentsComponents as it was not in Components.
138
 
-v0*=There have been errors!
139
 
return 255
140
 
EOF
141
 
 
142
 
sed -i -e 's#ContentsComponents: bla#ContentsUComponents: test#' conf/distributions
143
 
 
144
 
testrun - -b . update 3<<EOF
145
 
*=Error parsing ./conf/distributions, line 5, column 22: 'test' not allowed in ContentsUComponents as it was not in UDebComponents.
146
 
-v0*=There have been errors!
147
 
return 255
148
 
EOF
149
 
 
150
 
sed -i -e 's#ContentsUComponents: test#ContentsUComponents: component#' conf/distributions
151
 
 
152
 
testrun - -b . -A test update 3<<EOF
153
 
*=Action 'update' cannot be restricted to an architecture!
154
 
*=neither --archiecture nor -A make sense here.
155
 
*=To ignore use --ignore=unusedoption.
156
 
-v0*=There have been errors!
157
 
return 255
158
 
EOF
159
 
testrun - -b . -C test update 3<<EOF
160
 
*=Action 'update' cannot be restricted to a component!
161
 
*=neither --component nor -C make sense here.
162
 
*=To ignore use --ignore=unusedoption.
163
 
-v0*=There have been errors!
164
 
return 255
165
 
EOF
166
 
testrun - -b . -T dsc update 3<<EOF
167
 
*=Action 'update' cannot be restricted to a packagetype!
168
 
*=neither --packagetype nor -T make sense here.
169
 
*=To ignore use --ignore=unusedoption.
170
 
-v0*=There have been errors!
171
 
return 255
172
 
EOF
173
 
mkdir db
174
 
testrun - -b . -A test remove codename nothing 3<<EOF
175
 
-v0*=Not removed as not found: nothing
176
 
EOF
177
 
testrun - -b . -A bla remove codename nothing 3<<EOF
178
 
*=Error: Architecture 'bla' as given to --architecture is not know.
179
 
*=(it does not appear as architecture in ./conf/distributions (did you mistype?))
180
 
-v0*=There have been errors!
181
 
returns 255
182
 
EOF
183
 
 
184
 
rm -r conf db
185
 
testsuccess