Run svc-map tests
We currently do not run these tests and they also fail. Change-Id: I60c8cbd9495b52fb8b4c848549822a05f921664f
This commit is contained in:
parent
100959de8d
commit
89dd01e4a0
@ -15,6 +15,7 @@
|
|||||||
import os
|
import os
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
|
import six
|
||||||
import yaml
|
import yaml
|
||||||
|
|
||||||
|
|
||||||
@ -38,7 +39,7 @@ def merge_data(source, destination, distro):
|
|||||||
result = dict()
|
result = dict()
|
||||||
result.update(destination)
|
result.update(destination)
|
||||||
family = os_family(distro)
|
family = os_family(distro)
|
||||||
for servicename, mapping in source.iteritems():
|
for servicename, mapping in six.iteritems(source):
|
||||||
if servicename in result:
|
if servicename in result:
|
||||||
raise Exception("%s already found in services list" % servicename)
|
raise Exception("%s already found in services list" % servicename)
|
||||||
if distro in mapping:
|
if distro in mapping:
|
||||||
|
0
elements/svc-map/tests/__init__.py
Normal file
0
elements/svc-map/tests/__init__.py
Normal file
@ -12,8 +12,11 @@
|
|||||||
# License for the specific language governing permissions and limitations
|
# License for the specific language governing permissions and limitations
|
||||||
# under the License.
|
# under the License.
|
||||||
import imp
|
import imp
|
||||||
service_map = imp.load_source('service_map',
|
import os
|
||||||
'../extra-data.d/10-merge-svc-map-files')
|
|
||||||
|
module_path = (os.path.dirname(os.path.realpath(__file__)) +
|
||||||
|
'/../extra-data.d/10-merge-svc-map-files')
|
||||||
|
service_map = imp.load_source('service_map', module_path)
|
||||||
|
|
||||||
from oslotest import base
|
from oslotest import base
|
||||||
|
|
||||||
@ -98,7 +101,7 @@ class TestDataMerge(base.BaseTestCase):
|
|||||||
}
|
}
|
||||||
|
|
||||||
result = dict()
|
result = dict()
|
||||||
result = service_map.merge_json(self.nova_api_services,
|
result = service_map.merge_data(self.nova_api_services,
|
||||||
result,
|
result,
|
||||||
"fedora")
|
"fedora")
|
||||||
|
|
||||||
@ -106,7 +109,7 @@ class TestDataMerge(base.BaseTestCase):
|
|||||||
fedora_nova_api_services,
|
fedora_nova_api_services,
|
||||||
"Merge failed")
|
"Merge failed")
|
||||||
|
|
||||||
result = service_map.merge_json(self.glance_api_services,
|
result = service_map.merge_data(self.glance_api_services,
|
||||||
result,
|
result,
|
||||||
"fedora")
|
"fedora")
|
||||||
|
|
||||||
@ -114,7 +117,7 @@ class TestDataMerge(base.BaseTestCase):
|
|||||||
fedora_nova_glance_services,
|
fedora_nova_glance_services,
|
||||||
"Merge failed")
|
"Merge failed")
|
||||||
|
|
||||||
result = service_map.merge_json(self.cinder_api_services,
|
result = service_map.merge_data(self.cinder_api_services,
|
||||||
result,
|
result,
|
||||||
"fedora")
|
"fedora")
|
||||||
self.assertDictEqual(result,
|
self.assertDictEqual(result,
|
||||||
@ -154,7 +157,7 @@ class TestDataMerge(base.BaseTestCase):
|
|||||||
}
|
}
|
||||||
|
|
||||||
result = dict()
|
result = dict()
|
||||||
result = service_map.merge_json(self.nova_api_services,
|
result = service_map.merge_data(self.nova_api_services,
|
||||||
result,
|
result,
|
||||||
"ubuntu")
|
"ubuntu")
|
||||||
|
|
||||||
@ -162,7 +165,7 @@ class TestDataMerge(base.BaseTestCase):
|
|||||||
ubuntu_nova_api_services,
|
ubuntu_nova_api_services,
|
||||||
"Merge failed")
|
"Merge failed")
|
||||||
|
|
||||||
result = service_map.merge_json(self.glance_api_services,
|
result = service_map.merge_data(self.glance_api_services,
|
||||||
result,
|
result,
|
||||||
"ubuntu")
|
"ubuntu")
|
||||||
|
|
||||||
@ -170,7 +173,7 @@ class TestDataMerge(base.BaseTestCase):
|
|||||||
ubuntu_nova_glance_services,
|
ubuntu_nova_glance_services,
|
||||||
"Merge failed")
|
"Merge failed")
|
||||||
|
|
||||||
result = service_map.merge_json(self.cinder_api_services,
|
result = service_map.merge_data(self.cinder_api_services,
|
||||||
result,
|
result,
|
||||||
"ubuntu")
|
"ubuntu")
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user