- Timestamp:
- Jul 7, 2016 7:13:36 PM (9 years ago)
- Location:
- trunk/src/VBox/ValidationKit/tests/storage
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/ValidationKit/tests/storage/remoteexecutor.py
r62118 r62123 34 34 import os; 35 35 import shutil; 36 import StringIO 36 37 import subprocess; 37 38 … … 44 45 45 46 def __init__(self, sInput = None): 47 self.sInput = StringIO.StringIO(); 46 48 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)); 51 50 self.sOutput = ''; 52 51 … … 66 65 def read(self, cb): 67 66 """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); 75 68 76 69 def write(self, sText): -
trunk/src/VBox/ValidationKit/tests/storage/tdStorageBenchmark1.py
r62118 r62123 258 258 self.asIscsiTargets = self.asIscsiTargetsDef; 259 259 self.fTestHost = False; 260 self.fUseScratch = False; 260 261 self.oStorCfg = None; 261 262 … … 288 289 reporter.log(' Do all configured tests on the host first and report the results'); 289 290 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)'); 290 294 return rc; 291 295 … … 343 347 elif asArgs[iArg] == '--test-host': 344 348 self.fTestHost = True; 349 elif asArgs[iArg] == '--use-scratch': 350 self.fUseScratch = True; 345 351 else: 346 352 return vbox.TestDriver.parseOption(self, asArgs, iArg); … … 598 604 asPaths = self.asIscsiTargets; 599 605 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 ]; 604 608 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'); 608 619 609 620 for sPath in asPaths: … … 613 624 sPath = sPath; 614 625 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"; 618 627 619 628 for cCpus in self.acCpus: … … 660 669 if self.fTestHost: 661 670 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); 663 675 if sMountPoint is not None: 664 676 fRc = self.testBenchmarks(utils.getHostOs(), sMountPoint, oExecutor);
Note:
See TracChangeset
for help on using the changeset viewer.