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
diff --git a/telemetry_tempest_plugin/scenario/telemetry_integration_gabbits/aodh-gnocchi-threshold-alarm.yaml b/telemetry_tempest_plugin/scenario/telemetry_integration_gabbits/aodh-gnocchi-threshold-alarm.yaml
index 9349295..1c55f0b 100644
--- a/telemetry_tempest_plugin/scenario/telemetry_integration_gabbits/aodh-gnocchi-threshold-alarm.yaml
+++ b/telemetry_tempest_plugin/scenario/telemetry_integration_gabbits/aodh-gnocchi-threshold-alarm.yaml
@@ -20,7 +20,8 @@
- 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 @@
- 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