Merge "Fixes variables in Tempest generated config file"
This commit is contained in:
commit
024d4b5598
@ -3,49 +3,50 @@ debug = True
|
||||
log_file = tempest.log
|
||||
use_stderr = False
|
||||
|
||||
[auth]
|
||||
allow_tenant_isolation = False
|
||||
|
||||
[boto]
|
||||
ssh_user = cirros
|
||||
instance_type = m1.nano
|
||||
http_socket_timeout = 30
|
||||
build_interval = 1
|
||||
build_timeout = 196
|
||||
|
||||
[cli]
|
||||
cli_dir = /usr/local/bin
|
||||
|
||||
[compute]
|
||||
ssh_connect_method = floating
|
||||
use_block_migration_for_live_migration = False
|
||||
live_migration_available = False
|
||||
image_alt_ssh_user = cirros
|
||||
image_ssh_user = cirros
|
||||
ssh_timeout = 196
|
||||
ip_version_for_ssh = 4
|
||||
image_alt_ssh_user = cirros
|
||||
network_for_ssh = private
|
||||
ssh_user = cirros
|
||||
allow_tenant_isolation = False
|
||||
change_password_available = False
|
||||
build_interval = 1
|
||||
build_timeout = 196
|
||||
|
||||
[compute-admin]
|
||||
[compute-feature-enabled]
|
||||
change_password = False
|
||||
live_migration = False
|
||||
block_migration_for_live_migration = False
|
||||
|
||||
[identity]
|
||||
|
||||
[network]
|
||||
default_network = 10.0.0.0/24
|
||||
tenant_networks_reachable = false
|
||||
api_version = 2.0
|
||||
tenant_networks_reachable = False
|
||||
|
||||
[network-feature-enabled]
|
||||
api_extensions = all
|
||||
ipv6 = True
|
||||
|
||||
[oslo_concurrency]
|
||||
|
||||
[scenario]
|
||||
large_ops_number = 0
|
||||
ssh_user = cirros
|
||||
|
||||
[service_available]
|
||||
|
||||
[validation]
|
||||
ssh_timeout = 196
|
||||
ip_version_for_ssh = 4
|
||||
|
||||
[volume]
|
||||
build_interval = 1
|
||||
build_timeout = 196
|
||||
|
@ -114,11 +114,15 @@ class TempestConf(object):
|
||||
return service["endpoints"][0]["publicURL"]
|
||||
|
||||
def _set_default(self):
|
||||
# Nothing to set up in this section for now
|
||||
pass
|
||||
|
||||
def _set_oslo_concurrency(self, section_name="oslo_concurrency"):
|
||||
lock_path = os.path.join(self.data_path,
|
||||
"lock_files_%s" % self.deployment)
|
||||
if not os.path.exists(lock_path):
|
||||
os.makedirs(lock_path)
|
||||
self.conf.set("DEFAULT", "lock_path", lock_path)
|
||||
self.conf.set(section_name, "lock_path", lock_path)
|
||||
|
||||
def _set_boto(self, section_name="boto"):
|
||||
self.conf.set(section_name, "ec2_url", self._get_url("ec2"))
|
||||
@ -176,12 +180,6 @@ class TempestConf(object):
|
||||
else:
|
||||
self.conf.set(section_name, "ssh_connect_method", "fixed")
|
||||
|
||||
def _set_compute_admin(self, section_name="compute-admin"):
|
||||
self.conf.set(section_name, "username", self.endpoint["username"])
|
||||
self.conf.set(section_name, "password", self.endpoint["password"])
|
||||
self.conf.set(section_name, "tenant_name",
|
||||
self.endpoint["tenant_name"])
|
||||
|
||||
def _set_identity(self, section_name="identity"):
|
||||
self.conf.set(section_name, "username", self.endpoint["username"])
|
||||
self.conf.set(section_name, "password", self.endpoint["password"])
|
||||
@ -229,10 +227,10 @@ class TempestConf(object):
|
||||
else:
|
||||
# TODO(akurilin): create subnet
|
||||
LOG.warn("No subnet is found.")
|
||||
self.conf.set(section_name, "default_network", subnet["cidr"])
|
||||
self.conf.set(section_name, "tenant_network_cidr", subnet["cidr"])
|
||||
else:
|
||||
network = self.clients.nova().networks.list()[0]
|
||||
self.conf.set(section_name, "default_network", network.cidr)
|
||||
self.conf.set(section_name, "tenant_network_cidr", network.cidr)
|
||||
|
||||
def _set_service_available(self, section_name="service_available"):
|
||||
services = ["neutron", "heat", "ceilometer", "swift",
|
||||
|
@ -106,7 +106,6 @@ class ConfigTestCase(test.TestCase):
|
||||
("build_timeout", "196"),
|
||||
("http_socket_timeout", "30"),
|
||||
("instance_type", "m1.nano"),
|
||||
("ssh_user", "cirros"),
|
||||
("s3_materials_path",
|
||||
os.path.join(self.conf_generator.data_path,
|
||||
"s3materials")))
|
||||
@ -114,15 +113,6 @@ class ConfigTestCase(test.TestCase):
|
||||
self.conf_generator.conf.items("boto"))
|
||||
self.assertEqual(sorted(expected), sorted(results))
|
||||
|
||||
def test__set_compute_admin(self):
|
||||
self.conf_generator._set_compute_admin()
|
||||
expected = [("username", self.endpoint["username"]),
|
||||
("password", self.endpoint["password"]),
|
||||
("tenant_name", self.endpoint["tenant_name"])]
|
||||
results = self._remove_default_section(
|
||||
self.conf_generator.conf.items("compute-admin"))
|
||||
self.assertEqual(sorted(expected), sorted(results))
|
||||
|
||||
def test__set_compute_flavors(self):
|
||||
mock_novaclient = mock.MagicMock()
|
||||
mock_novaclient.flavors.list.return_value = [
|
||||
@ -217,18 +207,24 @@ class ConfigTestCase(test.TestCase):
|
||||
self.conf_generator.conf.get("compute",
|
||||
"ssh_connect_method"))
|
||||
|
||||
def test__set_default(self):
|
||||
self.conf_generator._set_default()
|
||||
expected = (("debug", "True"), ("log_file", "tempest.log"),
|
||||
("use_stderr", "False"))
|
||||
results = self.conf_generator.conf.items("DEFAULT")
|
||||
self.assertEqual(sorted(expected), sorted(results))
|
||||
|
||||
@mock.patch("rally.verification.tempest.config.os.path.exists",
|
||||
return_value=False)
|
||||
@mock.patch("rally.verification.tempest.config.os.makedirs")
|
||||
def test__set_default(self, mock_makedirs, mock_exists):
|
||||
self.conf_generator._set_default()
|
||||
def test__set_oslo_concurrency(self, mock_makedirs, mock_exists):
|
||||
self.conf_generator._set_oslo_concurrency()
|
||||
lock_path = os.path.join(self.conf_generator.data_path, "lock_files_%s"
|
||||
% self.deployment)
|
||||
mock_makedirs.assert_called_once_with(lock_path)
|
||||
expected = (("debug", "True"), ("log_file", "tempest.log"),
|
||||
("use_stderr", "False"),
|
||||
("lock_path", lock_path))
|
||||
results = self.conf_generator.conf.items("DEFAULT")
|
||||
expected = (("lock_path", lock_path),)
|
||||
results = self._remove_default_section(
|
||||
self.conf_generator.conf.items("oslo_concurrency"))
|
||||
self.assertEqual(sorted(expected), sorted(results))
|
||||
|
||||
def test__set_identity(self):
|
||||
@ -268,9 +264,8 @@ class ConfigTestCase(test.TestCase):
|
||||
mock_neutron}):
|
||||
self.conf_generator.available_services = ["neutron"]
|
||||
self.conf_generator._set_network()
|
||||
expected = (("default_network", "10.0.0.0/24"),
|
||||
("tenant_networks_reachable", "false"),
|
||||
("api_version", "2.0"),
|
||||
expected = (("tenant_network_cidr", "10.0.0.0/24"),
|
||||
("tenant_networks_reachable", "False"),
|
||||
("public_network_id", "test_id"),
|
||||
("public_router_id", "test_router"))
|
||||
results = self._remove_default_section(
|
||||
@ -288,8 +283,8 @@ class ConfigTestCase(test.TestCase):
|
||||
with mock.patch.dict("sys.modules", {"novaclient": mock_nova}):
|
||||
self.conf_generator._set_network()
|
||||
self.assertEqual(network,
|
||||
self.conf_generator.conf.get("network",
|
||||
"default_network"))
|
||||
self.conf_generator.conf.get(
|
||||
"network", "tenant_network_cidr"))
|
||||
|
||||
@mock.patch("rally.verification.tempest.config.requests")
|
||||
def test__set_service_available(self, mock_requests):
|
||||
|
Loading…
Reference in New Issue
Block a user