VirtualBox

Ignore:
Timestamp:
Apr 26, 2018 8:32:47 AM (7 years ago)
Author:
vboxsync
Message:

ValidationKit/tests/serial: Add verbose flag to avoid flooding the log with error messages by default

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/ValidationKit/tests/serial/tdSerial1.py

    r70796 r72029  
    6767        self.oLoopback        = None;
    6868        self.sLocation        = None;
     69        self.fVerboseTest     = False;
    6970
    7071    #
     
    7980        reporter.log('  --serial-tests    <t1[:t2[:]]');
    8081        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');
    8185        return rc;
    8286
     
    98102                if s not in self.asSerialTestsDef:
    99103                    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;
    100107        else:
    101108            return vbox.TestDriver.parseOption(self, asArgs, iArg);
     
    190197
    191198        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');
    193202        if oTestVm.isWindows():
    194             tupCmdLine += (r'\\.\COM1',);
     203            tupCmdLine += ('--device', r'\\.\COM1',);
    195204        elif oTestVm.isLinux():
    196             tupCmdLine += (r'/dev/ttyS0',);
     205            tupCmdLine += ('--device', r'/dev/ttyS0',);
    197206
    198207        fRc = self.txsRunTest(oTxsSession, 'SerialTest', 3600 * 1000, \
     
    218227                oFile.close();
    219228            except:
     229                reporter.logXcpt();
    220230                reporter.testFailure('Verifying the written data failed');
    221231        reporter.testDone();
     
    229239
    230240        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');
    232244        if oTestVm.isWindows():
    233             tupCmdLine += (r'\\.\COM1',);
     245            tupCmdLine += ('--device', r'\\.\COM1',);
    234246        elif oTestVm.isLinux():
    235             tupCmdLine += (r'/dev/ttyS0',);
     247            tupCmdLine += ('--device', r'/dev/ttyS0',);
    236248
    237249        fRc = self.txsRunTest(oTxsSession, 'SerialTest', 600 * 1000, \
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette