
This patch adds API tests for List and Get host allocation API. Partially Implements: blueprint resource-allocation-api Change-Id: I597e163541776022c1152cab02f259c857b1a459
72 lines
1.8 KiB
YAML
72 lines
1.8 KiB
YAML
fixtures:
|
|
- AuthenticationFixture
|
|
|
|
defaults:
|
|
request_headers:
|
|
accept: application/json
|
|
content-type: application/json
|
|
X-Auth-Token: $ENVIRON['OS_TOKEN']
|
|
|
|
tests:
|
|
- name: get host name
|
|
GET: compute/v2.1/os-hypervisors
|
|
status: 200
|
|
|
|
- name: post new host
|
|
POST: reservation/v1/os-hosts
|
|
data:
|
|
name: $HISTORY['get host name'].$RESPONSE['$.hypervisors[0].hypervisor_hostname']
|
|
status: 201
|
|
|
|
- name: post new lease lease1
|
|
POST: reservation/v1/leases
|
|
data:
|
|
name: lease1
|
|
start_date: "2020-01-01 10:00"
|
|
end_date: "2020-01-01 11:00"
|
|
reservations:
|
|
- resource_type: physical:host
|
|
min: 1
|
|
max: 1
|
|
hypervisor_properties: "[]"
|
|
resource_properties: "[]"
|
|
status: 201
|
|
|
|
- name: post new lease lease2
|
|
POST: reservation/v1/leases
|
|
data:
|
|
name: lease2
|
|
start_date: "2020-01-01 12:00"
|
|
end_date: "2020-01-01 13:00"
|
|
reservations:
|
|
- resource_type: physical:host
|
|
min: 1
|
|
max: 1
|
|
hypervisor_properties: "[]"
|
|
resource_properties: "[]"
|
|
status: 201
|
|
|
|
- name: list host allocations
|
|
GET: reservation/v1/os-hosts/allocations
|
|
response_json_paths:
|
|
$.allocations..reservations.`len`: 2
|
|
|
|
- name: list host allocations with lease2
|
|
GET: reservation/v1/os-hosts/allocations
|
|
query_parameters:
|
|
lease_id: $HISTORY['post new lease lease2'].$RESPONSE['$.lease.id']
|
|
response_json_paths:
|
|
$.allocations.`len`: 1
|
|
|
|
- name: delete lease2
|
|
DELETE: reservation/v1/leases/$HISTORY['post new lease lease2'].$RESPONSE['$.lease.id']
|
|
status: 204
|
|
|
|
- name: delete lease1
|
|
DELETE: reservation/v1/leases/$HISTORY['post new lease lease1'].$RESPONSE['$.lease.id']
|
|
status: 204
|
|
|
|
- name: delete host
|
|
DELETE: reservation/v1/os-hosts/$HISTORY['post new host'].$RESPONSE['$.host.id']
|
|
status: 204
|