Merge "Add API tests for List and Get Allocation API"
This commit is contained in:
commit
c91065e362
71
blazar_tempest_plugin/tests/api/gabbits/allocations.yaml
Normal file
71
blazar_tempest_plugin/tests/api/gabbits/allocations.yaml
Normal file
@ -0,0 +1,71 @@
|
||||
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
|
Loading…
Reference in New Issue
Block a user