summaryrefslogtreecommitdiff
path: root/nova/tests/functional/api/openstack/placement/gabbits/microversion.yaml
blob: 27f81ca8c01c4333d1f7a36ad1b3d28fcfda644b (plain)
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
# Tests to build microversion functionality behavior and confirm
# it is present and behaving as expected.

fixtures:
    - APIFixture

defaults:
    request_headers:
        accept: application/json
        x-auth-token: user

tests:
- name: root has microversion header
  GET: /
  response_headers:
      vary: /OpenStack-API-Version/
      openstack-api-version: /^placement \d+\.\d+$/

- name: root has microversion info
  GET: /
  response_json_paths:
      $.versions[0].max_version: /^\d+\.\d+$/
      $.versions[0].min_version: /^\d+\.\d+$/
      $.versions[0].id: v1.0
      $.versions[0].status: CURRENT
      $.versions[0].links[?rel = 'self'].href: ''

- name: unavailable microversion raises 406
  GET: /
  request_headers:
      openstack-api-version: placement 0.5
  status: 406
  response_headers:
      content-type: /application/json/
  response_json_paths:
      $.errors.[0].title: Not Acceptable
      $.errors.[0].max_version: /^\d+\.\d+$/
      $.errors.[0].min_version: /^\d+\.\d+$/
  response_strings:
      - "Unacceptable version header: 0.5"
  response_json_paths:
      $.errors[0].title: Not Acceptable

- name: latest microversion is 1.17
  GET: /
  request_headers:
      openstack-api-version: placement latest
  response_headers:
      vary: /OpenStack-API-Version/
      openstack-api-version: placement 1.17

- name: other accept header bad version
  GET: /
  request_headers:
      accept: text/html
      openstack-api-version: placement 0.5
  status: 406
  response_headers:
      content-type: /text/html/
  response_strings:
      - "Unacceptable version header: 0.5"

- name: bad format string raises 400
  GET: /
  request_headers:
      openstack-api-version: placement pony.horse
  status: 400
  response_strings:
      - "invalid version string: pony.horse"
  response_json_paths:
      $.errors[0].title: Bad Request

- name: bad format multidot raises 400
  GET: /
  request_headers:
      openstack-api-version: placement 1.2.3
  status: 400
  response_strings:
      - "invalid version string: 1.2.3"
  response_json_paths:
      $.errors[0].title: Bad Request

- name: error in application produces microversion headers
  desc: we do not want xml
  POST: /
  request_headers:
      content-type: application/xml
  status: 405
  response_headers:
      openstack-api-version: placement 1.0