diff --git a/test/integration/component/test_accounts.py b/test/integration/component/test_accounts.py index 1170c796c35..67b56fd4c7f 100644 --- a/test/integration/component/test_accounts.py +++ b/test/integration/component/test_accounts.py @@ -915,7 +915,7 @@ class TestTemplateHierarchy(cloudstackTestCase): raise Exception("Warning: Exception during cleanup : %s" % e) return - @attr(tags=["advanced", "basic", "eip", "advancedns", "sg", "needle"]) + @attr(tags=["advanced", "basic", "eip", "advancedns", "sg"]) def test_01_template_hierarchy(self): """Test to verify template at same level in hierarchy""" diff --git a/test/integration/component/test_custom_hostname.py b/test/integration/component/test_custom_hostname.py index e569215980c..0898e1e5873 100644 --- a/test/integration/component/test_custom_hostname.py +++ b/test/integration/component/test_custom_hostname.py @@ -20,12 +20,9 @@ import marvin from nose.plugins.attrib import attr from marvin.cloudstackTestCase import * -from marvin.cloudstackAPI import * from marvin.integration.lib.utils import * from marvin.integration.lib.base import * from marvin.integration.lib.common import * -from marvin.remoteSSHClient import remoteSSHClient -import datetime class Services: @@ -157,6 +154,8 @@ class TestInstanceNameFlagTrue(cloudstackTestCase): raise Exception("Warning: Exception during cleanup : %s" % e) return + + @attr(configuration='vm.instancename.flag') @attr(tags=["advanced", "basic", "sg", "eip", "advancedns", "simulator"]) def test_01_user_provided_hostname(self): @@ -168,6 +167,8 @@ class TestInstanceNameFlagTrue(cloudstackTestCase): # should be user provided display name # 2. Give the user provided user name. Internal name should be # i---display name + if not is_config_suitable(apiclient=self.apiclient, name='vm.instancename.flag', value='true'): + self.skipTest('vm.instancename.flag should be true. skipping') self.debug("Deploying VM in account: %s" % self.account.name) # Spawn an instance in that network @@ -270,6 +271,8 @@ class TestInstanceNameFlagTrue(cloudstackTestCase): # should be user provided display name # 2. Dont give the user provided user name. Internal name should be # i--- in global config + if not is_config_suitable(apiclient=self.apiclient, name='vm.instancename.flag', value='true'): + self.skipTest('vm.instancename.flag should be true. skipping') # Removing display name from config del self.services["virtual_machine"]["displayname"] diff --git a/tools/marvin/marvin/integration/lib/common.py b/tools/marvin/marvin/integration/lib/common.py index e78f64a52de..4f5acef1a3a 100644 --- a/tools/marvin/marvin/integration/lib/common.py +++ b/tools/marvin/marvin/integration/lib/common.py @@ -18,8 +18,6 @@ """ #Import Local Modules -import marvin -from marvin.cloudstackTestCase import * from marvin.cloudstackAPI import * from marvin.remoteSSHClient import remoteSSHClient from utils import * @@ -29,6 +27,15 @@ from base import * import time +def is_config_suitable(apiclient, name, value): + """ + Ensure if the deployment has the expected `value` for the global setting `name' + @return: true if value is set, else false + """ + configs = Configurations.list(apiclient, name=name) + assert(configs is not None and isinstance(configs, list) and len(configs) > 0) + return configs[0].value == value + def wait_for_cleanup(apiclient, configs=None): """Sleeps till the cleanup configs passed""" diff --git a/tools/marvin/marvin/integration/lib/utils.py b/tools/marvin/marvin/integration/lib/utils.py index f7f39c93006..16bbb7e33ba 100644 --- a/tools/marvin/marvin/integration/lib/utils.py +++ b/tools/marvin/marvin/integration/lib/utils.py @@ -109,7 +109,7 @@ def cleanup_resources(api_client, resources): obj.delete(api_client) -def is_server_ssh_ready(ipaddress, port, username, password, retries=50, keyPairFileLocation=None): +def is_server_ssh_ready(ipaddress, port, username, password, retries=5, timeout=20, keyPairFileLocation=None): """Return ssh handle else wait till sshd is running""" loop_cnt = retries while True: @@ -124,9 +124,10 @@ def is_server_ssh_ready(ipaddress, port, username, password, retries=50, keyPair if loop_cnt == 0: raise e loop_cnt = loop_cnt - 1 - time.sleep(30) + time.sleep(timeout) else: return ssh + raise Exception("Failed to bring up ssh service in time. Waited %ss" % retries*timeout) def format_volume_to_ext3(ssh_client, device="/dev/sda"): @@ -157,6 +158,7 @@ def fetch_api_client(config_file='datacenterCfg'): ) + def get_process_status(hostip, port, username, password, linklocalip, process, hypervisor=None): """Double hop and returns a process status"""