Tolerate existing gabbiliveceph archive policy

current tests implementation is not friendly to test re-runs:
as archive policy may fail to delete when there are still samples
stored for it (and the test expects it, see the last xfail: true in
the aodh-gnocchi-threshold-alarm.yaml), next test rerun may fail
right on the initial setup as it receives 409 Conflict instead of 201
on attempt to create an archive policy that already exists.

Solve this by tolerating 409 in the archive policy creation step,
and moving checks for fields of created (or existing) policy to an
extra GET /v1/archive_policy/<name> step.

Change-Id: I978937d89b2e886e2ef690661bc00a730db94c92
This commit is contained in:
Pavlo Shchelokovskyy 2019-12-18 12:15:20 +02:00
parent f4d7375147
commit 421cd3fd46
1 changed files with 8 additions and 2 deletions

View File

@ -20,7 +20,8 @@ tests:
- name: SETUP. create archive policy gabbiliveceph
desc: create archve policy 'gabbiliveceph' for tests
POST: $ENVIRON['GNOCCHI_SERVICE_URL']/v1/archive_policy
status: 201
# 409 when policy with such name already exists
status: 201 || 409
request_headers:
content-type: application/json
data:
@ -37,8 +38,13 @@ tests:
- mean
- min
- max
- name: check properties of created or existing archive policy
GET: $ENVIRON['GNOCCHI_SERVICE_URL']/v1/archive_policy/gabbiliveceph
status: 200
request_headers:
content-type: application/json
response_json_paths:
$.name: gabbiliveceph
$.back_window: 0
$.aggregation_methods.`len`: 3