From 6fd491b1ce510d5097778abbfc0fa76e3cb0a657 Mon Sep 17 00:00:00 2001 From: Priti Sarap Date: Thu, 13 Aug 2015 13:11:50 +0530 Subject: [PATCH] CLOUDSTACK-8693-Adding-missing-code-in-testpath_same_vm_name.py_testpatha --- .../testpaths/testpath_same_vm_name.py | 23 +++++++++++-------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/test/integration/testpaths/testpath_same_vm_name.py b/test/integration/testpaths/testpath_same_vm_name.py index ef464391ab0..da2c22da9f8 100644 --- a/test/integration/testpaths/testpath_same_vm_name.py +++ b/test/integration/testpaths/testpath_same_vm_name.py @@ -28,7 +28,7 @@ from marvin.lib.base import (Account, from marvin.lib.common import (get_domain, get_zone, get_template, - ) + ) from marvin.sshClient import SshClient import time @@ -45,6 +45,7 @@ class TestSameVMName(cloudstackTestCase): # Get Zone, Domain and templates cls.domain = get_domain(cls.apiclient) cls.zone = get_zone(cls.apiclient, testClient.getZoneForTests()) + cls.hypervisor = cls.testClient.getHypervisorInfo() cls.template = get_template( cls.apiclient, @@ -82,7 +83,7 @@ class TestSameVMName(cloudstackTestCase): UserName=cls.account_2.name, DomainName=cls.account_2.domain ) - # Create Service offering + # Create Service offering cls.service_offering = ServiceOffering.create( cls.apiclient, cls.testdata["service_offering"], @@ -103,11 +104,11 @@ class TestSameVMName(cloudstackTestCase): """Restart management server""" sshClient = SshClient( - cls.mgtSvrDetails["mgtSvrIp"], - 22, - cls.mgtSvrDetails["user"], - cls.mgtSvrDetails["passwd"] - ) + cls.mgtSvrDetails["mgtSvrIp"], + 22, + cls.mgtSvrDetails["user"], + cls.mgtSvrDetails["passwd"] + ) command = "service cloudstack-management restart" sshClient.execute(command) @@ -125,7 +126,9 @@ class TestSameVMName(cloudstackTestCase): self.dbclient = self.testClient.getDbConnection() self.cleanup = [] if self.skiptest: - self.skipTest("This test is to be checked on VMWare only Hence, skip for %s" % self.hypervisor) + self.skipTest( + "This test is to be checked on VMWare only \ + Hence, skip for %s" % self.hypervisor) def tearDown(self): try: @@ -160,8 +163,8 @@ class TestSameVMName(cloudstackTestCase): self.RestartServer() time.sleep(120) - self.testdata["small"]["displayname"]="TestName" - self.testdata["small"]["name"]="TestName" + self.testdata["small"]["displayname"] = "TestName" + self.testdata["small"]["name"] = "TestName" VirtualMachine.create( self.userapiclient_1, self.testdata["small"],