Skip to content

Commit

Permalink
CLOUDSTACK-8526: Use more memory for HyperV VMs in case SSH is tried …
Browse files Browse the repository at this point in the history
…to VM

Signed-off-by: Gaurav Aradhye <[email protected]>
This closes apache#322
  • Loading branch information
Gaurav Aradhye committed May 28, 2015
1 parent b616522 commit f2d056e
Showing 1 changed file with 37 additions and 36 deletions.
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

0 comments on commit f2d056e

Please sign in to comment.