VirtualBox

Ignore:
Timestamp:
Mar 20, 2018 4:26:52 PM (7 years ago)
Author:
vboxsync
Message:

ValidationKit: bugref:8345 fix incorrect use of direct API call, replacing by helper for future use

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/ValidationKit/testdriver/vboxwrappers.py

    r71378 r71411  
    25192519            self.o.console.pause();
    25202520        if self.oVM.state is not vboxcon.MachineState_Paused:
    2521             vbox.reportError(oProgress, 'pause for "%s" failed' % (self.sName));
     2521            reporter.error('pause for "%s" failed' % (self.sName));
    25222522        # Try saving state.
    25232523        try:
     
    25252525                oProgress = self.o.machine.saveState()
    25262526            else:
    2527                 oProgress = self.o.console.saveState();
     2527                oProgress = self.o.console.saveState()
    25282528        except:
    25292529            reporter.logXcpt('IMachine::saveState failed on %s' % (self.sName));
     
    25392539        self.oTstDrv.waitOnDirectSessionClose(self.oVM, 5000);         # fudge
    25402540        return self.waitForTask(30 * 1000);                            # fudge
     2541
     2542    def discardSavedState(self, fRemove = True):
     2543        """
     2544        Discards saved state of the VM.
     2545
     2546        Returns True on success.
     2547        Returns False on IConsole::discardSaveState() failure.
     2548        """
     2549
     2550        try:
     2551            if self.fpApiVer >= 5.0:
     2552                self.o.machine.discardSavedState(fRemove)
     2553            else:
     2554                self.o.console.discardSavedState(fRemove)
     2555        except:
     2556            reporter.logXcpt('IMachine::discardSavedState failed on %s' % (self.sName))
     2557            return False
     2558        return True
    25412559
    25422560    def restoreSnapshot(self, oSnapshot, fFudgeOnFailure = True):
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette