check panko during integration test

check to see we got compute.instance.create.end event.

Depends-On: I455419bd215c45ece19b27317bf10282b48b7a96
Change-Id: I322438f6af123a5c0aa32b181c6f8a4b6151d001
This commit is contained in:
gord chung 2017-01-10 21:41:58 +00:00 committed by gordon chung
parent 6eab130464
commit 8aefdcd67c
5 changed files with 40 additions and 3 deletions

View File

@ -75,6 +75,40 @@ tests:
- '"id": "$RESPONSE["$.servers[0].id"]"'
- '"id": "$RESPONSE["$.servers[1].id"]"'
- name: list servers again
desc: grab servers to check for events
url: $ENVIRON['NOVA_SERVICE_URL']/servers/detail
method: GET
poll:
count: 5
delay: 1
response_json_paths:
$.servers.`len`: 2
- name: check event
desc: Check panko for new instance.create.end event
url: $ENVIRON['PANKO_SERVICE_URL']/v2/events
method: GET
request_headers:
content-type: application/json
data:
q:
- field: event_type
op: eq
type: string
value: compute.instance.create.end
- field: resource_id
op: eq
type: string
value: $RESPONSE['$.servers[0].id']
poll:
count: 30
delay: 1
response_json_paths:
$.`len`: 1
$[0].event_type: compute.instance.create.end
$[0].traits[?(@.name='resource_id')].value: $RESPONSE['$.servers[0].id']
- name: check alarm
desc: Check the aodh alarm and its state
url: $ENVIRON['AODH_SERVICE_URL']/v2/alarms

View File

@ -26,7 +26,7 @@ TESTS_DIR = 'gabbits-live'
def load_tests(loader, tests, pattern):
"""Provide a TestSuite to the discovery process."""
NEEDED_ENV = ["AODH_SERVICE_URL", "GNOCCHI_SERVICE_URL",
"HEAT_SERVICE_URL", "NOVA_SERVICE_URL",
"HEAT_SERVICE_URL", "NOVA_SERVICE_URL", "PANKO_SERVICE_URL",
"GLANCE_IMAGE_NAME", "ADMIN_TOKEN"]
for env_variable in NEEDED_ENV:

View File

@ -89,6 +89,7 @@ fi
openstack catalog list
export AODH_SERVICE_URL=$(openstack catalog show alarming -c endpoints -f value | awk '/public/{print $2}')
export PANKO_SERVICE_URL=$(openstack catalog show event -c endpoints -f value | awk '/public/{print $2}')
export GNOCCHI_SERVICE_URL=$(openstack catalog show metric -c endpoints -f value | awk '/public/{print $2}')
export HEAT_SERVICE_URL=$(openstack catalog show orchestration -c endpoints -f value | awk '/public/{print $2}')
export NOVA_SERVICE_URL=$(openstack catalog show compute -c endpoints -f value | awk '/public/{print $2}')

View File

@ -24,7 +24,7 @@ class TestAutoscalingGabbi(manager.ScenarioTest):
@classmethod
def skip_checks(cls):
super(TestAutoscalingGabbi, cls).skip_checks()
for name in ["aodh_plugin", "gnocchi", "nova", "heat",
for name in ["aodh_plugin", "gnocchi", "nova", "heat", "panko",
"ceilometer", "glance"]:
cls._check_service(name)
@ -50,6 +50,8 @@ class TestAutoscalingGabbi(manager.ScenarioTest):
auth, "alarming_plugin")
os.environ["GNOCCHI_SERVICE_URL"] = cls._get_endpoint_for(
auth, "metric")
os.environ["PANKO_SERVICE_URL"] = cls._get_endpoint_for(
auth, "event")
os.environ["HEAT_SERVICE_URL"] = cls._get_endpoint_for(
auth, "orchestration")
os.environ["NOVA_SERVICE_URL"] = cls._get_endpoint_for(auth, "compute")

View File

@ -29,7 +29,7 @@ whitelist_externals = bash
setenv = OS_TEST_PATH=./ceilometer/tests/integration
OS_TEST_TIMEOUT=2400
GABBI_LIVE_FAIL_IF_NO_TEST=1
passenv = {[testenv]passenv} HEAT_* CEILOMETER_* GNOCCHI_* AODH_* GLANCE_* NOVA_* ADMIN_*
passenv = {[testenv]passenv} HEAT_* CEILOMETER_* GNOCCHI_* AODH_* PANKO_* GLANCE_* NOVA_* ADMIN_*
# NOTE(sileht): run gabbi-run to failfast in case of error because testr
# doesn't support --failfast, but we loose the testr report.
commands =