Changeset 83636 in vbox
- Timestamp:
- Apr 9, 2020 6:58:22 AM (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/ValidationKit/tests/additions/tdAddGuestCtrl.py
r83588 r83636 1342 1342 def __init__(self, sImgPath = None): 1343 1343 self.sImgPath = sImgPath; 1344 self.sVBoxServiceLogPath = ''; 1344 1345 self.fNoExit = False; 1345 1346 … … 1561 1562 1562 1563 # 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 # 1563 1585 # Guest test files. 1564 1586 # … … 1577 1599 if oTxsSession.syncMkDirPath(sDir, 0o777) is not True: 1578 1600 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'); 1579 1628 1580 1629 #
Note:
See TracChangeset
for help on using the changeset viewer.

