VirtualBox

Changeset 65731 in vbox for trunk/src/VBox/ValidationKit


Ignore:
Timestamp:
Feb 10, 2017 1:25:41 PM (8 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
113445
Message:

ValidationKit/tdStorageBenchmark1: Upload the raw benchmark output including stderr

Location:
trunk/src/VBox/ValidationKit/tests/storage
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/ValidationKit/tests/storage/remoteexecutor.py

    r64847 r65731  
    8989
    9090    def __init__(self, oTxsSession = None, asBinaryPaths = None, sScratchPath = None):
    91         self.oTxsSession = oTxsSession;
    92         self.asPaths = asBinaryPaths;
     91        self.oTxsSession  = oTxsSession;
     92        self.asPaths      = asBinaryPaths;
     93        self.sScratchPath = sScratchPath;
    9394        if self.asPaths is None:
    9495            self.asPaths = [ ];
    95         self.sScratchPath = sScratchPath
    9696
    9797    def _isFile(self, sFile):
     
    123123        reporter.log('Executing [sudo]: %s' % (asArgs, ));
    124124        reporter.flushall();
     125        fRc = False;
     126        sOutput = '';
     127        sError = '';
    125128        try:
    126129            oProcess = utils.sudoProcessPopen(asArgs, stdout=subprocess.PIPE, stdin=subprocess.PIPE,
    127                                               shell = False, close_fds = False);
    128 
    129             sOutput, _ = oProcess.communicate(sInput);
     130                                              stderr=subprocess.PIPE, shell = False, close_fds = False);
     131
     132            sOutput, sError = oProcess.communicate(sInput);
    130133            iExitCode  = oProcess.poll();
    131134
    132135            if iExitCode is not 0:
    133                 print(sOutput);
    134                 raise subprocess.CalledProcessError(iExitCode, asArgs);
     136                fRc = False;
    135137        except:
    136138            reporter.errorXcpt();
    137             return (False, None);
    138         reporter.log('Exit code [sudo]: %s (%s)' % (True, asArgs));
    139         return (True, str(sOutput));
     139            fRc = False;
     140        reporter.log('Exit code [sudo]: %s (%s)' % (fRc, asArgs));
     141        return (fRc, str(sOutput), str(sError));
    140142
    141143    def _execLocallyOrThroughTxs(self, sExec, asArgs, sInput, cMsTimeout):
     
    148150        if self.oTxsSession is not None:
    149151            oStdOut = StdInOutBuffer();
     152            oStdErr = StdInOutBuffer();
    150153            oStdIn = None;
    151154            if sInput is not None:
     
    155158            fRc = self.oTxsSession.syncExecEx(sExec, (sExec,) + asArgs,
    156159                                              oStdIn = oStdIn, oStdOut = oStdOut,
    157                                               cMsTimeout = cMsTimeout);
     160                                              oStdErr = oStdErr, cMsTimeout = cMsTimeout);
    158161            sOutput = oStdOut.getOutput();
    159         else:
    160             fRc, sOutput = self._sudoExecuteSync([sExec, ] + list(asArgs), sInput);
    161         return (fRc, sOutput);
     162            sError = oStdErr.getOutput();
     163        else:
     164            fRc, sOutput, sError = self._sudoExecuteSync([sExec, ] + list(asArgs), sInput);
     165        return (fRc, sOutput, sError);
    162166
    163167    def execBinary(self, sExec, asArgs, sInput = None, cMsTimeout = 3600000):
     
    171175        fRc = True;
    172176        sOutput = None;
     177        sError = None;
    173178        sBinary = self._getBinaryPath(sExec);
    174179        if sBinary is not None:
    175             fRc, sOutput = self._execLocallyOrThroughTxs(sBinary, asArgs, sInput, cMsTimeout);
     180            fRc, sOutput, sError = self._execLocallyOrThroughTxs(sBinary, asArgs, sInput, cMsTimeout);
    176181        else:
    177182            fRc = False;
    178         return (fRc, sOutput);
     183        return (fRc, sOutput, sError);
    179184
    180185    def execBinaryNoStdOut(self, sExec, asArgs, sInput = None):
     
    184189        returning whether the process exited successfully.
    185190        """
    186         fRc, _ = self.execBinary(sExec, asArgs, sInput);
     191        fRc, _, _ = self.execBinary(sExec, asArgs, sInput);
    187192        return fRc;
    188193
  • trunk/src/VBox/ValidationKit/tests/storage/storagecfg.py

    r64847 r65731  
    150150        fRc = True;
    151151        if sZPoolRaid is not None:
    152             fRc = oExec.execBinary('zpool', ('create', '-f', sPool, sZPoolRaid,) + tuple(asDisks));
     152            fRc = oExec.execBinaryNoStdOut('zpool', ('create', '-f', sPool, sZPoolRaid,) + tuple(asDisks));
    153153        else:
    154154            fRc = False;
     
    163163        fRc = True;
    164164        if cbVol is not None:
    165             fRc, _ = oExec.execBinary('zfs', ('create', '-o', 'mountpoint='+sMountPoint, '-V', cbVol, sPool + '/' + sVol));
    166         else:
    167             fRc, _ = oExec.execBinary('zfs', ('create', '-o', 'mountpoint='+sMountPoint, sPool + '/' + sVol));
     165            fRc = oExec.execBinaryNoStdOut('zfs', ('create', '-o', 'mountpoint='+sMountPoint, '-V', cbVol, sPool + '/' + sVol));
     166        else:
     167            fRc = oExec.execBinaryNoStdOut('zfs', ('create', '-o', 'mountpoint='+sMountPoint, sPool + '/' + sVol));
    168168
    169169        return fRc;
     
    173173        Destroys the given volume.
    174174        """
    175         fRc, _ = oExec.execBinary('zfs', ('destroy', sPool + '/' + sVol));
     175        fRc = oExec.execBinaryNoStdOut('zfs', ('destroy', sPool + '/' + sVol));
    176176        return fRc;
    177177
     
    180180        Destroys the given storage pool.
    181181        """
    182         fRc, _ = oExec.execBinary('zpool', ('destroy', sPool));
     182        fRc = oExec.execBinaryNoStdOut('zpool', ('destroy', sPool));
    183183        return fRc;
    184184
     
    289289            if cbVol is not None:
    290290                sFdiskScript = ',' + str(cbVol / 512) + '\n'; # Get number of sectors
    291             fRc, _ = oExec.execBinary('sfdisk', ('--no-reread', '--wipe', 'always', '-q', '-f', sDiskPath), sFdiskScript);
     291            fRc = oExec.execBinaryNoStdOut('sfdisk', ('--no-reread', '--wipe', 'always', '-q', '-f', sDiskPath), sFdiskScript);
    292292            if fRc:
    293293                if sDiskPath.find('nvme') is not -1:
     
    318318        # Unmount first
    319319        sMountPoint = self.dMounts[sPool + '/' + sVol];
    320         fRc, _ = oExec.execBinary('umount', (sMountPoint,));
     320        fRc = oExec.execBinaryNoStdOut('umount', (sMountPoint,));
    321321        self.dMounts.pop(sPool + '/' + sVol);
    322322        oExec.rmDir(sMountPoint);
  • trunk/src/VBox/ValidationKit/tests/storage/tdStorageBenchmark1.py

    r65722 r65731  
    8484        self.sCfgFileId = None;
    8585        self.dCfg       = dCfg;
     86        self.sError     = None;
     87        self.sResult    = None;
    8688
    8789    def prepare(self, cMsTimeout = 30000):
     
    127129        """ Runs the testcase """
    128130        _ = cMsTimeout
    129         fRc, sOutput = self.oExecutor.execBinary('fio', (self.sCfgFileId,), cMsTimeout = cMsTimeout);
    130         # @todo: Parse output.
    131         _ = sOutput;
     131        fRc, sOutput, sError = self.oExecutor.execBinary('fio', (self.sCfgFileId,), cMsTimeout = cMsTimeout);
     132        if fRc:
     133            self.sResult = sOutput;
     134        else:
     135            self.sError = ('Binary: fio\n' +
     136                           '\nOutput:\n\n' +
     137                           sOutput +
     138                           '\nError:\n\n' +
     139                           sError);
    132140        return fRc;
    133141
     
    140148        """
    141149        return True;
     150
     151    def getErrorReport(self):
     152        """
     153        Returns the error report in case the testcase failed.
     154        """
     155        return self.sError;
    142156
    143157class IozoneTest(object):
     
    148162        self.oExecutor = oExecutor;
    149163        self.sResult = None;
     164        self.sError = None;
    150165        self.lstTests = [ ('initial writers', 'FirstWrite'),
    151166                          ('rewriters',       'Rewrite'),
     
    182197        if self.fDirectIo:
    183198            tupArgs += ('-I',);
    184         fRc, sOutput = self.oExecutor.execBinary('iozone', tupArgs, cMsTimeout = cMsTimeout);
     199        fRc, sOutput, sError = self.oExecutor.execBinary('iozone', tupArgs, cMsTimeout = cMsTimeout);
    185200        if fRc:
    186201            self.sResult = sOutput;
     202        else:
     203            self.sError = ('Binary: iozone\n' +
     204                           '\nOutput:\n\n' +
     205                           sOutput +
     206                           '\nError:\n\n' +
     207                           sError);
    187208
    188209        _ = cMsTimeout;
     
    233254        return fRc;
    234255
     256    def getErrorReport(self):
     257        """
     258        Returns the error report in case the testcase failed.
     259        """
     260        return self.sError;
    235261
    236262class StorTestCfgMgr(object):
     
    894920                else:
    895921                    reporter.testFailure('Running the testcase failed');
     922                    reporter.addLogString(oTst.getErrorReport(), sBenchmark + '.log',
     923                                          'log/release/client', 'Benchmark raw output');
    896924            else:
    897925                reporter.testFailure('Preparing the testcase failed');
Note: See TracChangeset for help on using the changeset viewer.

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