- Timestamp:
- Feb 26, 2019 12:25:43 PM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/ValidationKit/tests/additions/tdAddBasic1.py
r76553 r77469 30 30 __version__ = "$Revision$" 31 31 32 # pylint: disable=unnecessary-semicolon 32 33 33 34 # Standard Python imports. … … 63 64 vbox.TestDriver.__init__(self); 64 65 self.oTestVmSet = self.oTestVmManager.getSmokeVmSet('nat'); 65 self.asTestsDef = [' guestprops', 'stdguestprops', 'guestcontrol'];66 self.asTestsDef = ['install', 'guestprops', 'stdguestprops', 'guestcontrol']; 66 67 self.asTests = self.asTestsDef; 67 68 self.asRsrcs = None … … 133 134 fRc = False; 134 135 136 if oTestVm.isWindows(): 137 sFileCdWait = 'VBoxWindowsAdditions.exe'; 138 elif oTestVm.isLinux(): 139 sFileCdWait = 'VBoxLinuxAdditions.run'; 140 135 141 self.logVmInfo(oVM); 136 oSession, oTxsSession = self.startVmAndConnectToTxsViaTcp(oTestVm.sVmName, fCdWait = True, \ 137 sFileCdWait = 'AUTORUN.INF'); 142 oSession, oTxsSession = self.startVmAndConnectToTxsViaTcp(oTestVm.sVmName, fCdWait = True, sFileCdWait = sFileCdWait); 138 143 if oSession is not None: 139 144 self.addTask(oTxsSession); 140 145 # Do the testing. 146 fSkip = 'install' not in self.asTests; 141 147 reporter.testStart('Install'); 142 fRc, oTxsSession = self.testInstallAdditions(oSession, oTxsSession, oTestVm); 143 reporter.testDone(); 144 fSkip = not fRc; 145 148 if not fSkip: 149 fRc, oTxsSession = self.testInstallAdditions(oSession, oTxsSession, oTestVm); 150 reporter.testDone(fSkip); 151 152 fSkip = 'guestprops' not in self.asTests; 146 153 reporter.testStart('Guest Properties'); 147 154 if not fSkip: … … 149 156 reporter.testDone(fSkip); 150 157 158 fSkip = 'guestcontrol' not in self.asTests; 151 159 reporter.testStart('Guest Control'); 152 160 if not fSkip: 153 (fRc2, oTxsSession) = self.aoSubTstDrvs[0].testIt(oTestVm, oSession, oTxsSession); 154 fRc = fRc2 and fRc; 161 fRc, oTxsSession = self.aoSubTstDrvs[0].testIt(oTestVm, oSession, oTxsSession); 155 162 reporter.testDone(fSkip); 156 163 … … 172 179 if oTestVm.isWindows(): 173 180 (fRc, oTxsSession) = self.testWindowsInstallAdditions(oSession, oTxsSession, oTestVm); 181 elif oTestVm.isLinux(): 182 (fRc, oTxsSession) = self.testLinuxInstallAdditions(oSession, oTxsSession, oTestVm); 174 183 else: 175 184 reporter.error('Guest Additions installation not implemented for %s yet! (%s)' % \ … … 279 288 return (fRc, oTxsSession); 280 289 290 def testLinuxInstallAdditions(self, oSession, oTxsSession, oTestVm): 291 oSession = oSession; 292 oTestVm = oTestVm; 293 294 fRc = False; 295 296 # Install Kernel headers, which are required for actually installing the Linux Additions. 297 if oTestVm.sKind.startswith('Debian') \ 298 or oTestVm.sKind.startswith('Ubuntu'): 299 fRc = self.txsRunTest(oTxsSession, 'Installing Kernel headers', 5 * 60 *1000, 300 '/usr/bin/apt-get', ('/usr/bin/apt-get', 'install', '-y', 'linux-headers-generic')); 301 if not fRc: 302 reporter.error('Error installing Kernel headers'); 303 fRc = self.txsRunTest(oTxsSession, 'Installing Guest Additions depdendencies', 5 * 60 *1000, \ 304 '/usr/bin/apt-get', ('/usr/bin/apt-get', 'install', '-y', 'build-essential', 'perl')); 305 if not fRc: 306 reporter.error('Error installing additional installer dependencies'); 307 elif oTestVm.sKind.startswith('OL') \ 308 or oTestVm.sKind.startswith('Oracle') \ 309 or oTestVm.sKind.startswith('RHEL') \ 310 or oTestVm.sKind.startswith('Redhat') \ 311 or oTestVm.sKind.startswith('Cent'): 312 fRc = self.txsRunTest(oTxsSession, 'Installing Kernel headers', 5 * 60 *1000, 313 '/usr/bin/yum', ('/usr/bin/yum', '-y', 'install', 'kernel-headers')); 314 if not fRc: 315 reporter.error('Error installing Kernel headers'); 316 fRc = self.txsRunTest(oTxsSession, 'Installing Guest Additions depdendencies', 5 * 60 *1000, \ 317 '/usr/bin/yum', ('/usr/bin/yum', '-y', 'install', \ 318 'make', 'automake', 'gcc', 'kernel-devel', 'dkms', 'bzip2', 'perl')); 319 if not fRc: 320 reporter.error('Error installing additional installer dependencies'); 321 else: 322 reporter.error('Installing Linux Additions for kind "%s" is not supported yet' % oTestVm.sKind); 323 return (False, oTxsSession); 324 325 if fRc: 326 # 327 # The actual install. 328 # Also tell the installer to produce the appropriate log files. 329 # 330 fRc = self.txsRunTest(oTxsSession, 'VBoxLinuxAdditions.run', 5 * 60 * 1000, 331 '/bin/sh', ('/bin/sh', '${CDROM}/VBoxLinuxAdditions.run')); 332 if not fRc: 333 reporter.error('Installing Linux Additions failed (see log file for details)'); 334 335 # 336 # Download log files. 337 # Ignore errors as all files above might not be present for whatever reason. 338 # 339 asLogFile = []; 340 asLogFile.append('/var/log/vboxadd-install.log'); 341 self.txsDownloadFiles(oSession, oTxsSession, asLogFile, fIgnoreErrors = True); 342 343 if fRc: 344 (fRc, oTxsSession) = self.txsRebootAndReconnectViaTcp(oSession, oTxsSession, cMsTimeout = 3 * 60000); 345 346 return (fRc, oTxsSession); 347 281 348 def testIGuest_additionsVersion(self, oGuest): 282 349 """ … … 338 405 if __name__ == '__main__': 339 406 sys.exit(tdAddBasic1().main(sys.argv)); 340
Note:
See TracChangeset
for help on using the changeset viewer.