VirtualBox

Changeset 83636 in vbox


Ignore:
Timestamp:
Apr 9, 2020 6:58:22 AM (4 years ago)
Author:
vboxsync
Message:

Guest Control/Validation Kit: Implemented enabling verbose logging for VBoxService on the guest.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/ValidationKit/tests/additions/tdAddGuestCtrl.py

    r83588 r83636  
    13421342    def __init__(self, sImgPath = None):
    13431343        self.sImgPath = sImgPath;
     1344        self.sVBoxServiceLogPath = '';
    13441345        self.fNoExit = False;
    13451346
     
    15611562
    15621563    #
     1564    # VBoxService handling.
     1565    #
     1566    def vboxServiceControl(self, oTxsSession, oTestVm, fStart):
     1567        """
     1568        Controls VBoxService on the guest by starting or stopping the service.
     1569        Returns success indicator.
     1570        """
     1571        if oTestVm.isWindows():
     1572            sPathSC = os.path.join(self.getGuestSystemDir(oTestVm), 'sc.exe');
     1573            if fStart:
     1574                return self.oTstDrv.txsRunTest(oTxsSession, 'Starting VBoxService with verbose logging', 30 * 1000,
     1575                                               sPathSC, (sPathSC, 'start', 'VBoxService'));
     1576            else:
     1577                return self.oTstDrv.txsRunTest(oTxsSession, 'Stopping VBoxService', 30 * 1000,
     1578                                               sPathSC, (sPathSC, 'stop', 'VBoxService'));
     1579        else:
     1580            reporter.log('Controlling VBoxService not supported for this guest yet');
     1581
     1582        return True;
     1583
     1584    #
    15631585    # Guest test files.
    15641586    #
     
    15771599            if oTxsSession.syncMkDirPath(sDir, 0o777) is not True:
    15781600                return reporter.error('Failed to create directory "%s"!' % (sDir,));
     1601
     1602        #
     1603        # Enable VBoxService verbose logging.
     1604        #
     1605        self.oDebug.sVBoxServiceLogPath = os.path.join(self.getGuestTempDir(oTestVm), "VBoxService");
     1606        if oTxsSession.syncMkDirPath(self.oDebug.sVBoxServiceLogPath, 0o777) is not True:
     1607                return reporter.error('Failed to create directory "%s"!' % (self.oDebug.sVBoxServiceLogPath,));
     1608        sPathLogFile = os.path.join(self.oDebug.sVBoxServiceLogPath, 'VBoxService.log');
     1609
     1610        reporter.log('VBoxService logs will be stored in "%s"' % (self.oDebug.sVBoxServiceLogPath,));
     1611
     1612        if oTestVm.isWindows():
     1613            sPathRegExe         = os.path.join(self.getGuestSystemDir(oTestVm), 'reg.exe');
     1614            sPathVBoxServiceExe = os.path.join(self.getGuestSystemDir(oTestVm), 'VBoxService.exe');
     1615            sImagePath          = '%s -vvvv --only-control --logfile %s' % (sPathVBoxServiceExe, sPathLogFile);
     1616            self.oTstDrv.txsRunTest(oTxsSession, 'Enabling VBoxService verbose logging (via registry)', 30 * 1000,
     1617                                         sPathRegExe,
     1618                                         (sPathRegExe, 'add',
     1619                                         '"HKLM\\SYSTEM\\CurrentControlSet\\Services\\VBoxService"',
     1620                                         '/v', 'ImagePath', '/t', 'REG_SZ', '/d', sImagePath, '/f'));
     1621
     1622            self.vboxServiceControl(oTxsSession, oTestVm, fStart = False);
     1623            time.sleep(5);
     1624            self.vboxServiceControl(oTxsSession, oTestVm, fStart = True);
     1625
     1626        else:
     1627            reporter.log('Verbose logging for VBoxService not supported for this guest yet');
    15791628
    15801629        #
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