gabbi-tempest/gabbi_tempest/tests/scenario/gabbits/multi/base.yaml

153 lines
4.2 KiB
YAML

defaults:
request_headers:
x-auth-token: $ENVIRON['SERVICE_TOKEN']
content-type: application/json
accept: application/json
openstack-api-version: 'compute latest, placement latest'
# These replace full nodes, there is no YAML interpolation
# Experimenting with using YAML anchors to avoid repeating long expansions
# within the tests.
vars:
- &cn1_rp $ENVIRON['PLACEMENT_SERVICE']/resource_providers/$HISTORY['list hypervisors'].$RESPONSE['$.hypervisors[0].id']
- &cn1_inv $ENVIRON['PLACEMENT_SERVICE']/resource_providers/$HISTORY['list hypervisors'].$RESPONSE['$.hypervisors[0].id']/inventories
- &cn1_alloc $ENVIRON['PLACEMENT_SERVICE']/resource_providers/$HISTORY['list hypervisors'].$RESPONSE['$.hypervisors[0].id']/allocations
- &cn1_usages $ENVIRON['PLACEMENT_SERVICE']/resource_providers/$HISTORY['list hypervisors'].$RESPONSE['$.hypervisors[0].id']/usages
- &s1_url $ENVIRON['COMPUTE_SERVICE']/servers/$HISTORY['get server'].$RESPONSE['$.server.id']
- &s1_action $ENVIRON['COMPUTE_SERVICE']/servers/$HISTORY['get server'].$RESPONSE['$.server.id']/action
- &s1_alloc $ENVIRON['PLACEMENT_SERVICE']/allocations/$HISTORY['get server'].$RESPONSE['$.server.id']
tests:
- name: list hypervisors
GET: $ENVIRON['COMPUTE_SERVICE']/os-hypervisors
response_json_paths:
$.hypervisors.`len`: 1
- name: confirm resource provider
GET: *cn1_rp
response_json_paths:
$.uuid: $RESPONSE['$.hypervisors[0].id']
- name: confirm inventory
GET: *cn1_inv
response_json_paths:
$.inventories.VCPU.allocation_ratio: 16
- &cn1_zero
name: confirm empty allocation
GET: *cn1_alloc
response_json_paths:
$.allocations.`len`: 0
- name: create server
POST: $ENVIRON['COMPUTE_SERVICE']/servers
data:
server:
name: new-server-one
networks: auto
imageRef: $ENVIRON['IMAGE_REF']
flavorRef: $ENVIRON['FLAVOR_REF']
status: 202
- name: get server
GET: $LOCATION
- name: watch allocations
GET: *s1_alloc
poll:
count: 4
delay: 1
response_json_paths:
$.allocations.["$HISTORY['list hypervisors'].$RESPONSE['$.hypervisors[0].id']"].resources:
VCPU: 1
MEMORY_MB: 64
- name: server active
GET: *s1_url
poll:
count: 10
delay: .5
response_json_paths:
$.server.status: ACTIVE
- name: resize server
POST: *s1_action
data:
resize:
flavorRef: $ENVIRON['FLAVOR_REF_ALT']
OS-DCF:diskConfig: AUTO
status: 202
- name: wait for verify resize
GET: *s1_url
poll:
count: 12
delay: 5
response_json_paths:
$.server.status: VERIFY_RESIZE
- name: check for double allocations
GET: *s1_alloc
poll:
count: 10
delay: 1
response_json_paths:
$.allocations.["$HISTORY['list hypervisors'].$RESPONSE['$.hypervisors[0].id']"].resources:
VCPU: 2
MEMORY_MB: 192
- name: confirm usages pending
GET: *cn1_usages
response_json_paths:
$.usages:
DISK_GB: 0
MEMORY_MB: 192
VCPU: 2
- name: confirm resize
POST: *s1_action
data:
confirmResize: null
status: 204
- name: wait for active
GET: *s1_url
poll:
count: 12
delay: 5
response_json_paths:
$.server.status: ACTIVE
- name: changed to correct allocations
GET: *s1_alloc
poll:
count: 12
delay: 5
response_json_paths:
$.allocations.["$HISTORY['list hypervisors'].$RESPONSE['$.hypervisors[0].id']"].resources:
VCPU: 1
MEMORY_MB: 128
- name: confirm usages active
GET: *cn1_usages
response_json_paths:
$.usages:
DISK_GB: 0
MEMORY_MB: 128
VCPU: 1
### Clean Up
- name: delete server
DELETE: *s1_url
status: 204
- name: reconfirm empty allocation
<<: *cn1_zero
poll:
count: 12
delay: 5