summaryrefslogtreecommitdiff
path: root/qa/299.out.2
blob: f3844c937ec7aee4b5d1a7672e58a5a64c90d5bd (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
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
QA output created by 299
=== No instance and no error cases ===

pmParseMetricSpec("sample", 1, "default_arch", ...)
isarch:   1
source:   "default_arch"
metric:   "sample"

pmParseMetricSpec("sample", 0, "default_host", ...)
isarch:   0
source:   "default_host"
metric:   "sample"

pmParseMetricSpec("my_arch/sample", 1, "default_arch", ...)
isarch:   1
source:   "my_arch"
metric:   "sample"

pmParseMetricSpec("my_host:sample", 0, "default_host", ...)
isarch:   0
source:   "my_host"
metric:   "sample"

pmParseMetricSpec("other_host:sample", 1, "default_arch", ...)
isarch:   0
source:   "other_host"
metric:   "sample"

pmParseMetricSpec("/other/arch/sample", 0, "default_host", ...)
isarch:   1
source:   "/other/arch"
metric:   "sample"

=== One instance and no error cases ===

pmParseMetricSpec("sample[singular]", 1, "default_arch", ...)
isarch:   1
source:   "default_arch"
metric:   "sample"
inst[0]:  "singular"

pmParseMetricSpec("sample[singular]", 0, "default_host", ...)
isarch:   0
source:   "default_host"
metric:   "sample"
inst[0]:  "singular"

pmParseMetricSpec("my_arch/sample[singular]", 1, "default_arch", ...)
isarch:   1
source:   "my_arch"
metric:   "sample"
inst[0]:  "singular"

pmParseMetricSpec("my_host:sample[singular]", 0, "default_host", ...)
isarch:   0
source:   "my_host"
metric:   "sample"
inst[0]:  "singular"

pmParseMetricSpec("other_host:sample[singular]", 1, "default_arch", ...)
isarch:   0
source:   "other_host"
metric:   "sample"
inst[0]:  "singular"

pmParseMetricSpec("/other/arch/sample[singular]", 0, "default_host", ...)
isarch:   1
source:   "/other/arch"
metric:   "sample"
inst[0]:  "singular"

=== Multiple instances and no error cases ===

pmParseMetricSpec("sample[one,two,three]", 1, "default_arch", ...)
isarch:   1
source:   "default_arch"
metric:   "sample"
inst[0]:  "one"
inst[1]:  "two"
inst[2]:  "three"

pmParseMetricSpec("sample[one,two,three]", 0, "default_host", ...)
isarch:   0
source:   "default_host"
metric:   "sample"
inst[0]:  "one"
inst[1]:  "two"
inst[2]:  "three"

pmParseMetricSpec("my_arch/sample[one,two,three]", 1, "default_arch", ...)
isarch:   1
source:   "my_arch"
metric:   "sample"
inst[0]:  "one"
inst[1]:  "two"
inst[2]:  "three"

pmParseMetricSpec("my_host:sample[one,two,three]", 0, "default_host", ...)
isarch:   0
source:   "my_host"
metric:   "sample"
inst[0]:  "one"
inst[1]:  "two"
inst[2]:  "three"

pmParseMetricSpec("other_host:sample[one,two,three]", 1, "default_arch", ...)
isarch:   0
source:   "other_host"
metric:   "sample"
inst[0]:  "one"
inst[1]:  "two"
inst[2]:  "three"

pmParseMetricSpec("/other/arch/sample[one,two,three]", 0, "default_host", ...)
isarch:   1
source:   "/other/arch"
metric:   "sample"
inst[0]:  "one"
inst[1]:  "two"
inst[2]:  "three"

=== Some whitespace cases ===

pmParseMetricSpec(" my_host : sample [ one , two , three ] ", 0, "default_host", ...)
isarch:   0
source:   "my_host"
metric:   "sample"
inst[0]:  "one"
inst[1]:  "two"
inst[2]:  "three"

pmParseMetricSpec("my_arch   /   sample  [singular]", 1, "default_arch", ...)
isarch:   1
source:   "my_arch   "
metric:   "sample"
inst[0]:  "singular"

=== Miscellaneous cases ===

pmParseMetricSpec("../../relative/pathname/myarch/metric", 0, "default_host", ...)
isarch:   1
source:   "../../relative/pathname/myarch"
metric:   "metric"

pmParseMetricSpec("metric.a.b.c.d[]", 0, "default_host", ...)
isarch:   0
source:   "default_host"
metric:   "metric.a.b.c.d"

pmParseMetricSpec("/full/pathname/myarch/metric[fumble mumble]", 0, "default_host", ...)
isarch:   1
source:   "/full/pathname/myarch"
metric:   "metric"
inst[0]:  "fumble"
inst[1]:  "mumble"

pmParseMetricSpec("./myarch/metric[fumble,,mumble]", 0, "default_host", ...)
isarch:   1
source:   "./myarch"
metric:   "metric"
inst[0]:  "fumble"
inst[1]:  "mumble"

pmParseMetricSpec("foo["instance with strange chars :/,[]\""]", 0, "default_host", ...)
isarch:   0
source:   "default_host"
metric:   "foo"
inst[0]:  "instance with strange chars :/,[]""

=== Some error cases ===

pmParseMetricSpec("one:two:three", 0, "default_host", ...)
pmParseMetricSpec Error:
one:two:three
       ^ -- unexpected character in metric name


pmParseMetricSpec("foo/bar[fumble]mumble", 0, "default_host", ...)
pmParseMetricSpec Error:
foo/bar[fumble]mumble
               ^ -- unexpected extra characters


pmParseMetricSpec("foo:bar:fumble[mumble]", 0, "default_host", ...)
pmParseMetricSpec Error:
foo:bar:fumble[mumble]
       ^ -- unexpected character in metric name


pmParseMetricSpec("foo:", 0, "default_host", ...)
pmParseMetricSpec Error:
foo:
    ^ -- performance metric name expected


pmParseMetricSpec("bad/arch/", 0, "default_host", ...)
pmParseMetricSpec Error:
bad/arch/
         ^ -- performance metric name expected


pmParseMetricSpec("/bad/arch/[", 0, "default_host", ...)
pmParseMetricSpec Error:
/bad/arch/[
          ^ -- performance metric name expected


pmParseMetricSpec("norsqb[", 0, "default_host", ...)
pmParseMetricSpec Error:
norsqb[
       ^ -- closing ] expected


pmParseMetricSpec("nolsqb-instance]", 0, "default_host", ...)
pmParseMetricSpec Error:
nolsqb-instance]
               ^ -- unexpected character in metric name


pmParseMetricSpec("metric["noclosingquote", 0, "default_host", ...)
pmParseMetricSpec Error:
metric["noclosingquote
                      ^ -- closing " and ] expected


pmParseMetricSpec("metric["noclosingquote]", 0, "default_host", ...)
pmParseMetricSpec Error:
metric["noclosingquote]
                       ^ -- closing " and ] expected


pmParseMetricSpec("metric["noclosing]"", 0, "default_host", ...)
pmParseMetricSpec Error:
metric["noclosing]"
                   ^ -- closing ] expected


pmParseMetricSpec("metric["ends in backslash\", 0, "default_host", ...)
pmParseMetricSpec Error:
metric["ends in backslash\
                          ^ -- closing " and ] expected