/usr/lib/python3/dist-packages/gnocchi/tests/functional/gabbits/influxdb.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 | # Tests for the InfluxDB compatibility layer
fixtures:
- ConfigFixture
defaults:
request_headers:
# User admin
authorization: "basic YWRtaW46"
content-type: application/json
tests:
- name: ping influxdb status with head
desc: test HEAD on ping – xfails because Pecan does not honor HEAD correctly yet
xfail: true
HEAD: /v1/influxdb/ping
status: 204
- name: ping influxdb status with get
GET: /v1/influxdb/ping
status: 204
- name: create a database
POST: /v1/influxdb/query?q=create+database+influxdbtest
status: 204
- name: check the resource type now exists
GET: /v1/resource_type/influxdbtest
status: 200
response_json_paths:
$:
name: influxdbtest
attributes: {}
state: active
- name: do an unrecognized query
POST: /v1/influxdb/query?q=select+metrics+plz
request_headers:
# This is useful to get the error in JSON format
accept: application/json
status: 501
response_json_paths:
$.description.cause: Not implemented error
$.description.detail: q
$.description.reason: Query not implemented
- name: create archive policy
POST: /v1/archive_policy
data:
name: low
definition:
- granularity: 1 hour
status: 201
- name: create archive policy for influxdb
POST: /v1/archive_policy_rule
data:
name: influxdb
metric_pattern: "*"
archive_policy_name: low
status: 201
- name: write a line
POST: /v1/influxdb/write?db=influxdbtest
request_headers:
content-type: text/plain
data:
"mymetric,host=foobar,mytag=myvalue field=123 1510581804179554816"
status: 204
- name: check resource created
GET: /v1/resource/influxdbtest/foobar
status: 200
response_json_paths:
$.original_resource_id: foobar
$.id: b4d568e4-7af1-5aec-ac3f-9c09fa3685a9
$.type: influxdbtest
$.creator: admin
- name: check metric created
GET: /v1/resource/influxdbtest/foobar/metric/mymetric.field@mytag=myvalue
- name: check measures processed
GET: /v1/resource/influxdbtest/foobar/metric/mymetric.field@mytag=myvalue/measures?refresh=true
response_json_paths:
$:
- ["2017-11-13T14:00:00+00:00", 3600.0, 123.0]
- name: write lines with different tag resource id
POST: /v1/influxdb/write?db=influxdbtest
request_headers:
content-type: text/plain
X-Gnocchi-InfluxDB-Tag-Resource-ID: mytag
data:
"mymetric,host=foobar,mytag=myvalue field=123 1510581804179554816\ncpu,path=/foobar,mytag=myvalue field=43i 1510581804179554816"
status: 204
- name: check resource created with different resource id
GET: /v1/resource/influxdbtest/myvalue
status: 200
response_json_paths:
$.original_resource_id: myvalue
$.id: 6b9e2039-98d0-5d8d-9153-2d7491cf13e5
$.type: influxdbtest
$.creator: admin
- name: check metric created different tag resource id
GET: /v1/resource/influxdbtest/myvalue/metric/mymetric.field@host=foobar
- name: check metric created different tag resource id and slash replaced
GET: /v1/resource/influxdbtest/myvalue/metric/cpu.field@path=_foobar
- name: create a generic resource for conflict
POST: /v1/resource/generic
data:
id: conflict
status: 201
- name: write lines with conflicting resource
POST: /v1/influxdb/write?db=influxdbtest
request_headers:
content-type: text/plain
accept: application/json
data:
"mymetric,host=conflict,mytag=myvalue field=123 1510581804179554816"
status: 409
response_json_paths:
$.title: "Conflict"
$.description.cause: "Resource already exists"
$.description.detail: "da19a545-af76-5081-9a88-f370baab66c6"
|