diff --git a/test/integration/smoke/test_events_resource.py b/test/integration/smoke/test_events_resource.py index dac95f8c090a..1f5fd3a60c1b 100644 --- a/test/integration/smoke/test_events_resource.py +++ b/test/integration/smoke/test_events_resource.py @@ -147,16 +147,25 @@ def test_01_events_resource(self): diskofferingid=self.disk_offering.id ) self.cleanup.append(volume) - virtual_machine.attach_volume( - self.apiclient, - volume - ) + try: + virtual_machine.attach_volume( + self.apiclient, + volume + ) + except Exception as e: + print("Failed to attach volume to VM: %s" % e) + pass + virtual_machine.stop(self.apiclient) account_network.restart(self.apiclient, cleanup=False) time.sleep(self.services["sleep"]) virtual_machine.restore(self.apiclient) time.sleep(self.services["sleep"]) - virtual_machine.detach_volume(self.apiclient, volume) + try: + virtual_machine.detach_volume(self.apiclient, volume) + except Exception as e: + print("Failed to detach volume from VM: %s" % e) + pass volume.delete(self.apiclient) self.cleanup.remove(volume) ts = str(time.time()) diff --git a/test/integration/smoke/test_kms_lifecycle.py b/test/integration/smoke/test_kms_lifecycle.py index 79deb5bdf0e2..783a2af72e54 100644 --- a/test/integration/smoke/test_kms_lifecycle.py +++ b/test/integration/smoke/test_kms_lifecycle.py @@ -65,6 +65,7 @@ def setUpClass(cls): cls.apiclient = cls.test_client.getApiClient() cls.zone = get_zone(cls.apiclient, cls.test_client.getZoneForTests()) cls.domain = get_domain(cls.apiclient) + cls.hypervisor = cls.test_client.getHypervisorInfo() cls._cleanup = [] @@ -424,6 +425,10 @@ def test_12_deploy_vm_with_root_disk_encryption(self): Test: deploy a VM with its root disk encrypted using a KMS key. Verify that the VM starts and the root volume has the KMS key ID. """ + + if self.hypervisor.lower() != 'kvm': + raise self.skipTest("Skipping test case for non-kvm hypervisor") + # 1. Create a KMS key for the user key = self._create_kms_key(name=_random_name("vm-root-key"), profile_id=self.default_profile.id, apiclient=self.user_apiclient) diff --git a/test/integration/smoke/test_network_extension_namespace.py b/test/integration/smoke/test_network_extension_namespace.py index 5452cd4ac9d0..f2484d73d8c1 100644 --- a/test/integration/smoke/test_network_extension_namespace.py +++ b/test/integration/smoke/test_network_extension_namespace.py @@ -859,6 +859,8 @@ def _check_kvm_host_prerequisites(self, tools=None): excluded from the check — the connectivity failure will surface naturally when the test later tries to deploy scripts. """ + if self.hv.lower() != 'kvm': + raise self.skipTest("Skipping test case for non-kvm hypervisor") if tools is None: tools = ['arping', 'dnsmasq', 'haproxy'] if not self.kvm_host_configs: @@ -2387,7 +2389,7 @@ def _mk_action(name, parameters = []): @attr(tags=["advanced", "smoke"], required_hardware="true") def test_09_vpc_source_nat_ip_update(self): """Update VPC source NAT IP and verify old/new source NAT flags flip correctly.""" - self._check_kvm_host_prerequisites(['arping']) + self._check_kvm_host_prerequisites(['ip', 'arping', 'dnsmasq', 'haproxy']) svc = VPC_NETWORK_SERVICES _nw_offering, ext_name = self._setup_extension_nsp_offering( diff --git a/test/integration/smoke/test_nonstrict_affinity_group.py b/test/integration/smoke/test_nonstrict_affinity_group.py index 1b9b0c02c709..3e9890daf6b7 100644 --- a/test/integration/smoke/test_nonstrict_affinity_group.py +++ b/test/integration/smoke/test_nonstrict_affinity_group.py @@ -20,6 +20,7 @@ """ import logging +import time from marvin.codes import FAILED from nose.plugins.attrib import attr @@ -38,7 +39,6 @@ from marvin.lib.common import (get_domain, get_zone, - get_template, get_test_template) @@ -209,6 +209,9 @@ def test_01_non_strict_host_anti_affinity(self): vm_2_host_id, msg="Both VMs of affinity group %s are on the same host" % self.affinity_group.name) + + time.sleep(10) + # 4. Migrate vm-2 to same host as vm-1 self.virtual_machine_2.migrate( self.apiclient, @@ -362,6 +365,8 @@ def test_02_non_strict_host_affinity(self): vm_12_host_id, msg="Both VMs of affinity group %s are on the different host" % self.affinity_group.name) + time.sleep(10) + # 4. Migrate vm-12 to different host as vm-11 self.virtual_machine_12.migrate( self.apiclient