Revision c326b4ef
b/qa/qa_rapi.py | ||
---|---|---|
116 | 116 |
for uri, verify, method, body in uris: |
117 | 117 |
assert uri.startswith("/") |
118 | 118 |
|
119 |
print "%s %s" % (method, uri) |
|
119 | 120 |
data = _rapi_client._SendRequest(method, uri, None, body) |
120 | 121 |
|
121 | 122 |
if verify is not None: |
... | ... | |
259 | 260 |
def _VerifyTags(data): |
260 | 261 |
AssertEqual(sorted(tags), sorted(data)) |
261 | 262 |
|
263 |
query = "&".join("tag=%s" % i for i in tags) |
|
264 |
|
|
265 |
# Add tags |
|
266 |
(job_id, ) = _DoTests([ |
|
267 |
("%s?%s" % (uri, query), _VerifyReturnsJob, "PUT", None), |
|
268 |
]) |
|
269 |
_WaitForRapiJob(job_id) |
|
270 |
|
|
271 |
# Retrieve tags |
|
262 | 272 |
_DoTests([ |
263 | 273 |
(uri, _VerifyTags, 'GET', None), |
264 | 274 |
]) |
265 | 275 |
|
276 |
# Remove tags |
|
277 |
(job_id, ) = _DoTests([ |
|
278 |
("%s?%s" % (uri, query), _VerifyReturnsJob, "DELETE", None), |
|
279 |
]) |
|
280 |
_WaitForRapiJob(job_id) |
|
281 |
|
|
266 | 282 |
|
267 | 283 |
def _WaitForRapiJob(job_id): |
268 | 284 |
"""Waits for a job to finish. |
b/qa/qa_tags.py | ||
---|---|---|
66 | 66 |
AssertEqual(StartSSH(master['primary'], |
67 | 67 |
utils.ShellQuoteArgs(cmd)).wait(), 0) |
68 | 68 |
|
69 |
if qa_rapi.Enabled(): |
|
70 |
qa_rapi.TestTags(kind, name, _TEMP_TAG_NAMES) |
|
71 |
|
|
72 | 69 |
cmd = cmdfn('remove-tags') + _TEMP_TAG_NAMES |
73 | 70 |
AssertEqual(StartSSH(master['primary'], |
74 | 71 |
utils.ShellQuoteArgs(cmd)).wait(), 0) |
75 | 72 |
|
73 |
if qa_rapi.Enabled(): |
|
74 |
qa_rapi.TestTags(kind, name, _TEMP_TAG_NAMES) |
|
75 |
|
|
76 | 76 |
|
77 | 77 |
def TestClusterTags(): |
78 | 78 |
"""gnt-cluster tags""" |
Also available in: Unified diff