diff --git a/nova/tests/test_compute.py b/nova/tests/test_compute.py index 0523d73b6..6659b81eb 100644 --- a/nova/tests/test_compute.py +++ b/nova/tests/test_compute.py @@ -175,8 +175,9 @@ class ComputeTestCase(test.TestCase): db.instance_destroy(self.context, instance_id) def test_default_hostname_generator(self): - cases = [(None, 'server_1'), ('Hello, Server!', 'hello_server'), - ('<}\x1fh\x10e\x08l\x02l\x05o\x12!{>', 'hello')] + cases = [(None, 'server-1'), ('Hello, Server!', 'hello-server'), + ('<}\x1fh\x10e\x08l\x02l\x05o\x12!{>', 'hello'), + ('hello_server', 'hello-server')] for display_name, hostname in cases: ref = self.compute_api.create(self.context, instance_types.get_default_instance_type(), None, diff --git a/nova/tests/test_volume_types.py b/nova/tests/test_volume_types.py index 1b4c9396c..1e190805c 100644 --- a/nova/tests/test_volume_types.py +++ b/nova/tests/test_volume_types.py @@ -162,7 +162,7 @@ class VolumeTypeTestCase(test.TestCase): volume_types.create(self.ctxt, "type3", {"key3": "another_value", "key4": "val4"}) - vol_types = volume_types.get_all_types(self.ctxt, + vol_types = volume_types.get_all_types(self.ctxt, search_opts={'extra_specs': {"key1": "val1"}}) LOG.info("vol_types: %s" % vol_types) self.assertEqual(len(vol_types), 1) @@ -170,21 +170,19 @@ class VolumeTypeTestCase(test.TestCase): self.assertEqual(vol_types['type1']['extra_specs'], {"key1": "val1", "key2": "val2"}) - vol_types = volume_types.get_all_types(self.ctxt, + vol_types = volume_types.get_all_types(self.ctxt, search_opts={'extra_specs': {"key2": "val2"}}) LOG.info("vol_types: %s" % vol_types) self.assertEqual(len(vol_types), 2) self.assertTrue("type1" in vol_types.keys()) self.assertTrue("type2" in vol_types.keys()) - - vol_types = volume_types.get_all_types(self.ctxt, + vol_types = volume_types.get_all_types(self.ctxt, search_opts={'extra_specs': {"key3": "val3"}}) LOG.info("vol_types: %s" % vol_types) self.assertEqual(len(vol_types), 1) self.assertTrue("type2" in vol_types.keys()) - def test_volume_type_search_by_extra_spec_multiple(self): """Ensure volume types get by extra spec returns correct type""" volume_types.create(self.ctxt, "type1", {"key1": "val1", @@ -196,7 +194,7 @@ class VolumeTypeTestCase(test.TestCase): "key3": "val3", "key4": "val4"}) - vol_types = volume_types.get_all_types(self.ctxt, + vol_types = volume_types.get_all_types(self.ctxt, search_opts={'extra_specs': {"key1": "val1", "key3": "val3"}}) LOG.info("vol_types: %s" % vol_types)