VirtualBox

Changeset 65458 in vbox for trunk/src/VBox


Ignore:
Timestamp:
Jan 26, 2017 4:06:11 PM (8 years ago)
Author:
vboxsync
Message:

ValidationKit: Wrappers for IConsole::attachUSBDevice and IConsole::detachUSBDevice

File:
1 edited

Legend:

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

    r65199 r65458  
    24862486        return True
    24872487
     2488    def attachUsbDevice(self, sUuid, sCaptureFilename = None):
     2489        """
     2490        Attach given USB device UUID to the VM.
     2491
     2492        Returns True on success
     2493        Returns False on failure.
     2494        """
     2495        fRc = True;
     2496        try:
     2497            if sCaptureFilename is None:
     2498                self.o.console.attachUSBDevice(sUuid, '');
     2499            else:
     2500                self.o.console.attachUSBDevice(sUuid, sCaptureFilename);
     2501        except:
     2502            reporter.logXcpt('Unable to attach USB device %s' % (sUuid,));
     2503            fRc = False;
     2504
     2505        return fRc;
     2506
     2507    def detachUsbDevice(self, sUuid):
     2508        """
     2509        Detach given USB device UUID from the VM.
     2510
     2511        Returns True on success
     2512        Returns False on failure.
     2513        """
     2514        fRc = True;
     2515        try:
     2516            _ = self.o.console.detachUSBDevice(sUuid);
     2517        except:
     2518            reporter.logXcpt('Unable to detach USB device %s' % (sUuid,));
     2519            fRc = False;
     2520
     2521        return fRc;
     2522
     2523
    24882524    #
    24892525    # IMachineDebugger wrappers.
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