/usr/lib/python3/dist-packages/gnocchi/tests/functional/gabbits/search.yaml is in python3-gnocchi 4.2.0-0ubuntu5.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
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 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 | #
# Test the search API to achieve coverage of just the
# SearchController and SearchResourceController class code.
#
fixtures:
- ConfigFixture
defaults:
request_headers:
# User foobar
authorization: "basic Zm9vYmFyOg=="
content-type: application/json
tests:
- name: typo of search
GET: /v1/search/notexists
status: 404
- name: typo of search in resource
GET: /v1/search/resource/foobar
status: 404
# FIXME(sileht): this test looks wrong, it talks about invalidity
# but asserts it return 200...
- name: search with invalid uuid
POST: /v1/search/resource/generic
data:
=:
id: "cd9eef"
- name: search invalid and value
desc: and should be followed by a list, not dict
POST: /v1/search/resource/generic
data:
and:
project_id: foobar
status: 400
response_strings:
- "expected a list for dictionary value @ data["
- "'and']"
- name: search like id
POST: /v1/search/resource/generic
data:
like:
id: fa%
status: 400
response_strings:
- "Invalid input: extra keys not allowed @ data["
- "'like']["
- "'id']"
- name: search like list id
POST: /v1/search/resource/generic
data:
like:
id:
- fa%
status: 400
response_strings:
- "Invalid input: extra keys not allowed @ data["
- "'like']["
- "'id']"
- name: search invalid ne value
desc: attribute value for binary operator must not be dict or list
POST: /v1/search/resource/generic
data:
ne:
project_id:
- foobar
status: 400
response_strings:
- "for dictionary value @ data["
- "'ne']["
- "'project_id']"
- name: search invalid not value
desc: uninary operator must follow by dict, not list
POST: /v1/search/resource/generic
data:
not:
- project_id: foobar
status: 400
response_strings:
- "expected a dictionary for dictionary value @ data["
- "'not']"
- name: post generic resource
POST: /v1/resource/generic
data:
id: faef212f-0bf4-4030-a461-2186fef79be0
started_at: "2014-01-03T02:02:02.000000"
user_id: 0fbb231484614b1a80131fc22f6afc9c
project_id: f3d41b770cc14f0bb94a1d5be9c0e3ea
status: 201
- name: post generic resource twice
POST: /v1/resource/generic
data:
id: df7e5e75-6a1d-4ff7-85cb-38eb9d75da7e
started_at: "2014-01-03T02:02:02.000000"
user_id: 0fbb231484614b1a80131fc22f6afc9c
project_id: f3d41b770cc14f0bb94a1d5be9c0e3ea
status: 201
- name: search in_
POST: /v1/search/resource/generic
data:
in:
id:
- faef212f-0bf4-4030-a461-2186fef79be0
- df7e5e75-6a1d-4ff7-85cb-38eb9d75da7e
response_json_paths:
$.`len`: 2
- name: search eq created_by_project_id
POST: /v1/search/resource/generic
data:
eq:
created_by_project_id: f3d41b770cc14f0bb94a1d5be9c0e3ea
response_json_paths:
$.`len`: 0
- name: search eq creator
POST: /v1/search/resource/generic
data:
eq:
creator: "foobar"
response_json_paths:
$.`len`: 2
- name: search like
POST: /v1/search/resource/generic
data:
like:
creator: foo%
response_json_paths:
$.`len`: 2
- name: search in_ query string
POST: /v1/search/resource/generic?filter=id%20in%20%5Bfaef212f-0bf4-4030-a461-2186fef79be0%2C%20df7e5e75-6a1d-4ff7-85cb-38eb9d75da7e%5D
response_json_paths:
$.`len`: 2
- name: search not in_ query string
POST: /v1/search/resource/generic?filter=not%20id%20in%20%5Bfaef212f-0bf4-4030-a461-2186fef79be0%2C%20df7e5e75-6a1d-4ff7-85cb-38eb9d75da7e%5D
response_json_paths:
$.`len`: 0
- name: search empty in_
POST: /v1/search/resource/generic
data:
in:
id: []
status: 400
response_strings:
- length of value must be at least 1
- name: search empty in_ query string
POST: /v1/search/resource/generic?filter=id%20in%20%5B%5D
status: 400
response_strings:
- length of value must be at least 1
- name: search empty query
POST: /v1/search/resource/generic
data: {}
response_json_paths:
$.`len`: 2
- name: search empty query page 1
POST: /v1/search/resource/generic?limit=1
data: {}
response_headers:
link: "<$SCHEME://$NETLOC/v1/search/resource/generic?limit=1&marker=faef212f-0bf4-4030-a461-2186fef79be0&sort=revision_start%3Aasc&sort=started_at%3Aasc>; rel=\"next\""
response_json_paths:
$.`len`: 1
- name: search empty query last page
POST: /v1/search/resource/generic?marker=faef212f-0bf4-4030-a461-2186fef79be0&sort=revision_start:asc&sort=started_at:asc
data: {}
response_forbidden_headers:
- link
response_json_paths:
$.`len`: 1
- name: post generic resource with project/user
POST: /v1/resource/generic
data:
id: 95573760-b085-4e69-9280-91f66fc3ed3c
started_at: "2014-01-03T02:02:02.000000"
status: 201
- name: search empty query again
POST: /v1/search/resource/generic
data: {}
response_json_paths:
$.`len`: 3
- name: search all resource not foobar
POST: /v1/search/resource/generic
data:
ne:
project_id: foobar
response_json_paths:
$.`len`: 3
- name: search all resource with attrs param
POST: /v1/search/resource/generic?attrs=id&attrs=started_at&attrs=user_id
data: {}
response_json_paths:
$[0].`len`: 3
$[0].id: $RESPONSE['$[0].id']
$[0].started_at: $RESPONSE['$[0].started_at']
$[0].user_id: $RESPONSE['$[0].user_id']
$[1].`len`: 3
- name: search all resource with invalid attrs param
POST: /v1/search/resource/generic?attrs=id&attrs=foo&attrs=bar
data: {}
response_json_paths:
$[0].`len`: 1
$[0].id: $RESPONSE['$[0].id']
$[1].`len`: 1
- name: search all resource without attrs param
POST: /v1/search/resource/generic
data: {}
response_json_paths:
$[0].`len`: 13
$[1].`len`: 13
- name: search all resource with attrs header
POST: /v1/search/resource/generic
data: {}
request_headers:
Accept: "application/json; attrs=id+started_at+user_id"
response_json_paths:
$[0].`len`: 3
$[0].id: $RESPONSE['$[0].id']
$[0].started_at: $RESPONSE['$[0].started_at']
$[0].user_id: $RESPONSE['$[0].user_id']
$[1].`len`: 3
- name: search all resource with invalid attrs header
POST: /v1/search/resource/generic
data: {}
request_headers:
Accept: "application/json; attrs=id+foo+bar"
response_json_paths:
$[0].`len`: 1
$[0].id: $RESPONSE['$[0].id']
$[1].`len`: 1
- name: search all resource without attrs header
POST: /v1/search/resource/generic
data: {}
request_headers:
Accept: "application/json"
response_json_paths:
$[0].`len`: 13
$[1].`len`: 13
|