Changeset 73623 in vbox for trunk/src/VBox/ValidationKit
- Timestamp:
- Aug 10, 2018 5:35:18 PM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/ValidationKit/tests/serial/tdSerial1.py
r72231 r73623 70 70 self.asSerialTestsDef = ['Write', 'ReadWrite']; 71 71 self.asSerialTests = self.asSerialTestsDef; 72 self.asUartsDef = ['16450', '16550A', '16750']; 73 self.asUarts = self.asUartsDef; 72 74 self.oLoopback = None; 73 75 self.sLocation = None; … … 85 87 reporter.log(' --serial-tests <t1[:t2[:]]'); 86 88 reporter.log(' Default: %s' % (':'.join(self.asSerialTestsDef))); 89 reporter.log(' --uarts <u1[:u2[:]]'); 90 reporter.log(' Default: %s' % (':'.join(self.asUartsDef))); 87 91 reporter.log(' --verbose-test'); 88 92 reporter.log(' Whether to enable verbose output when running the'); … … 107 111 if s not in self.asSerialTestsDef: 108 112 reporter.log('warning: The "--serial-tests" value "%s" is not a valid serial port test.' % (s)); 113 elif asArgs[iArg] == '--aurts': 114 iArg += 1; 115 if iArg >= len(asArgs): 116 raise base.InvalidOption('The "--uarts" takes a colon separated list of uarts to test'); 117 self.asUarts = asArgs[iArg].split(':'); 118 for s in self.asUarts: 119 if s not in self.asUartsDef: 120 reporter.log('warning: The "--uarts" value "%s" is not a valid uart.' % (s)); 109 121 elif asArgs[iArg] == '--verbose-test': 110 122 iArg += 1; … … 202 214 203 215 reporter.testStart('Write'); 204 tupCmdLine = ('SerialTest', '--tests', 'write', '--txbytes', '1048576' ,);216 tupCmdLine = ('SerialTest', '--tests', 'write', '--txbytes', '1048576'); 205 217 if self.fVerboseTest: 206 tupCmdLine += ('--verbose' );218 tupCmdLine += ('--verbose',); 207 219 if oTestVm.isWindows(): 208 220 tupCmdLine += ('--device', r'\\.\COM1',); … … 246 258 tupCmdLine = ('SerialTest', '--tests', 'readwrite', '--txbytes', '1048576'); 247 259 if self.fVerboseTest: 248 tupCmdLine += ('--verbose' );260 tupCmdLine += ('--verbose',); 249 261 if oTestVm.isWindows(): 250 262 tupCmdLine += ('--device', r'\\.\COM1',); … … 277 289 """ 278 290 279 # Reconfigure the VM 280 fRc = True; 281 oSession = self.openSession(oVM); 282 if oSession is not None: 283 fRc = oSession.enableSerialPort(0); 284 285 fRc = fRc and oSession.saveSettings(); 286 fRc = oSession.close() and fRc; 287 oSession = None; 288 else: 289 fRc = False; 290 291 if fRc is True: 292 self.logVmInfo(oVM); 293 oSession, oTxsSession = self.startVmAndConnectToTxsViaTcp(oTestVm.sVmName, fCdWait = True); 291 for sUart in self.asUarts: 292 reporter.testStart(sUart); 293 # Reconfigure the VM 294 fRc = True; 295 oSession = self.openSession(oVM); 294 296 if oSession is not None: 295 self.addTask(oTxsSession); 296 297 for sMode in self.asSerialModes: 298 reporter.testStart(sMode); 299 fRc = self.setupSerialMode(oSession, oTestVm, sMode); 300 if fRc: 301 for sTest in self.asSerialTests: 302 # Skip tests which don't work with the current mode. 303 if self.isModeCompatibleWithTest(sMode, sTest): 304 if sTest == 'Write': 305 fRc = self.testWrite(oSession, oTxsSession, oTestVm, sMode); 306 if sTest == 'ReadWrite': 307 fRc = self.testReadWrite(oSession, oTxsSession, oTestVm); 308 if self.oLoopback is not None: 309 self.oLoopback.shutdown(); 310 self.oLoopback = None; 311 312 reporter.testDone(); 313 314 self.removeTask(oTxsSession); 315 self.terminateVmBySession(oSession); 297 fRc = oSession.enableSerialPort(0); 298 299 fRc = fRc and oSession.setExtraData("VBoxInternal/Devices/serial/0/Config/UartType", "string:" + sUart); 300 fRc = fRc and oSession.saveSettings(); 301 fRc = oSession.close() and fRc; 302 oSession = None; 303 else: 304 fRc = False; 305 306 if fRc is True: 307 self.logVmInfo(oVM); 308 oSession, oTxsSession = self.startVmAndConnectToTxsViaTcp(oTestVm.sVmName, fCdWait = True); 309 if oSession is not None: 310 self.addTask(oTxsSession); 311 312 for sMode in self.asSerialModes: 313 reporter.testStart(sMode); 314 fRc = self.setupSerialMode(oSession, oTestVm, sMode); 315 if fRc: 316 for sTest in self.asSerialTests: 317 # Skip tests which don't work with the current mode. 318 if self.isModeCompatibleWithTest(sMode, sTest): 319 if sTest == 'Write': 320 fRc = self.testWrite(oSession, oTxsSession, oTestVm, sMode); 321 if sTest == 'ReadWrite': 322 fRc = self.testReadWrite(oSession, oTxsSession, oTestVm); 323 if self.oLoopback is not None: 324 self.oLoopback.shutdown(); 325 self.oLoopback = None; 326 327 reporter.testDone(); 328 329 self.removeTask(oTxsSession); 330 self.terminateVmBySession(oSession); 331 reporter.testDone(); 332 316 333 return fRc; 317 334
Note:
See TracChangeset
for help on using the changeset viewer.