Commits

theoden committed fbacb26

Fix for win platform due to bug when
VBoxManage unable to execute 'snapshot {{VM_name}} showvminfo {{snapshot_name}}'
command while previous VM lauch is still shutdowning. Intersection of tearDown
and setUp steps of the VirtualBoxTest class led to such a behaviour.

Bug was met with Windows 7 32-bit, Python 2.7.2, VBox 4.1.12

  • Participants
  • Parent commits 06e191f

Comments (0)

Files changed (1)

 import unittest
+import time
+import platform
 
 from fabric.api import env
 from fabric import state
             self.box.snapshot('delete', name)
 
     def activate_snapshot(self, name):
+        if platform.system()=='Windows':
+            RETRIES_CNT = 5
+            for i in xrange(RETRIES_CNT):
+                if self.box.snapshot_exists(name):
+           	        break
+                else:
+                    time.sleep(1)
         assert self.box.snapshot_exists(name), 'Snapshot "%s" does not exist' % name
         self.box.stop()
         self.box.snapshot('restore', name)