summaryrefslogtreecommitdiff
path: root/nova/tests/functional/api/openstack/placement/gabbits/resource-provider-resources-query.yaml
blob: f80c1753a18d00069b66548377d5301deea6f69e (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
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
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156

fixtures:
    - AllocationFixture

defaults:
    request_headers:
        x-auth-token: admin
        content-type: application/json
        accept: application/json
        openstack-api-version: placement latest

tests:

- name: what is at resource providers
  GET: /resource_providers
  response_json_paths:
      $.resource_providers.`len`: 1
      $.resource_providers[0].uuid: $ENVIRON['RP_UUID']
      $.resource_providers[0].name: $ENVIRON['RP_NAME']
      $.resource_providers[0].links[?rel = "self"].href: /resource_providers/$ENVIRON['RP_UUID']
      $.resource_providers[0].links[?rel = "inventories"].href: /resource_providers/$ENVIRON['RP_UUID']/inventories
      $.resource_providers[0].links[?rel = "aggregates"].href: /resource_providers/$ENVIRON['RP_UUID']/aggregates
      $.resource_providers[0].links[?rel = "usages"].href: /resource_providers/$ENVIRON['RP_UUID']/usages

- name: post new resource provider
  POST: /resource_providers
  data:
      name: $ENVIRON['ALT_RP_NAME']
      uuid: $ENVIRON['ALT_RP_UUID']
  status: 201
  response_headers:
      location: //resource_providers/[a-f0-9-]+/
  response_forbidden_headers:
      - content-type

- name: now 2 providers listed
  GET: /resource_providers
  response_json_paths:
      $.resource_providers.`len`: 2

- name: list resource providers providing resources filter before API 1.4
  GET: /resource_providers?resources=VCPU:1
  request_headers:
      openstack-api-version: placement 1.3
  status: 400
  response_strings:
      - 'Invalid query string parameters'
  response_json_paths:
      $.errors[0].title: Bad Request

- name: list resource providers providing a badly-formatted resources filter
  GET: /resource_providers?resources=VCPU
  status: 400
  response_strings:
      - 'Badly formed resources parameter. Expected resources query string parameter in form:'
      - 'Got: VCPU.'
  response_json_paths:
      $.errors[0].title: Bad Request

- name: list resource providers providing a resources filter with non-integer amount
  GET: /resource_providers?resources=VCPU:fred
  status: 400
  response_strings:
      - 'Requested resource VCPU expected positive integer amount.'
      - 'Got: fred.'
  response_json_paths:
      $.errors[0].title: Bad Request

- name: list resource providers providing a resources filter with negative amount
  GET: /resource_providers?resources=VCPU:-2
  status: 400
  response_strings:
      - 'Requested resource VCPU requires amount >= 1.'
      - 'Got: -2.'
  response_json_paths:
      $.errors[0].title: Bad Request

- name: list resource providers providing a resource class not existing
  GET: /resource_providers?resources=MYMISSINGCLASS:1
  status: 400
  response_strings:
      - 'Invalid resource class in resources parameter'
  response_json_paths:
      $.errors[0].title: Bad Request

- name: list resource providers providing a bad trailing comma
  GET: /resource_providers?resources=DISK_GB:500,
  status: 400
  response_strings:
      - 'Badly formed resources parameter. Expected resources query string parameter in form:'
      # NOTE(mriedem): The value is empty because splitting on the trailing
      # comma results in an empty string.
      - 'Got: .'
  response_json_paths:
      $.errors[0].title: Bad Request

- name: list resource providers providing empty resources
  GET: /resource_providers?resources=
  status: 400
  response_strings:
      - Badly formed resources parameter. Expected resources query string parameter in form
      - 'Got: empty string.'

- name: list resource providers providing disk resources
  GET: /resource_providers?resources=DISK_GB:500
  response_json_paths:
      $.resource_providers.`len`: 1
      $.resource_providers[0].uuid: $ENVIRON['RP_UUID']

- name: list resource providers providing disk and vcpu resources
  GET: /resource_providers?resources=DISK_GB:500,VCPU:2
  response_json_paths:
      $.resource_providers.`len`: 1
      $.resource_providers[0].uuid: $ENVIRON['RP_UUID']

- name: list resource providers providing resources (no match - less than min_unit)
  GET: /resource_providers?resources=DISK_GB:1
  response_json_paths:
      $.resource_providers.`len`: 0

- name: list resource providers providing resources (no match - more than max_unit)
  GET: /resource_providers?resources=DISK_GB:610
  response_json_paths:
      $.resource_providers.`len`: 0

- name: list resource providers providing resources (no match - not enough inventory)
  GET: /resource_providers?resources=DISK_GB:102400
  response_json_paths:
      $.resource_providers.`len`: 0

- name: list resource providers providing resources (no match - bad step size)
  GET: /resource_providers?resources=DISK_GB:11
  response_json_paths:
      $.resource_providers.`len`: 0

- name: list resource providers providing resources (no match - no inventory of resource)
  GET: /resource_providers?resources=MEMORY_MB:10240
  response_json_paths:
      $.resource_providers.`len`: 0

- name: list resource providers providing resources (no match - not enough VCPU)
  GET: /resource_providers?resources=DISK_GB:500,VCPU:4
  response_json_paths:
      $.resource_providers.`len`: 0

- name: associate an aggregate with rp1
  PUT: /resource_providers/$ENVIRON['RP_UUID']/aggregates
  data:
      - 83a3d69d-8920-48e2-8914-cadfd8fa2f91
  status: 200

- name: get by aggregates with resources
  GET: '/resource_providers?member_of=in:83a3d69d-8920-48e2-8914-cadfd8fa2f91&resources=VCPU:2'
  response_json_paths:
      $.resource_providers.`len`: 1
      $.resource_providers[0].uuid: $ENVIRON['RP_UUID']