VirtualBox

Ignore:
Timestamp:
Jul 6, 2016 9:42:47 AM (8 years ago)
Author:
vboxsync
Message:

ValidationKit/tests/storage: A bit more...

File:
1 edited

Legend:

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

    r62036 r62039  
    4545# Validation Kit imports.
    4646from common     import constants;
     47from common     import utils;
    4748from testdriver import reporter;
    4849from testdriver import base;
     
    378379    #
    379380
    380     def test1Benchmark(self, sBenchmark, oTxsSession = None):
     381    def test1Benchmark(self, sTargetOs, sBenchmark, oTxsSession = None):
    381382        """
    382383        Runs the given benchmark on the test host.
     
    384385        lstBinaryPaths = ['/bin', '/sbin', '/usr/bin', '/usr/sbin', \
    385386                          '/opt/csw/bin', '/usr/ccs/bin', '/usr/sfw/bin'];
    386 
    387387        oExecutor = remoteexecutor.RemoteExecutor(oTxsSession, lstBinaryPaths, self.sScratchPath);
    388         oTst = None;
    389         if sBenchmark == 'iozone':
    390             oTst = IozoneTest(oExecutor);
    391         elif sBenchmark == 'fio':
    392             oTst = FioTest(oExecutor); # pylint: disable=R0204
    393 
    394         if oTst is not None:
    395             reporter.testStart(sBenchmark);
    396 
    397             # Create a basic pool with the default configuration.
    398             oStorCfg = storagecfg.StorageCfg(oExecutor, socket.gethostname().lower());
    399             fRc, sPoolId = oStorCfg.createStoragePool(oExecutor);
     388
     389        # Create a basic pool with the default configuration.
     390        oStorCfg = storagecfg.StorageCfg(oExecutor, socket.gethostname().lower());
     391        fRc, sPoolId = oStorCfg.createStoragePool(oExecutor);
     392        if fRc:
     393            fRc, sMountpoint = oStorCfg.createVolume(sPoolId);
    400394            if fRc:
    401                 fRc, sMountpoint = oStorCfg.createVolume(sPoolId);
    402                 _ = sMountpoint;
    403                 if fRc:
    404                     oTst = IozoneTest(oExecutor);
     395
     396                # Create a basic config
     397                dCfg = {
     398                    'RecordSize':  '64k',
     399                    'TestsetSize': '20g',
     400                    'QueueDepth':  '32',
     401                    'FilePath': sMountpoint,
     402                    'TargetOs': sTargetOs
     403                };
     404
     405                oTst = None;
     406                if sBenchmark == 'iozone':
     407                    oTst = IozoneTest(oExecutor, dCfg);
     408                elif sBenchmark == 'fio':
     409                    oTst = FioTest(oExecutor, dCfg); # pylint: disable=R0204
     410
     411                if oTst is not None:
     412                    reporter.testStart(sBenchmark);
    405413                    fRc = oTst.prepare();
    406414                    if fRc:
     
    414422
    415423                    oTst.cleanup();
     424                    reporter.testDone();
    416425            else:
    417426                reporter.testFailure('Creating a storage pool on the target failed');
    418427
    419428            oStorCfg.cleanup();
    420             reporter.testDone();
    421 
    422         return fRc;
    423 
    424     def test1Benchmarks(self, oTxsSession = None):
     429
     430        return fRc;
     431
     432    def test1Benchmarks(self, sTargetOs, oTxsSession = None):
    425433        """
    426434        Runs all the configured benchmarks on the target.
     
    428436        reporter.testStart('Host');
    429437        for sTest in self.asTests:
    430             self.test1Benchmark(sTest, oTxsSession);
     438            self.test1Benchmark(sTargetOs, sTest, oTxsSession);
    431439        reporter.testDone();
    432440
     
    439447        fRc = True;
    440448        if self.fTestHost:
    441             fRc = self.test1Benchmarks()
     449            fRc = self.test1Benchmarks(utils.getHostOs());
    442450
    443451        # Loop thru the test VMs.
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