]> xenbits.xensource.com Git - xenrt-citrix/xenrt.git/commitdiff
Fixed postRun in cross release sxm tests
authorDan Lamping <daniel.lamping@citrix.com>
Mon, 16 Nov 2015 11:06:20 +0000 (11:06 +0000)
committerDan Lamping <daniel.lamping@citrix.com>
Mon, 16 Nov 2015 11:06:20 +0000 (11:06 +0000)
exec/testcases/xenserver/tc/upgrade.py

index af397d722961a2dbab8fe97cd7454b1f885b757e..d333074a1d6332f4e41649355eaefadbd37f98a0 100755 (executable)
@@ -4297,6 +4297,7 @@ class TCUpgradeVMMigrate(xenrt.TestCase):
 
     def prepare(self, arglist):
         self.__balloonTo = None
+        self.guest = None
 
         for arg in arglist:
             if arg.startswith("BalloonTo"):
@@ -4318,16 +4319,15 @@ class TCUpgradeVMMigrate(xenrt.TestCase):
 
         memory = self.__getMemorySize(memory)
 
-        g = oldHost.createBasicGuest(distro=distro, arch=arch, memory=memory)
+        self.guest = oldHost.createBasicGuest(distro=distro, arch=arch, memory=memory)
 
         if self.__balloonTo:
             xenrt.TEC().logverbose("Ballooning Memory to %s" % self.__balloonTo)
             balloonMemory = self.__getMemorySize(self.__balloonTo)
-            g.setDynamicMemRange(balloonMemory, balloonMemory)
+            self.guest.setDynamicMemRange(balloonMemory, balloonMemory)
 
-        g.migrateVM(remote_host=newHost, remote_user="root", remote_passwd=newHost.password)
-        g.verifyGuestFunctional()
-        g.uninstall()
+        self.guest.migrateVM(remote_host=newHost, remote_user="root", remote_passwd=newHost.password)
+        self.guest.verifyGuestFunctional()
 
     def __getMemorySize(self, memory):
         if memory[-1] == "M":
@@ -4337,6 +4337,9 @@ class TCUpgradeVMMigrate(xenrt.TestCase):
 
         return memory
 
+    def postRun(self):
+        self.guest.uninstall()
+
 class TCRollingPoolUpdate(xenrt.TestCase, xenrt.lib.xenserver.host.RollingPoolUpdate):
     """
     Base class for Rolling Pool update/upgrade