sync tempest tests

Change-Id: I54c7809aff28921d550190ae3d26fa8c24233782
This commit is contained in:
Eyal 2018-01-03 16:41:35 +02:00
parent 805f7c5d96
commit e08334e635
2 changed files with 14 additions and 6 deletions

View File

@ -179,7 +179,7 @@ class TestResource(BaseVitrageTempest):
sorted_cli_resources = sorted(
json.loads(cli_resources),
key=lambda resource: resource["vitrage_id"])
key=lambda resource: resource["ID"])
sorted_api_resources = sorted(
api_resources,
key=lambda resource: resource["vitrage_id"])
@ -190,10 +190,19 @@ class TestResource(BaseVitrageTempest):
for cli_resource, api_resource in \
zip(sorted_cli_resources, sorted_api_resources):
for item in self.properties:
self.assertEqual(cli_resource.get(item).lower(),
api_resource.get(item).lower(),
'for item %s' % item)
self.assertEqual(
cli_resource.get("ID").lower(),
api_resource.get(VProps.VITRAGE_ID).lower())
self.assertEqual(
cli_resource.get("Type").lower(),
api_resource.get(VProps.VITRAGE_TYPE).lower())
self.assertEqual(
cli_resource.get("Data Source ID").lower(),
api_resource.get(VProps.ID).lower())
self.assertEqual(
cli_resource.get("State").lower(),
api_resource.get(VProps.VITRAGE_OPERATIONAL_STATE).lower())
def _compare_resource_show(self, api_resource_show,
cli_resource_show):

View File

@ -24,7 +24,6 @@ import os
import re
import subprocess
LOG = logging.getLogger(__name__)