Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
73 changes: 37 additions & 36 deletions test/integration/testpaths/testpath_vmlc.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@
setSharedNetworkParams,
get_free_vlan)
from marvin.codes import (PASS,
ERROR_NO_HOST_FOR_MIGRATION,
ISOLATED_NETWORK,
SHARED_NETWORK,
VPC_NETWORK)
Expand Down Expand Up @@ -194,20 +193,21 @@ def setUpClass(cls):
# Create 3 service offerings with different values for
# for cpunumber, cpuspeed, and memory

cls.testdata["service_offering"]["cpunumber"] = "1"
cls.testdata["service_offering"]["cpuspeed"] = "128"
cls.testdata["service_offering"]["memory"] = "256"
cls.testdata["service_offering"]["cpuspeed"] = 128
cls.testdata["service_offering"]["memory"] = 256

cls.testdata["service_offering"]["cpunumber"] = 1
if cls.hypervisor.lower() == "hyperv":
cls.testdata["service_offering"]["cpuspeed"] = 2048
cls.testdata["service_offering"]["memory"] = 2048

cls.service_offering_1 = ServiceOffering.create(
cls.apiclient,
cls.testdata["service_offering"]
)
cls._cleanup.append(cls.service_offering_1)

cls.testdata["service_offering"]["cpunumber"] = "2"
cls.testdata["service_offering"]["cpuspeed"] = "256"
cls.testdata["service_offering"]["memory"] = "512"

cls.testdata["service_offering"]["cpunumber"] = 2
cls.service_offering_2 = ServiceOffering.create(
cls.apiclient,
cls.testdata["service_offering"]
Expand Down Expand Up @@ -491,21 +491,22 @@ def test_01_positive_tests_vm_operations_advanced_zone(self, value):
except Exception as e:
self.fail("Exception while SSHing to VM: %s" % e)

# Find suitable host for VM to migrate and migrate the VM
# Verify that it is accessible on the new host
host = findSuitableHostForMigration(self.apiclient,
self.virtual_machine.id)
if host is None:
self.fail(ERROR_NO_HOST_FOR_MIGRATION)
self.virtual_machine.migrate(self.apiclient, host.id)

try:
SshClient(host=publicip.ipaddress.ipaddress,
port=22,
user=self.virtual_machine.username,
passwd=self.virtual_machine.password)
except Exception as e:
self.fail("Exception while SSHing to VM: %s" % e)
if not self.hypervisor.lower() == "lxc":
# Find suitable host for VM to migrate and migrate the VM
# Verify that it is accessible on the new host
host = findSuitableHostForMigration(self.apiclient,
self.virtual_machine.id)
if host is not None:
self.virtual_machine.migrate(self.apiclient, host.id)

try:
SshClient(host=publicip.ipaddress.ipaddress,
port=22,
user=self.virtual_machine.username,
passwd=self.virtual_machine.password)
except Exception as e:
self.fail("Exception while SSHing to VM: %s" % e)
return

@attr(tags=["advanced"], required_hardware="True")
Expand Down Expand Up @@ -705,21 +706,21 @@ def test_01_positive_tests_vm_operations_basic_zone(self):
except Exception as e:
self.fail("Exception while SSHing to VM: %s" % e)

# Find suitable host for VM to migrate and migrate the VM
# Verify that it is accessible on the new host
host = findSuitableHostForMigration(self.apiclient,
if not self.hypervisor.lower() == "lxc":
# Find suitable host for VM to migrate and migrate the VM
# Verify that it is accessible on the new host
host = findSuitableHostForMigration(self.apiclient,
self.virtual_machine.id)
if host is None:
self.fail(ERROR_NO_HOST_FOR_MIGRATION)
self.virtual_machine.migrate(self.apiclient, host.id)

try:
SshClient(host=self.virtual_machine.ssh_ip,
port=22,
user=self.virtual_machine.username,
passwd=self.virtual_machine.password)
except Exception as e:
self.fail("Exception while SSHing to VM: %s" % e)
if host is not None:
self.virtual_machine.migrate(self.apiclient, host.id)

try:
SshClient(host=self.virtual_machine.ssh_ip,
port=22,
user=self.virtual_machine.username,
passwd=self.virtual_machine.password)
except Exception as e:
self.fail("Exception while SSHing to VM: %s" % e)
return

@attr(tags=["advanced"], required_hardware="True")
Expand Down