Changeset 107173 in vbox
- Timestamp:
- Nov 28, 2024 12:23:48 PM (7 weeks ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/ValidationKit/tests/additions/tdAddGuestCtrl.py
r106061 r107173 1730 1730 fEnableVerboseLogging = False; 1731 1731 1732 # On Windows and Linux guests we always can enable verbose logging. 1733 # NT4 and W2K doesn't have reg.exe nor (at least NT4) sc.exe. 1734 if (oTestVm.isWindows() and oTestVm.sKind not in ('WindowsNT4', 'Windows2000',)) \ 1735 or oTestVm.isLinux(): 1732 # On Windows and Linux guests we always can (try to) enable verbose logging. 1733 if (oTestVm.isWindows() or oTestVm.isLinux()): 1736 1734 fEnableVerboseLogging = True; 1737 1735 … … 1742 1740 fEnableVerboseLogging = False; 1743 1741 1742 self.oDebug.sGstVBoxServiceLogPath = oTestVm.pathJoin(self.oTstDrv.getGuestTempDir(oTestVm), "VBoxService"); 1743 sPathLogFile = oTestVm.pathJoin(self.oDebug.sGstVBoxServiceLogPath, 'VBoxService.log'); 1744 1745 if oTestVm.isWindows(): 1746 sImagePath = '%s -vvvv --logfile %s' % (self.sPathVBoxServiceExeGst, sPathLogFile); 1747 # For newer revisions we use VBoxGuestInstallHelper.exe. Should work on all Windows versions. 1748 if self.oTstDrv.fpApiVer >= 7.0 and self.oTstDrv.uRevision >= 166162: 1749 # Right now we ASSUME that the installation directory always is the following: 1750 sRegEditorExePath = 'C:\\Program Files\\Oracle\\VirtualBox Guest Additions\\VBoxGuestInstallHelper.exe'; 1751 asRegEditorArgs = [ sRegEditorExePath, 'registry', 'write', 'HKLM', 'SYSTEM\\CurrentControlSet\\Services\\VBoxService', 1752 'ImagePath', 'REG_SZ', '"' + sImagePath + '"' ]; 1753 # reg.exe is not able to write keys on older Windows versions (NT4, 2k). 1754 elif oTestVm.sKind not in ('WindowsNT4', 'Windows2000',): 1755 sRegEditorExePath = oTestVm.pathJoin(self.oTstDrv.getGuestSystemDir(oTestVm), 'reg.exe'); 1756 asRegEditorArgs = [ sRegEditorExePath, 'add', 'HKLM\\SYSTEM\\CurrentControlSet\\Services\\VBoxService', 1757 '/v', 'ImagePath', '/t', 'REG_SZ', '/d', sImagePath, '/f' ]; 1758 else: 1759 reporter.log('VBoxService logging is not available on this Windows guest'); 1760 fEnableVerboseLogging = False; 1761 1744 1762 # Some older Linux test VMs (like tst-rhel5) don't have a pre-configured 'vbox' user. 1745 1763 # So make sure that this user exists and has the appropriate password set. Ignore any errors. 1746 if oTestVm.isLinux():1764 elif oTestVm.isLinux(): 1747 1765 sCmdUserAdd = oTestVm.pathJoin(self.oTstDrv.getGuestSystemAdminDir(oTestVm, sPathPrefix = '/usr'), 'useradd'); 1748 1766 asArgs = [ sCmdUserAdd, '-m', 'vbox' ]; … … 1760 1778 reporter.log('Enabling verbose VBoxService logging: %s' % (fEnableVerboseLogging)); 1761 1779 if fEnableVerboseLogging: 1762 self.oDebug.sGstVBoxServiceLogPath = oTestVm.pathJoin(self.oTstDrv.getGuestTempDir(oTestVm), "VBoxService");1763 1780 if oTxsSession.syncMkDirPath(self.oDebug.sGstVBoxServiceLogPath, 0o777) is not True: 1764 1781 return reporter.error('Failed to create directory "%s"!' % (self.oDebug.sGstVBoxServiceLogPath,)); 1765 sPathLogFile = oTestVm.pathJoin(self.oDebug.sGstVBoxServiceLogPath, 'VBoxService.log');1766 1767 1782 reporter.log('VBoxService logs will be stored in "%s"' % (self.oDebug.sGstVBoxServiceLogPath,)); 1768 1783 1769 1784 fRestartVBoxService = False; 1770 if oTestVm.isWindows() and oTestVm.sKind not in ('WindowsNT4', 'Windows2000',): 1771 sPathRegExe = oTestVm.pathJoin(self.oTstDrv.getGuestSystemDir(oTestVm), 'reg.exe');1772 sImagePath = '%s -vvvv --logfile %s' % (self.sPathVBoxServiceExeGst, sPathLogFile);1785 1786 if oTestVm.isWindows(): 1787 asArgs = [ sRegEditorExePath ] + asRegEditorArgs; 1773 1788 fRestartVBoxService = self.oTstDrv.txsRunTest(oTxsSession, 'Enabling VBoxService verbose logging (via registry)', 1774 30 * 1000, 1775 sPathRegExe, 1776 (sPathRegExe, 'add', 1777 'HKLM\\SYSTEM\\CurrentControlSet\\Services\\VBoxService', 1778 '/v', 'ImagePath', '/t', 'REG_SZ', '/d', sImagePath, '/f')); 1789 30 * 1000, 1790 sRegEditorExePath, asRegEditorArgs); 1779 1791 elif oTestVm.isLinux(): 1780 1792 # Need to use some stupid trickery here to locate the sed binary,
Note:
See TracChangeset
for help on using the changeset viewer.