VirtualBox

Ignore:
Timestamp:
Jun 17, 2020 12:08:21 PM (5 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
138681
Message:

Validation Kit/tdAddGuestCtrl.py: Added Linux support for VBoxService verbose logging and service control.

File:
1 edited

Legend:

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

    r84830 r84862  
    15621562                fRc = self.oTstDrv.txsRunTest(oTxsSession, 'Stopping VBoxService', 30 * 1000, \
    15631563                                              sPathSC, (sPathSC, 'stop', 'VBoxService'));
     1564        elif oTestVm.isLinux():
     1565            sPathService = "/usr/sbin/service";
     1566            if fStart is True:
     1567                fRc = self.oTstDrv.txsRunTest(oTxsSession, 'Starting VBoxService with verbose logging', 30 * 1000, \
     1568                                              sPathService, (sPathService, 'start', 'vboxadd-service'));
     1569            else:
     1570                fRc = self.oTstDrv.txsRunTest(oTxsSession, 'Stopping VBoxService', 30 * 1000, \
     1571                                              sPathService, (sPathService, 'stop', 'vboxadd-service'));
    15641572        else:
    15651573            reporter.log('Controlling VBoxService not supported for this guest yet');
     
    16461654        reporter.log('VBoxService logs will be stored in "%s"' % (self.oDebug.sGstVBoxServiceLogPath,));
    16471655
     1656        fRestartVBoxService = False;
    16481657        if oTestVm.isWindows():
    16491658            sPathRegExe         = oTestVm.pathJoin(self.oTstDrv.getGuestSystemDir(oTestVm), 'reg.exe');
    16501659            sPathVBoxServiceExe = oTestVm.pathJoin(self.oTstDrv.getGuestSystemDir(oTestVm), 'VBoxService.exe');
    16511660            sImagePath          = '%s -vvvv --logfile %s' % (sPathVBoxServiceExe, sPathLogFile);
    1652             self.oTstDrv.txsRunTest(oTxsSession, 'Enabling VBoxService verbose logging (via registry)', 30 * 1000,
    1653                                     sPathRegExe,
     1661            fRestartVBoxService = self.oTstDrv.txsRunTest(oTxsSession, 'Enabling VBoxService verbose logging (via registry)',
     1662                                     30 * 1000,
     1663                                     sPathRegExe,
    16541664                                    (sPathRegExe, 'add',
    16551665                                    'HKLM\\SYSTEM\\CurrentControlSet\\Services\\VBoxService',
    16561666                                    '/v', 'ImagePath', '/t', 'REG_SZ', '/d', sImagePath, '/f'));
    1657 
     1667        elif oTestVm.isLinux():
     1668            sPathSed = '/bin/sed';
     1669            fRestartVBoxService = self.oTstDrv.txsRunTest(oTxsSession, 'Enabling VBoxService verbose logging', 30 * 1000,
     1670                                     sPathSed,
     1671                                    (sPathSed, '-i', '-e',
     1672                                     's/\\$1 \\$2 \\$3/\\$1 \\$2 \\$3 -vvvv --logfile \\/tmp\\/VBoxService\\/VBoxService.log/g',
     1673                                     '/sbin/rcvboxadd-service'));
     1674        else:
     1675            reporter.log('Verbose logging for VBoxService not supported for this guest yet');
     1676
     1677        if fRestartVBoxService:
    16581678            self.vboxServiceControl(oTxsSession, oTestVm, fStart = False);
    16591679            time.sleep(5);
    16601680            self.vboxServiceControl(oTxsSession, oTestVm, fStart = True);
    1661 
    1662         else:
    1663             reporter.log('Verbose logging for VBoxService not supported for this guest yet');
    16641681
    16651682        #
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