VirtualBox

Changeset 71411 in vbox


Ignore:
Timestamp:
Mar 20, 2018 4:26:52 PM (7 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
121378
Message:

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

Location:
trunk/src/VBox/ValidationKit
Files:
2 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):
  • trunk/src/VBox/ValidationKit/tests/api/tdMoveVM1.py

    r71390 r71411  
    313313
    314314                # cleaning up: get rid of saved state
    315                 fRc = fRc and oSession.o.machine.discardSavedState(True)
     315                fRc = fRc and oSession.discardSavedState(True)
    316316                if fRc is False:
    317317                    reporter.log('Failed to discard the saved state of machine')
Note: See TracChangeset for help on using the changeset viewer.

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