VirtualBox

Changeset 62123 in vbox for trunk


Ignore:
Timestamp:
Jul 7, 2016 7:13:36 PM (9 years ago)
Author:
vboxsync
Message:

ValidationKit/tests/storage: Fixes

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

Legend:

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

    r62118 r62123  
    3434import os;
    3535import shutil;
     36import StringIO
    3637import subprocess;
    3738
     
    4445
    4546    def __init__(self, sInput = None):
     47        self.sInput = StringIO.StringIO();
    4648        if sInput is not None:
    47             self.sInput = self._toString(sInput);
    48         else:
    49             self.sInput = '';
    50         self.offInput = 0;
     49            self.sInput.write(self._toString(sInput));
    5150        self.sOutput  = '';
    5251
     
    6665    def read(self, cb):
    6766        """file.read"""
    68         cb = min(cb, len(self.sInput) - self.offInput);
    69         if cb > 0:
    70             sReturn = self.sInput[self.offInput:(self.offInput + cb)];
    71             self.offInput += cb;
    72         else:
    73             sReturn = '';
    74         return sReturn;
     67        return self.sInput.read(cb);
    7568
    7669    def write(self, sText):
  • trunk/src/VBox/ValidationKit/tests/storage/tdStorageBenchmark1.py

    r62118 r62123  
    258258        self.asIscsiTargets    = self.asIscsiTargetsDef;
    259259        self.fTestHost         = False;
     260        self.fUseScratch       = False;
    260261        self.oStorCfg          = None;
    261262
     
    288289        reporter.log('      Do all configured tests on the host first and report the results');
    289290        reporter.log('      to get a baseline');
     291        reporter.log('  --use-scratch');
     292        reporter.log('      Use the scratch directory for testing instead of setting up');
     293        reporter.log('      fresh volumes on dedicated disks (for development)');
    290294        return rc;
    291295
     
    343347        elif asArgs[iArg] == '--test-host':
    344348            self.fTestHost = True;
     349        elif asArgs[iArg] == '--use-scratch':
     350            self.fUseScratch = True;
    345351        else:
    346352            return vbox.TestDriver.parseOption(self, asArgs, iArg);
     
    598604                    asPaths = self.asIscsiTargets;
    599605                else:
    600                     # Create a new default storage config on the host
    601                     sMountPoint = self.prepareStorage(self.oStorCfg);
    602                     if sMountPoint is not None:
    603                         asPaths = [ sMountPoint ];
     606                    if self.fUseScratch:
     607                        asPaths = [ self. sScratchPath ];
    604608                    else:
    605                         asPaths = [];
    606                         fRc = False;
    607                         reporter.testFailure('Failed to prepare storage for VM');
     609                        # Create a new default storage config on the host
     610                        sMountPoint = self.prepareStorage(self.oStorCfg);
     611                        if sMountPoint is not None:
     612                            # Create a directory where every normal user can write to.
     613                            self.oStorCfg.mkDirOnVolume(sMountPoint, 'test', 0777);
     614                            asPaths = [ sMountPoint + '/test' ];
     615                        else:
     616                            asPaths = [];
     617                            fRc = False;
     618                            reporter.testFailure('Failed to prepare storage for VM');
    608619
    609620                for sPath in asPaths:
     
    613624                        sPath = sPath;
    614625                    else:
    615                          # Create a directory where every normal user can write to.
    616                         self.oStorCfg.mkDirOnVolume(sPath, 'test', 0777);
    617                         sPath = sPath + "/test/test.disk";
     626                        sPath = sPath + "/test.disk";
    618627
    619628                    for cCpus in self.acCpus:
     
    660669            if self.fTestHost:
    661670                reporter.testStart('Host');
    662                 sMountPoint = self.prepareStorage(self.oStorCfg);
     671                if self.fUseScratch:
     672                    sMountpoint = self.sScratchPath;
     673                else:
     674                    sMountPoint = self.prepareStorage(self.oStorCfg);
    663675                if sMountPoint is not None:
    664676                    fRc = self.testBenchmarks(utils.getHostOs(), sMountPoint, oExecutor);
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