Changeset 93038 in vbox
- Timestamp:
- Dec 21, 2021 11:08:23 AM (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/ValidationKit/tests/additions/tdAddGuestCtrl.py
r93037 r93038 1352 1352 Contains local test debug settings. 1353 1353 """ 1354 def __init__(self, s ImgPath= None):1355 self.s ImgPath = sImgPath;1354 def __init__(self, sVBoxServiceExeHst = None): 1355 self.sVBoxServiceExeHst = sVBoxServiceExeHst; 1356 1356 self.sGstVBoxServiceLogPath = ''; 1357 1357 self.fNoExit = False; … … 1375 1375 'update_additions' 1376 1376 ]; 1377 self.asTests = self.asTestsDef; 1378 self.fSkipKnownBugs = False; 1379 self.oTestFiles = None # type: vboxtestfileset.TestFileSet 1380 self.oDebug = tdDebugSettings(); 1377 self.asTests = self.asTestsDef; 1378 self.fSkipKnownBugs = False; 1379 self.oTestFiles = None # type: vboxtestfileset.TestFileSet 1380 self.oDebug = tdDebugSettings(); 1381 self.sPathVBoxServiceExeGst = ''; 1381 1382 1382 1383 def parseOption(self, asArgs, iArg): # pylint: disable=too-many-branches,too-many-statements … … 1402 1403 iArg += 1; 1403 1404 iNext = self.oTstDrv.requireMoreArgs(1, asArgs, iArg); 1404 self.oDebug.s ImgPath= asArgs[iArg];1405 self.oDebug.sVBoxServiceExeHst = asArgs[iArg]; 1405 1406 return iNext; 1406 1407 if asArgs[iArg] == '--add-guest-ctrl-debug-no-exit': … … 1428 1429 Returns fRc, oTxsSession. The latter may have changed. 1429 1430 """ 1431 1432 self.sPathVBoxServiceExeGst = oTestVm.pathJoin(self.oTstDrv.getGuestSystemAdminDir(oTestVm), 'VBoxService') \ 1433 + base.exeSuff(); 1434 1430 1435 reporter.log("Active tests: %s" % (self.asTests,)); 1431 1436 … … 1507 1512 """ 1508 1513 1509 if self.oDebug.s ImgPathis None: # If no debugging enabled, bail out.1514 if self.oDebug.sVBoxServiceExeHst is None: # If no debugging enabled, bail out. 1510 1515 reporter.log('Skipping debugging'); 1511 return True 1516 return True; 1512 1517 1513 1518 reporter.log('Preparing for debugging ...'); 1514 1519 1515 1520 try: 1516 1517 1521 self.vboxServiceControl(oTxsSession, oTestVm, fStart = False); 1518 1522 1523 self.oTstDrv.sleep(5); # Fudge factor -- wait until the service stopped. 1524 1525 reporter.log('Uploading "%s" to "%s" ...' % (self.oDebug.sVBoxServiceExeHst, self.sPathVBoxServiceExeGst)); 1526 oTxsSession.syncUploadFile(self.oDebug.sVBoxServiceExeHst, self.sPathVBoxServiceExeGst); 1527 1519 1528 if oTestVm.isLinux(): 1520 reporter.log('Uploading %s ...' % self.oDebug.sImgPath); 1521 sFileVBoxServiceHst = self.oDebug.sImgPath; 1522 sFileVBoxServiceGst = "/tmp/VBoxService-txs"; 1523 oTxsSession.syncUploadFile(sFileVBoxServiceHst, sFileVBoxServiceGst); 1524 oTxsSession.syncChMod(sFileVBoxServiceGst, 0o755); 1525 reporter.log('Executing VBoxService (in background)...'); 1526 oTxsSession.syncExec(sFileVBoxServiceGst, (sFileVBoxServiceGst, "-vvvv", "--only-control", \ 1527 "--control-dump-stdout", "--control-dump-stderr", \ 1528 "--logfile", "/tmp/VBoxService-txs.log") ); 1529 elif oTestVm.isWindows(): 1530 reporter.log('Uploading %s ...' % self.oDebug.sImgPath); 1531 sFileVBoxServiceHst = self.oDebug.sImgPath; 1532 sFileVBoxServiceGst = os.path.join(self.oTstDrv.getGuestSystemDir(oTestVm), 'VBoxService.exe'); 1533 oTxsSession.syncUploadFile(sFileVBoxServiceHst, sFileVBoxServiceGst); 1534 sPathSC = os.path.join(self.oTstDrv.getGuestSystemDir(oTestVm), 'sc.exe'); 1535 oTxsSession.syncExec(sPathSC, (sPathSC, "stop", "VBoxService") ); 1536 time.sleep(5); 1537 oTxsSession.syncExec(sPathSC, (sPathSC, "start", "VBoxService") ); 1538 1539 else: ## @todo Implement others. 1540 reporter.log('Debugging not available on this guest OS yet, skipping ...'); 1529 oTxsSession.syncChMod(self.sPathVBoxServiceExeGst, 0o755); 1541 1530 1542 1531 self.vboxServiceControl(oTxsSession, oTestVm, fStart = True); 1532 1533 self.oTstDrv.sleep(5); # Fudge factor -- wait until the service is ready. 1543 1534 1544 1535 except: … … 1648 1639 fEnableVerboseLogging = True; 1649 1640 1650 # If debugging mode is disabled, enable logging -- otherwise a manually set up logging could clash here.1651 if not self.oDebug.sImgPath:1652 fEnableVerboseLogging = True;1653 1654 1641 # Old TxS versions had a bug which caused an infinite loop when executing stuff containing "$xxx", 1655 1642 # so check if we got the version here first and skip enabling verbose logging nonetheless if needed. 1656 1643 if not fGotTxsVer: 1644 reporter.log('Too old TxS service running') 1657 1645 fEnableVerboseLogging = False; 1658 1646 … … 1660 1648 # Enable VBoxService verbose logging. 1661 1649 # 1650 reporter.log('Enabling verbose VBoxService logging: %s' % (fEnableVerboseLogging)); 1662 1651 if fEnableVerboseLogging: 1663 1652 self.oDebug.sGstVBoxServiceLogPath = oTestVm.pathJoin(self.oTstDrv.getGuestTempDir(oTestVm), "VBoxService"); … … 1671 1660 if oTestVm.isWindows(): 1672 1661 sPathRegExe = oTestVm.pathJoin(self.oTstDrv.getGuestSystemDir(oTestVm), 'reg.exe'); 1673 sPathVBoxServiceExe = oTestVm.pathJoin(self.oTstDrv.getGuestSystemDir(oTestVm), 'VBoxService.exe'); 1674 sImagePath = '%s -vvvv --logfile %s' % (sPathVBoxServiceExe, sPathLogFile); 1662 sImagePath = '%s -vvvv --logfile %s' % (self.sPathVBoxServiceExeGst, sPathLogFile); 1675 1663 fRestartVBoxService = self.oTstDrv.txsRunTest(oTxsSession, 'Enabling VBoxService verbose logging (via registry)', 1676 1664 30 * 1000, … … 1694 1682 if fRestartVBoxService: 1695 1683 self.vboxServiceControl(oTxsSession, oTestVm, fStart = False); 1696 time.sleep(5);1684 self.oTstDrv.sleep(5); 1697 1685 self.vboxServiceControl(oTxsSession, oTestVm, fStart = True); 1698 1686 else: … … 1703 1691 if not fRc: 1704 1692 return False; 1705 else:1706 reporter.log('Skipping VBoxService enabling verbose logging (too old TxS service running)')1707 1693 1708 1694 # … … 5228 5214 # Cleanup. 5229 5215 self.removeTask(oTxsSession); 5230 if not self.aoSubTstDrvs[0].oDebug.fNoExit: 5216 if self.aoSubTstDrvs[0].oDebug.fNoExit: 5217 self.sleep(60 * 60 * 1000); # Leave the VM session open for manual inspection / debugging. 5218 else: 5231 5219 self.terminateVmBySession(oSession); 5232 5220 else:
Note:
See TracChangeset
for help on using the changeset viewer.