Ask Your Question

Tempest test NeutronResourcesTestJSON fails with "KeyError: 'physical_resource_id'"

asked 2015-12-07 09:12:35 -0500

guoping-jia gravatar image

it's running against liberty branch. Here is the detailed tracestack:

2015-12-03 09:41:36.168 | 2015-12-03 09:41:36.169 | setUpClass (tempest.api.orchestration.stacks.test_neutron_resources.NeutronResourcesTestJSON) 2015-12-03 09:41:36.169 | --------------------------------------------------------------------------------------------- 2015-12-03 09:41:36.169 | 2015-12-03 09:41:36.169 | Captured traceback: 2015-12-03 09:41:36.169 | ~~~~~~~~~~~~~~~~~~~ 2015-12-03 09:41:36.169 | Traceback (most recent call last): 2015-12-03 09:41:36.169 | File "/opt/stack/service/tempest/venv/lib/python2.7/site-packages/tempest/", line 274, in setUpClass 2015-12-03 09:41:36.170 | six.reraise(etype, value, trace) 2015-12-03 09:41:36.170 | File "/opt/stack/service/tempest/venv/lib/python2.7/site-packages/tempest/", line 267, in setUpClass 2015-12-03 09:41:36.170 | cls.resource_setup() 2015-12-03 09:41:36.170 | File "/opt/stack/service/tempest/venv/lib/python2.7/site-packages/tempest/api/orchestration/stacks/", line 88, in resource_setup 2015-12-03 09:41:36.170 | server_id = body['physical_resource_id'] 2015-12-03 09:41:36.170 | KeyError: 'physical_resource_id' 2015-12-03 09:41:36.170 |

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted

answered 2016-03-03 01:07:51 -0500

hayderimran7 gravatar image

Hi i figured this out why it was happening. This is because when you run tempest test tempest.api.orchestration.test_neutron_resources with the default given template neutron_basic.yaml, that template uses waitcondition api of heat that you define in your heat.conf in mine it was : heat_waitcondition_server_url = (

you have to make sure you can curl this api from inside your vm , any nova vm . if you cannot curl , you simply will get timeout on that wait condition, because the curl keeps failing to connect to /v1/waitcondition api, and unless that waitcondition is fulfilled, your stack status will never be in COMPLETE state.

now the template creates a wait condition, wait condition is fulfilled when the vm lauched through the stack sends a signal. the signal is using the following command defined in neutron_basic.yaml:

        #!/bin/sh -v
        SIGNAL_DATA='{"Status": "SUCCESS", "Reason": "SmokeServerNeutron created", "Data": "Application has completed configuration.", "UniqueId": "00000"}'
        while ! curl --fail -X PUT -H 'Content-Type:' --data-binary "$SIGNAL_DATA" \
        'wait_handle' ; do sleep 3; done

this is the command runs inside your vm, how i know this, when the test is running, you can go to horizon, click orchestration, click on tempest stack and click on the server > log. i could see the error:

curl: failed to curl localhost by simply removing the following part from neutron_basics.yaml, your test shall pass :)

     user_data_format: RAW
      template: |
        #!/bin/sh -v
        SIGNAL_DATA='{"Status": "SUCCESS", "Reason": "SmokeServerNeutron created", "Data": "Application has completed configuration.", "UniqueId": "00000"}'
        while ! curl --fail -X PUT -H 'Content-Type:' --data-binary "$SIGNAL_DATA" \
        'wait_handle' ; do sleep 3; done
        wait_handle: {get_resource: WaitHandleNeutron}
         type: AWS::CloudFormation::WaitConditionHandle
         type: AWS::CloudFormation::WaitCondition
depends_on: Server
  Handle: {get_resource: WaitHandleNeutron}
  Timeout: {get_param: timeout}

After you removed this , rerun and it shall pass :)

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Get to know Ask OpenStack

Resources for moderators

Question Tools

1 follower


Asked: 2015-12-07 09:12:35 -0500

Seen: 166 times

Last updated: Mar 03 '16