Changeset 72029 in vbox
- Timestamp:
- Apr 26, 2018 8:32:47 AM (7 years ago)
- svn:sync-xref-src-repo-rev:
- 122325
- Location:
- trunk/src/VBox/ValidationKit
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/ValidationKit/tests/serial/tdSerial1.py
r70796 r72029 67 67 self.oLoopback = None; 68 68 self.sLocation = None; 69 self.fVerboseTest = False; 69 70 70 71 # … … 79 80 reporter.log(' --serial-tests <t1[:t2[:]]'); 80 81 reporter.log(' Default: %s' % (':'.join(self.asSerialTestsDef))); 82 reporter.log(' --verbose-test'); 83 reporter.log(' Whether to enable verbose output when running the'); 84 reporter.log(' test utility inside the VM'); 81 85 return rc; 82 86 … … 98 102 if s not in self.asSerialTestsDef: 99 103 reporter.log('warning: The "--serial-tests" value "%s" is not a valid serial port test.' % (s)); 104 elif asArgs[iArg] == '--verbose-test': 105 iArg += 1; 106 self.fVerboseTest = True; 100 107 else: 101 108 return vbox.TestDriver.parseOption(self, asArgs, iArg); … … 190 197 191 198 reporter.testStart('Write'); 192 tupCmdLine = ('SerialTest', '--tests', 'write', '--txbytes', '1048576', '--device'); 199 tupCmdLine = ('SerialTest', '--tests', 'write', '--txbytes', '1048576',); 200 if self.fVerboseTest: 201 tupCmdLine += ('--verbose'); 193 202 if oTestVm.isWindows(): 194 tupCmdLine += ( r'\\.\COM1',);203 tupCmdLine += ('--device', r'\\.\COM1',); 195 204 elif oTestVm.isLinux(): 196 tupCmdLine += ( r'/dev/ttyS0',);205 tupCmdLine += ('--device', r'/dev/ttyS0',); 197 206 198 207 fRc = self.txsRunTest(oTxsSession, 'SerialTest', 3600 * 1000, \ … … 218 227 oFile.close(); 219 228 except: 229 reporter.logXcpt(); 220 230 reporter.testFailure('Verifying the written data failed'); 221 231 reporter.testDone(); … … 229 239 230 240 reporter.testStart('ReadWrite'); 231 tupCmdLine = ('SerialTest', '--tests', 'readwrite', '--txbytes', '1048576', '--device'); 241 tupCmdLine = ('SerialTest', '--tests', 'readwrite', '--txbytes', '1048576'); 242 if self.fVerboseTest: 243 tupCmdLine += ('--verbose'); 232 244 if oTestVm.isWindows(): 233 tupCmdLine += ( r'\\.\COM1',);245 tupCmdLine += ('--device', r'\\.\COM1',); 234 246 elif oTestVm.isLinux(): 235 tupCmdLine += ( r'/dev/ttyS0',);247 tupCmdLine += ('--device', r'/dev/ttyS0',); 236 248 237 249 fRc = self.txsRunTest(oTxsSession, 'SerialTest', 600 * 1000, \ -
trunk/src/VBox/ValidationKit/utils/serial/SerialTest.cpp
r71957 r72029 157 157 {"--tests", 't', RTGETOPT_REQ_STRING }, 158 158 {"--txbytes", 'x', RTGETOPT_REQ_UINT32 }, 159 {"--verbose", 'v', RTGETOPT_REQ_NOTHING}, 159 160 {"--help", 'h', RTGETOPT_REQ_NOTHING} 160 161 }; … … 173 174 }; 174 175 176 /** Verbosity value. */ 177 static unsigned g_cVerbosity = 0; 175 178 /** The test handle. */ 176 179 static RTTEST g_hTest = NIL_RTTEST; … … 330 333 { 331 334 uint32_t offRx = 0; 335 bool fFailed = false; 332 336 333 337 while (offRx + sizeof(uint32_t) < pSerBuf->offBuf) … … 337 341 338 342 if (RT_UNLIKELY(u32Val != ++pSerBuf->iCnt)) 339 RTTestFailed(hTest, "Data corruption/loss detected, expected counter value %u got %u\n", 340 pSerBuf->iCnt, u32Val); 341 } 343 { 344 fFailed = true; 345 if (g_cVerbosity > 0) 346 RTTestFailed(hTest, "Data corruption/loss detected, expected counter value %u got %u\n", 347 pSerBuf->iCnt, u32Val); 348 } 349 } 350 351 if (fFailed) 352 RTTestFailed(hTest, "Data corruption/loss detected\n"); 342 353 343 354 if (RT_UNLIKELY(pSerBuf->iCnt > iCntTx)) … … 757 768 serialTestUsage(g_pStdOut); 758 769 return RTEXITCODE_SUCCESS; 770 case 'v': 771 g_cVerbosity++; 772 break; 759 773 case 'd': 760 774 pszDevice = ValueUnion.psz;
Note:
See TracChangeset
for help on using the changeset viewer.