diff --git a/etc/test.conf b/etc/test.conf index 120d1248..c6903b62 100644 --- a/etc/test.conf +++ b/etc/test.conf @@ -11,7 +11,7 @@ catalog_type = identity # environments that have self-signed SSL certs. disable_ssl_certificate_validation = False # URL for where to find the OpenStack Identity API endpoint (Keystone) -uri = http://172.18.194.41:5000/v2.0/ +uri = http://172.18.164.38:5000/v2.0/ # URL for where to find the OpenStack V3 Identity API endpoint (Keystone) #uri_v3 = http://127.0.0.1:5000/v3/ # Should typically be left as keystone unless you have a non-Keystone @@ -46,6 +46,18 @@ admin_tenant_name = admin # This section contains configuration options used when executing tests # against the OpenStack Compute API. +#One of the controller nodes +controller_node = 172.18.164.38 + +#Controller node user who able connect via ssh +controller_node_ssh_user = root + +#Controller node ssh user's password +controller_node_ssh_password = r00tme + +#The list of the services should be enabled +enabled_services=nova-cert, nova-consoleauth, nova-scheduler, nova-conductor, nova-compute, nova-compute + # Allows test cases to create/destroy tenants and users. This option # enables isolated test cases and better parallel execution, # but also requires that OpenStack Identity API admin credentials @@ -186,7 +198,7 @@ public_network_id = public_router_id = # Whether or not quantum is expected to be available -quantum_available = false +quantum_available = true [volume] # This section contains the configuration options used when executing tests diff --git a/fuel/config.py b/fuel/config.py index 83058e88..75a5aa54 100644 --- a/fuel/config.py +++ b/fuel/config.py @@ -180,6 +180,20 @@ ComputeGroup = [ default=True, help="If false, skip config tests regardless of the " "extension status"), + cfg.ListOpt('enabled_services', + default=[], + help="If false, skip config tests regardless of the " + "extension status"), + cfg.StrOpt('controller_node', + default='127.0.0.1', + help="IP address of one of the controller nodes"), + cfg.StrOpt('controller_node_ssh_user', + default='ssh_user', + help="ssh user of one of the controller nodes"), + cfg.StrOpt('controller_node_ssh_password', + default='pass', + help="ssh user pass of one of the controller nodes"), + ] diff --git a/fuel/tests/sanity/base.py b/fuel/tests/sanity/base.py index 91baf3aa..d2c8c446 100644 --- a/fuel/tests/sanity/base.py +++ b/fuel/tests/sanity/base.py @@ -20,9 +20,9 @@ import time from fuel import clients from fuel.common.utils.data_utils import rand_name import fuel.test -from fuel import sanity from fuel.common import log as logging from fuel import exceptions +from fuel.tests import sanity LOG = logging.getLogger(__name__) diff --git a/fuel/tests/sanity/test_sanity_compute.py b/fuel/tests/sanity/test_sanity_compute.py index 4f5b1dd8..38806cc5 100644 --- a/fuel/tests/sanity/test_sanity_compute.py +++ b/fuel/tests/sanity/test_sanity_compute.py @@ -1,42 +1,41 @@ - -from fuel.sanity import base from fuel.test import attr +from fuel.tests.sanity import base class SanityComputeTest(base.BaseComputeTest): _interface = 'json' - @attr(type='sanity') + @attr(type=['sanity', 'fuel']) def test_list_instances(self): resp, body = self.servers_client.list_servers() self.assertEqual(200, resp.status) self.assertTrue(u'servers' in body) - @attr(type='sanity') + @attr(type=['sanity', 'fuel']) def test_list_images(self): resp, body = self.images_client.list_images() self.assertEqual(200, resp.status) self.assertTrue(u'images' in body) - @attr(type='sanity') + @attr(type=['sanity', 'fuel']) def test_list_volumes(self): resp, body = self.volumes_client.list_volumes() self.assertEqual(200, resp.status) self.assertTrue(u'volumes' in body) - @attr(type='sanity') + @attr(type=['sanity', 'fuel']) def test_list_snapshots(self): resp, body = self.snapshots_client.list_snapshots() self.assertEqual(200, resp.status) self.assertTrue(u'snapshots' in body) - @attr(type='sanity') + @attr(type=['sanity', 'fuel']) def test_list_flavors(self): resp, body = self.flavors_client.list_flavors() self.assertEqual(200, resp.status) self.assertTrue(u'flavors' in body) - @attr(type='sanity') + @attr(type=['sanity', 'fuel']) def test_list_rate_limits(self): resp, body = self.limits_client.get_absolute_limits() self.assertEqual(200, resp.status) diff --git a/fuel/tests/sanity/test_sanity_identity.py b/fuel/tests/sanity/test_sanity_identity.py index bc101ae2..58b0dc80 100644 --- a/fuel/tests/sanity/test_sanity_identity.py +++ b/fuel/tests/sanity/test_sanity_identity.py @@ -1,22 +1,20 @@ - -from fuel.sanity import base +from fuel.tests.sanity import base from fuel.test import attr class ServicesTestJSON(base.BaseIdentityAdminTest): _interface = 'json' - @attr(type='sanity') + @attr(type=['sanity', 'fuel']) def test_list_services(self): # List and Verify Services resp, body = self.client.list_services() self.assertEqual(200, resp.status) self.assertTrue(u'OS-KSADM:services' in body) - @attr(type='sanity') + @attr(type=['sanity', 'fuel']) def test_list_users(self): # List users resp, body = self.client.get_users() self.assertEqual(200, resp.status) - self.assertTrue(u'users' in body) - + self.assertTrue(u'users' in body) \ No newline at end of file diff --git a/fuel/tests/sanity/test_sanity_infrastructure.py b/fuel/tests/sanity/test_sanity_infrastructure.py new file mode 100644 index 00000000..22d0b682 --- /dev/null +++ b/fuel/tests/sanity/test_sanity_infrastructure.py @@ -0,0 +1,34 @@ +import paramiko +from fuel.test import attr +from fuel.tests.sanity import base + + +class SanityInfrastructureTest(base.BaseComputeAdminTest): + _interface = 'json' + + @attr(type=['sanity', 'fuel']) + def test_services_state(self): + list_of_expected_services = self.config.compute.enabled_services + hostname = self.config.compute.controller_node + port = 22 + username = self.config.compute.controller_node_ssh_user + password = self.config.compute.controller_node_ssh_password + sshClient = paramiko.SSHClient() + sshClient.set_missing_host_key_policy(paramiko.AutoAddPolicy()) + try: + sshClient.connect(hostname, port, username, password) + _, out, err = sshClient.exec_command("nova-manage service list") + out = out.readlines() + err = err.readlines() + except BaseException: + raise + finally: + sshClient.close() + self.assertEqual("[]", + str(err), + ("nova-manage service list command has " + "finished with the following error %s") % err) + self.assertFalse(u'XXX' in out) + self.assertEqual(len(list_of_expected_services), + str(out).count(u':-)'), + 'Not all the expected services started') \ No newline at end of file diff --git a/fuel/tests/sanity/test_sanity_networking.py b/fuel/tests/sanity/test_sanity_networking.py index 60a30aa2..228f41e5 100644 --- a/fuel/tests/sanity/test_sanity_networking.py +++ b/fuel/tests/sanity/test_sanity_networking.py @@ -1,17 +1,15 @@ - -from fuel.sanity import base from fuel.test import attr +from fuel.tests.sanity import base class NetworksTest(base.BaseNetworkTest): - @attr(type='sanity') + @attr(type=['sanity', 'fuel']) def test_list_networks(self): resp, body = self.client.list_networks() self.assertEqual(200, resp.status) self.assertTrue(u'networks' in body) - - @attr(type='sanity') + @attr(type=['sanity', 'fuel']) def test_list_ports(self): resp, body = self.client.list_ports() self.assertEqual(200, resp.status)