# YAML anchors to make some back references into test history less # noisy, within the actual tests themselves. vars: - &rp_name pony1 - &token $HISTORY['get a token'].$HEADERS['x-subject-token'] - &placement_url $HISTORY['get a token'].$RESPONSE['$.token.catalog[?type = placement].endpoints[?interface = public].url'] - &rps_url $HISTORY['get placement versions'].$URL/resource_providers - &allocations_url $HISTORY['get placement versions'].$URL/allocations/0536bcb2-37e4-4fdf-8893-2daaaa38e2e3 - &inventories_url $HISTORY['get resource provider'].$RESPONSE['$.links[?rel = inventories].href'] - &aggregates_url $HISTORY['get resource provider'].$RESPONSE['$.links[?rel = aggregates].href'] - &usages_url $HISTORY['get resource provider'].$RESPONSE['$.links[?rel = usages].href'] - &rp_uuid $HISTORY['get resource provider'].$RESPONSE['$.uuid'] defaults: verbose: True request_headers: accept: application/json x-auth-token: *token content-type: application/json tests: # Create an auth token and get access to the service catalog. - name: get a token POST: /identity/v3/auth/tokens request_headers: # make sure we have a null auth token for this request x-auth-token: data: auth: identity: methods: - password password: user: name: $ENVIRON['OS_USERNAME'] domain: name: default password: $ENVIRON['OS_PASSWORD'] scope: domain: name: default status: 201 response_json_paths: $.token.user.name: $ENVIRON['OS_USERNAME'] $.token.catalog[?type = placement].endpoints[?interface = public].url: //placement$/ # See that the placement service is really there. - name: get placement versions GET: *placement_url response_json_paths: $.versions[?id = 'v1.0'].min_version: "1.0" # Make a resource provider and give it some inventory - name: create a resource provider POST: *rps_url data: name: *rp_name status: 201 - name: get resource provider GET: $LOCATION response_json_paths: $.links[?rel = aggregates]: /aggregates/ - name: set inventory PUT: *inventories_url data: resource_provider_generation: 0 inventories: VCPU: total: 64 min_unit: 1 max_unit: 9999 MEMORY_MB: total: 8192 min_unit: 1 max_unit: 9999 DISK_GB: total: 1024 min_unit: 1 max_unit: 9999 - name: allocate once PUT: *allocations_url data: allocations: - resource_provider: uuid: *rp_uuid resources: DISK_GB: 5 VCPU: 4 MEMORY_MB: 512 status: 204 # Clean Up - name: delete allocations DELETE: *allocations_url status: 204 - name: delete our resource provider DELETE: $HISTORY['create a resource provider'].$LOCATION status: 204