dcf2463f1f
In 37ef669705
(in Kilo) we made signalling
a resource asynchronous because things like e.g. scaling an autoscaling
group were too slow to do synchronously (bug 1394095).
However, for resources that don't have a handle_signal() method at all,
this means that if a signal other than one handled by Heat (e.g. to
clear a hook) is received then the user won't be notified of the error.
There will instead be an error message in the logs warning of an
unhandled exception in a thread.
(Previously, similar problems occurred if the user was attempting to
clear a hook and some error occurred. This has since been fixed as bug
1472515, in Liberty.)
If there's no handle_signal() method defined, then calling
Resource.signal() is quick (i.e. it's only going to clear a hook, or
raise an error). So handle this case synchronously. This ensures that
any error is reported to the user and not in the log.
Change-Id: I917b4c7d4ab2cde46148197a3a232d5dc70f63d7
Related-Bug: #1472515
91 lines
2.0 KiB
YAML
91 lines
2.0 KiB
YAML
defaults:
|
|
request_headers:
|
|
X-Auth-Token: $ENVIRON['OS_TOKEN']
|
|
|
|
tests:
|
|
- name: create stack with resources
|
|
POST: /stacks
|
|
request_headers:
|
|
content-type: application/json
|
|
data:
|
|
files: {}
|
|
disable_rollback: true
|
|
parameters: {}
|
|
stack_name: $ENVIRON['PREFIX']-rsrcstack
|
|
template:
|
|
heat_template_version: '2016-04-08'
|
|
parameters:
|
|
test_val:
|
|
type: string
|
|
default: test
|
|
resources:
|
|
test:
|
|
type: OS::Heat::TestResource
|
|
properties:
|
|
value: {get_param: test_val}
|
|
|
|
status: 201
|
|
response_headers:
|
|
location: //stacks/$ENVIRON['PREFIX']-rsrcstack/[a-f0-9-]+/
|
|
|
|
- name: poll for rsrcstack CREATE_COMPLETE
|
|
GET: $LOCATION
|
|
redirects: True
|
|
poll:
|
|
count: 5
|
|
delay: 1.0
|
|
response_json_paths:
|
|
$.stack.stack_status: CREATE_COMPLETE
|
|
|
|
- name: list resources
|
|
GET: $LAST_URL/resources
|
|
request_headers:
|
|
content-type: application/json
|
|
status: 200
|
|
response_json_paths:
|
|
$.resources[0].logical_resource_id: test
|
|
$.resources[0].resource_status: CREATE_COMPLETE
|
|
|
|
- name: list filtered resources
|
|
GET: $LAST_URL
|
|
request_headers:
|
|
content-type: application/json
|
|
query_parameters:
|
|
type: OS::Nova::Server
|
|
status: 200
|
|
response_json_paths:
|
|
$.resources: []
|
|
|
|
- name: show resource
|
|
GET: $LAST_URL/test
|
|
request_headers:
|
|
content-type: application/json
|
|
status: 200
|
|
response_json_paths:
|
|
$.resource.attributes.output: test
|
|
|
|
- name: mark resource unhealthy
|
|
PATCH: $LAST_URL
|
|
request_headers:
|
|
content-type: application/json
|
|
data:
|
|
mark_unhealthy: true
|
|
resource_status_reason: 'resource deleted'
|
|
status: 200
|
|
|
|
- name: show unhealthy resource
|
|
GET: $LAST_URL
|
|
status: 200
|
|
response_json_paths:
|
|
$.resource.resource_status: CHECK_FAILED
|
|
$.resource.resource_status_reason: 'resource deleted'
|
|
|
|
- name: signal resource
|
|
POST: $LAST_URL/signal
|
|
status: 400
|
|
|
|
- name: delete stack with resources
|
|
DELETE: /stacks/$ENVIRON['PREFIX']-rsrcstack
|
|
redirects: True
|
|
status: 204
|