- Timestamp:
- Jul 7, 2016 4:16:44 PM (8 years ago)
- Location:
- trunk/src/VBox/ValidationKit/tests/storage
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/ValidationKit/tests/storage/remoteexecutor.py
r62037 r62118 34 34 import os; 35 35 import shutil; 36 import subprocess; 36 37 37 38 # Validation Kit imports. … … 41 42 class StdInOutBuffer(object): 42 43 """ Standard input output buffer """ 44 43 45 def __init__(self, sInput = None): 44 46 if sInput is not None: … … 65 67 """file.read""" 66 68 cb = min(cb, len(self.sInput) - self.offInput); 67 sReturn = self.sInput[self.offInput:(self.offInput + cb)]; 68 self.offInput += cb; 69 if cb > 0: 70 sReturn = self.sInput[self.offInput:(self.offInput + cb)]; 71 self.offInput += cb; 72 else: 73 sReturn = ''; 69 74 return sReturn; 70 75 … … 80 85 return self.sOutput; 81 86 87 def close(self): 88 """ file.close """ 89 return; 82 90 83 91 class RemoteExecutor(object): … … 122 130 reporter.flushall(); 123 131 try: 124 oStdIn = None; 125 if sInput is not None: 126 oStdIn = StdInOutBuffer(sInput); 127 sOutput = utils.sudoProcessOutputChecked(asArgs, stdin= oStdIn, shell = False, close_fds = False); 132 oProcess = utils.sudoProcessPopen(asArgs, stdout=subprocess.PIPE, stdin=subprocess.PIPE, 133 shell = False, close_fds = False); 134 135 sOutput, _ = oProcess.communicate(sInput); 136 iExitCode = oProcess.poll(); 137 138 if iExitCode is not 0: 139 print(sOutput); 140 raise subprocess.CalledProcessError(iExitCode, asArgs); 128 141 except: 129 142 reporter.errorXcpt(); 130 143 return (False, None); 131 144 reporter.log('Exit code [sudo]: %s (%s)' % (True, asArgs)); 132 return (True, s Output);145 return (True, str(sOutput)); 133 146 134 147 def _execLocallyOrThroughTxs(self, sExec, asArgs, sInput): … … 168 181 return (fRc, sOutput); 169 182 183 def execBinaryNoStdOut(self, sExec, asArgs, sInput = None): 184 """ 185 Executes the given binary with the given arguments 186 providing some optional input through stdin and 187 returning whether the process exited successfully. 188 """ 189 fRc, _ = self.execBinary(sExec, asArgs, sInput); 190 return fRc; 191 170 192 def copyFile(self, sLocalFile, sFilename, cMsTimeout = 30000): 171 193 """ … … 216 238 217 239 return sFileId; 240 241 def mkDir(self, sDir, fMode = 0700, cMsTimeout = 30000): 242 """ 243 Creates a new directory at the given location. 244 """ 245 fRc = True; 246 if self.oTxsSession is not None: 247 fRc = self.oTxsSession.syncMkDir(sDir, fMode, cMsTimeout); 248 else: 249 fRc = self.execBinaryNoStdOut('mkdir', ('-m', format(fMode, 'o'), sDir)); 250 251 return fRc; 252 253 def rmDir(self, sDir, cMsTimeout = 30000): 254 """ 255 Removes the given directory. 256 """ 257 fRc = True; 258 if self.oTxsSession is not None: 259 fRc = self.oTxsSession.syncRmDir(sDir, cMsTimeout); 260 else: 261 fRc = self.execBinaryNoStdOut('rmdir', (sDir,)); 262 263 return fRc; 264 -
trunk/src/VBox/ValidationKit/tests/storage/storagecfg.py
r62053 r62118 157 157 def __init__(self): 158 158 StorageConfigOs.__init__(self); 159 self.dSimplePools = { }; # Simple storage pools which don't use lvm (just one partition) 160 self.dMounts = { }; # Pool/Volume to mountpoint mapping. 161 162 def _getDmRaidLevelFromLvl(self, sRaidLvl): 163 """ 164 Converts our raid level indicators to something mdadm can understand. 165 """ 166 if sRaidLvl == 'raid5': 167 return '5'; 168 elif sRaidLvl == 'raid1': 169 return 'mirror'; 170 elif sRaidLvl == 'raid0' or sRaidLvl is None: 171 return 'stripe'; 172 173 return 'stripe'; 159 174 160 175 def getDisksMatchingRegExp(self, sRegExp): … … 175 190 """ 176 191 fRc = True; 177 _ = oExec; 178 _ = sPool; 179 _ = asDisks; 180 _ = sRaidLvl; 192 if len(asDisks) == 1 and sRaidLvl is None: 193 # Doesn't require LVM, put into the simple pools dictionary so we can 194 # use it when creating a volume later. 195 self.dSimplePools[sPool] = asDisks[0]; 196 else: 197 # If a RAID is required use dm-raid first to create one. 198 asLvmPvDisks = asDisks; 199 fRc = oExec.execBinaryNoStdOut('mdadm', ('--create', '/dev/md0', '--assume-clean', 200 '--level=' + self._getDmRaidLevelFromLvl(sRaidLvl), 201 '--raid-devices=' + str(len(asDisks))) + tuple(asDisks)); 202 if fRc: 203 # /dev/md0 is the only block device to use for our volume group. 204 asLvmPvDisks = [ '/dev/md0' ]; 205 206 # Create a physical volume on every disk first. 207 for sLvmPvDisk in asLvmPvDisks: 208 fRc = oExec.execBinaryNoStdOut('pvcreate', (sLvmPvDisk, )); 209 if not fRc: 210 break; 211 212 if fRc: 213 # Create volume group with all physical volumes included 214 fRc = oExec.execBinaryNoStdOut('vgcreate', (sPool, ) + tuple(asLvmPvDisks)); 181 215 return fRc; 182 216 … … 187 221 """ 188 222 fRc = True; 189 _ = oExec; 190 _ = sPool; 191 _ = sVol; 192 _ = sMountPoint; 193 _ = cbVol; 223 sBlkDev = None; 224 if self.dSimplePools.has_key(sPool): 225 sDiskPath = self.dSimplePools.get(sPool); 226 # Create a partition with the requested size 227 sFdiskScript = ';\n'; # Single partition filling everything 228 if cbVol is not None: 229 sFdiskScript = ',' + str(cbVol / 512) + '\n'; # Get number of sectors 230 fRc, _ = oExec.execBinary('sfdisk', ('--no-reread', '--wipe', 'always', '-q', '-f', sDiskPath), sFdiskScript); 231 if fRc: 232 sBlkDev = sDiskPath + '1'; 233 else: 234 if cbVol is None: 235 fRc = oExec.execBinaryNoStdOut('lvcreate', ('-l', '100%FREE', '-n', sVol, sPool)); 236 else: 237 fRc = oExec.execBinaryNoStdOut('lvcreate', ('-L', str(cbVol), '-n', sVol, sPool)); 238 if fRc: 239 sBlkDev = '/dev/mapper' + sPool + '-' + sVol; 240 241 if fRc is True and sBlkDev is not None: 242 # Create a filesystem and mount it 243 fRc = oExec.execBinaryNoStdOut('mkfs.ext4', ('-F', '-F', sBlkDev,)); 244 fRc = fRc and oExec.mkDir(sMountPoint); 245 fRc = fRc and oExec.execBinaryNoStdOut('mount', (sBlkDev, sMountPoint)); 246 if fRc: 247 self.dMounts[sPool + '/' + sVol] = sMountPoint; 194 248 return fRc; 195 249 … … 198 252 Destroys the given volume. 199 253 """ 200 fRc, _ = oExec.execBinary('lvremove', (sPool + '/' + sVol,)); 254 # Unmount first 255 sMountPoint = self.dMounts[sPool + '/' + sVol]; 256 fRc, _ = oExec.execBinary('umount', (sMountPoint,)); 257 self.dMounts.pop(sPool + '/' + sVol); 258 oExec.rmDir(sMountPoint); 259 if self.dSimplePools.has_key(sPool): 260 # Wipe partition table 261 sDiskPath = self.dSimplePools.get(sPool); 262 fRc = oExec.execBinaryNoStdOut('sfdisk', ('--no-reread', '--wipe', 'always', '-q', '-f', sDiskPath)); 263 else: 264 fRc = oExec.execBinaryNoStdOut('lvremove', (sPool + '/' + sVol,)); 201 265 return fRc; 202 266 … … 205 269 Destroys the given storage pool. 206 270 """ 207 fRc, _ = oExec.execBinary('vgremove', (sPool,)); 271 fRc = True; 272 if self.dSimplePools.has_key(sPool): 273 self.dSimplePools.pop(sPool); 274 else: 275 fRc = oExec.execBinaryNoStdOut('vgremove', (sPool,)); 208 276 return fRc; 209 277 … … 213 281 """ 214 282 215 kdStorageCfgs = { 216 'testboxstor1.de.oracle.com': ('solaris', r'c[3-9]t\dd0\Z') 217 }; 218 219 def __init__(self, oExec, sHostname = None): 283 def __init__(self, oExec, sTargetOs, oDiskCfg): 220 284 self.oExec = oExec; 221 285 self.lstDisks = [ ]; # List of disks present in the system. … … 225 289 self.iVolId = 0; 226 290 227 sOs, oDiskCfg = self.kdStorageCfgs.get(sHostname);228 229 291 fRc = True; 230 292 oStorOs = None; 231 if s Os == 'solaris':293 if sTargetOs == 'solaris': 232 294 oStorOs = StorageConfigOsSolaris(); 233 elif s Os == 'linux':295 elif sTargetOs == 'linux': 234 296 oStorOs = StorageConfigOsLinux(); # pylint: disable=R0204 235 297 else: … … 388 450 return fRc; 389 451 452 def mkDirOnVolume(self, sMountPoint, sDir, fMode = 0700): 453 """ 454 Creates a new directory on the volume pointed to by the given mount point. 455 """ 456 return self.oExec.mkDir(sMountPoint + '/' + sDir, fMode); 457 -
trunk/src/VBox/ValidationKit/tests/storage/tdStorageBenchmark1.py
r62052 r62118 230 230 """ 231 231 232 # Global storage configs for the testbox 233 kdStorageCfgs = { 234 'testboxstor1.de.oracle.com': r'c[3-9]t\dd0\Z', 235 'adaris': [ '/dev/sda' ] 236 }; 237 232 238 def __init__(self): 233 239 vbox.TestDriver.__init__(self); … … 236 242 self.oGuestToGuestSess = None; 237 243 self.oGuestToGuestTxs = None; 238 self.asTestVMsDef = ['tst- debian'];244 self.asTestVMsDef = ['tst-storage']; 239 245 self.asTestVMs = self.asTestVMsDef; 240 246 self.asSkipVMs = []; … … 249 255 self.asTestsDef = ['iozone', 'fio']; 250 256 self.asTests = self.asTestsDef; 251 self.asIscsiTargetsDef = [ 'aurora|iqn.2011-03.home.aurora:aurora.storagebench|1'];257 self.asIscsiTargetsDef = [ ]; # @todo: Configure one target for basic iSCSI testing 252 258 self.asIscsiTargets = self.asIscsiTargetsDef; 253 259 self.fTestHost = False; 260 self.oStorCfg = None; 254 261 255 262 # … … 352 359 if self.asRsrcs is None: 353 360 self.asRsrcs = []; 354 if 'tst- debian' in self.asTestVMs:355 self.asRsrcs.append(' 4.2/storage/debian.vdi');361 if 'tst-storage' in self.asTestVMs: 362 self.asRsrcs.append('5.1/storage/tst-storage.vdi'); 356 363 357 364 return self.asRsrcs; … … 368 375 369 376 # Linux VMs 370 if 'tst- debian' in self.asTestVMs:371 oVM = self.createTestVM('tst- debian', 1, '4.2/storage/debian.vdi', sKind = 'Debian_64', fIoApic = True, \377 if 'tst-storage' in self.asTestVMs: 378 oVM = self.createTestVM('tst-storage', 1, '5.1/storage/tst-storage.vdi', sKind = 'ArchLinux_64', fIoApic = True, \ 372 379 eNic0AttachType = vboxcon.NetworkAttachmentType_NAT, \ 373 380 eNic0Type = vboxcon.NetworkAdapterType_Am79C973); … … 389 396 # 390 397 391 def test1Benchmark(self, sTargetOs, sBenchmark, oTxsSession = None): 392 """ 393 Runs the given benchmark on the test host. 394 """ 395 lstBinaryPaths = ['/bin', '/sbin', '/usr/bin', '/usr/sbin', \ 396 '/opt/csw/bin', '/usr/ccs/bin', '/usr/sfw/bin']; 397 oExecutor = remoteexecutor.RemoteExecutor(oTxsSession, lstBinaryPaths, self.sScratchPath); 398 398 def prepareStorage(self, oStorCfg): 399 """ 400 Prepares the host storage for disk images or direct testing on the host. 401 """ 399 402 # Create a basic pool with the default configuration. 400 oStorCfg = storagecfg.StorageCfg(oExecutor, socket.gethostname().lower());403 sMountPoint = None; 401 404 fRc, sPoolId = oStorCfg.createStoragePool(); 402 405 if fRc: 403 fRc, sMountpoint = oStorCfg.createVolume(sPoolId); 406 fRc, sMountPoint = oStorCfg.createVolume(sPoolId); 407 if not fRc: 408 sMountPoint = None; 409 oStorCfg.cleanup(); 410 411 return sMountPoint; 412 413 def cleanupStorage(self, oStorCfg): 414 """ 415 Cleans up any created storage space for a test. 416 """ 417 return oStorCfg.cleanup(); 418 419 def testBenchmark(self, sTargetOs, sBenchmark, sMountpoint, oExecutor): 420 """ 421 Runs the given benchmark on the test host. 422 """ 423 # Create a basic config 424 dCfg = { 425 'RecordSize': '64k', 426 'TestsetSize': '100m', 427 'QueueDepth': '32', 428 'FilePath': sMountpoint, 429 'TargetOs': sTargetOs 430 }; 431 432 oTst = None; 433 if sBenchmark == 'iozone': 434 oTst = IozoneTest(oExecutor, dCfg); 435 elif sBenchmark == 'fio': 436 oTst = FioTest(oExecutor, dCfg); # pylint: disable=R0204 437 438 if oTst is not None: 439 reporter.testStart(sBenchmark); 440 fRc = oTst.prepare(); 404 441 if fRc: 405 # Create a basic config 406 dCfg = { 407 'RecordSize': '64k', 408 'TestsetSize': '20g', 409 'QueueDepth': '32', 410 'FilePath': sMountpoint, 411 'TargetOs': sTargetOs 412 }; 413 414 oTst = None; 415 if sBenchmark == 'iozone': 416 oTst = IozoneTest(oExecutor, dCfg); 417 elif sBenchmark == 'fio': 418 oTst = FioTest(oExecutor, dCfg); # pylint: disable=R0204 419 420 if oTst is not None: 421 reporter.testStart(sBenchmark); 422 fRc = oTst.prepare(); 423 if fRc: 424 fRc = oTst.run(); 425 if fRc: 426 fRc = oTst.reportResult(); 442 fRc = oTst.run(); 443 if fRc: 444 fRc = oTst.reportResult(); 445 else: 446 reporter.testFailure('Running the testcase failed'); 447 else: 448 reporter.testFailure('Preparing the testcase failed'); 449 450 oTst.cleanup(); 451 reporter.testDone(); 452 453 return fRc; 454 455 def testBenchmarks(self, sTargetOs, sMountPoint, oExecutor): 456 """ 457 Runs all the configured benchmarks on the target. 458 """ 459 for sTest in self.asTests: 460 self.testBenchmark(sTargetOs, sTest, sMountPoint, oExecutor); 461 462 def test1OneCfg(self, sVmName, eStorageController, sDiskFormat, sDiskPath, cCpus, fHwVirt, fNestedPaging): 463 """ 464 Runs the specified VM thru test #1. 465 466 Returns a success indicator on the general test execution. This is not 467 the actual test result. 468 """ 469 oVM = self.getVmByName(sVmName); 470 471 # Reconfigure the VM 472 fRc = True; 473 oSession = self.openSession(oVM); 474 if oSession is not None: 475 # Attach HD 476 fRc = oSession.ensureControllerAttached(_ControllerTypeToName(eStorageController)); 477 fRc = fRc and oSession.setStorageControllerType(eStorageController, _ControllerTypeToName(eStorageController)); 478 479 if sDiskFormat == "iSCSI": 480 listNames = []; 481 listValues = []; 482 listValues = sDiskPath.split('|'); 483 listNames.append('TargetAddress'); 484 listNames.append('TargetName'); 485 listNames.append('LUN'); 486 487 if self.fpApiVer >= 5.0: 488 oHd = oSession.oVBox.createMedium(sDiskFormat, sDiskPath, vboxcon.AccessMode_ReadWrite, \ 489 vboxcon.DeviceType_HardDisk); 490 else: 491 oHd = oSession.oVBox.createHardDisk(sDiskFormat, sDiskPath); 492 oHd.type = vboxcon.MediumType_Normal; 493 oHd.setProperties(listNames, listValues); 494 495 # Attach it. 496 if fRc is True: 497 try: 498 if oSession.fpApiVer >= 4.0: 499 oSession.o.machine.attachDevice(_ControllerTypeToName(eStorageController), \ 500 1, 0, vboxcon.DeviceType_HardDisk, oHd); 427 501 else: 428 reporter.testFailure('Running the testcase failed'); 502 oSession.o.machine.attachDevice(_ControllerTypeToName(eStorageController), \ 503 1, 0, vboxcon.DeviceType_HardDisk, oHd.id); 504 except: 505 reporter.errorXcpt('attachDevice("%s",%s,%s,HardDisk,"%s") failed on "%s"' \ 506 % (_ControllerTypeToName(eStorageController), 1, 0, oHd.id, oSession.sName) ); 507 fRc = False; 429 508 else: 430 reporter.testFailure('Preparing the testcase failed'); 431 432 oTst.cleanup(); 509 reporter.log('attached "%s" to %s' % (sDiskPath, oSession.sName)); 510 else: 511 fRc = fRc and oSession.createAndAttachHd(sDiskPath, sDiskFormat, _ControllerTypeToName(eStorageController), \ 512 cb = 300*1024*1024*1024, iPort = 1, fImmutable = False); 513 fRc = fRc and oSession.enableVirtEx(fHwVirt); 514 fRc = fRc and oSession.enableNestedPaging(fNestedPaging); 515 fRc = fRc and oSession.setCpuCount(cCpus); 516 fRc = fRc and oSession.saveSettings(); 517 fRc = oSession.close() and fRc and True; # pychecker hack. 518 oSession = None; 519 else: 520 fRc = False; 521 522 # Start up. 523 if fRc is True: 524 self.logVmInfo(oVM); 525 oSession, oTxsSession = self.startVmAndConnectToTxsViaTcp(sVmName, fCdWait = False, fNatForwardingForTxs = True); 526 if oSession is not None: 527 self.addTask(oSession); 528 529 # Fudge factor - Allow the guest to finish starting up. 530 self.sleep(5); 531 532 # Prepare the storage on the guest 533 lstBinaryPaths = ['/bin', '/sbin', '/usr/bin', '/usr/sbin' ]; 534 oExecVm = remoteexecutor.RemoteExecutor(oTxsSession, lstBinaryPaths, '${SCRATCH}'); 535 oStorCfgVm = storagecfg.StorageCfg(oExecVm, 'linux', [ '/dev/sdb' ]); 536 537 sMountPoint = self.prepareStorage(oStorCfgVm); 538 if sMountPoint is not None: 539 self.testBenchmarks('linux', sMountPoint, oExecVm); 540 self.cleanupStorage(oStorCfgVm); 541 else: 542 reporter.testFailure('Failed to prepare storage for the guest benchmark'); 543 544 # cleanup. 545 self.removeTask(oTxsSession); 546 self.terminateVmBySession(oSession) 547 548 # Remove disk 549 oSession = self.openSession(oVM); 550 if oSession is not None: 551 try: 552 oSession.o.machine.detachDevice(_ControllerTypeToName(eStorageController), 1, 0); 553 554 # Remove storage controller if it is not an IDE controller. 555 if eStorageController is not vboxcon.StorageControllerType_PIIX3 \ 556 and eStorageController is not vboxcon.StorageControllerType_PIIX4: 557 oSession.o.machine.removeStorageController(_ControllerTypeToName(eStorageController)); 558 559 oSession.saveSettings(); 560 self.oVBox.deleteHdByLocation(sDiskPath); 561 oSession.saveSettings(); 562 oSession.close(); 563 oSession = None; 564 except: 565 reporter.errorXcpt('failed to detach/delete disk %s from storage controller' % (sDiskPath)); 566 else: 567 fRc = False; 568 else: 569 fRc = False; 570 return fRc; 571 572 def testBenchmarkOneVM(self, sVmName): 573 """ 574 Runs one VM thru the various benchmark configurations. 575 """ 576 reporter.testStart(sVmName); 577 fRc = True; 578 for sStorageCtrl in self.asStorageCtrls: 579 reporter.testStart(sStorageCtrl); 580 581 if sStorageCtrl == 'AHCI': 582 eStorageCtrl = vboxcon.StorageControllerType_IntelAhci; 583 elif sStorageCtrl == 'IDE': 584 eStorageCtrl = vboxcon.StorageControllerType_PIIX4; 585 elif sStorageCtrl == 'LsiLogicSAS': 586 eStorageCtrl = vboxcon.StorageControllerType_LsiLogicSas; 587 elif sStorageCtrl == 'LsiLogic': 588 eStorageCtrl = vboxcon.StorageControllerType_LsiLogic; 589 elif sStorageCtrl == 'BusLogic': 590 eStorageCtrl = vboxcon.StorageControllerType_BusLogic; 591 else: 592 eStorageCtrl = None; 593 594 for sDiskFormat in self.asDiskFormats: 595 reporter.testStart('%s' % (sDiskFormat)); 596 597 if sDiskFormat == "iSCSI": 598 asPaths = self.asIscsiTargets; 599 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 ]; 604 else: 605 asPaths = []; 606 fRc = False; 607 reporter.testFailure('Failed to prepare storage for VM'); 608 609 for sPath in asPaths: 610 reporter.testStart('%s' % (sPath)); 611 612 if sDiskFormat == "iSCSI": 613 sPath = sPath; 614 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"; 618 619 for cCpus in self.acCpus: 620 if cCpus == 1: reporter.testStart('1 cpu'); 621 else: reporter.testStart('%u cpus' % (cCpus)); 622 623 for sVirtMode in self.asVirtModes: 624 if sVirtMode == 'raw' and cCpus > 1: 625 continue; 626 hsVirtModeDesc = {}; 627 hsVirtModeDesc['raw'] = 'Raw-mode'; 628 hsVirtModeDesc['hwvirt'] = 'HwVirt'; 629 hsVirtModeDesc['hwvirt-np'] = 'NestedPaging'; 630 reporter.testStart(hsVirtModeDesc[sVirtMode]); 631 632 fHwVirt = sVirtMode != 'raw'; 633 fNestedPaging = sVirtMode == 'hwvirt-np'; 634 fRc = self.test1OneCfg(sVmName, eStorageCtrl, sDiskFormat, sPath, \ 635 cCpus, fHwVirt, fNestedPaging) and fRc and True; # pychecker hack. 636 reporter.testDone(); 637 638 reporter.testDone(); 433 639 reporter.testDone(); 434 else: 435 reporter.testFailure('Creating a storage volume on the target failed'); 436 437 oStorCfg.cleanup(); 640 reporter.testDone(); 641 reporter.testDone(); 642 reporter.testDone(); 643 return fRc; 644 645 def test1(self): 646 """ 647 Executes test #1. 648 """ 649 650 fRc = True; 651 oDiskCfg = self.kdStorageCfgs.get(socket.gethostname().lower()); 652 653 # Test the host first if requested 654 if oDiskCfg is not None: 655 lstBinaryPaths = ['/bin', '/sbin', '/usr/bin', '/usr/sbin', \ 656 '/opt/csw/bin', '/usr/ccs/bin', '/usr/sfw/bin']; 657 oExecutor = remoteexecutor.RemoteExecutor(None, lstBinaryPaths, self.sScratchPath); 658 self.oStorCfg = storagecfg.StorageCfg(oExecutor, utils.getHostOs(), oDiskCfg); 659 660 if self.fTestHost: 661 reporter.testStart('Host'); 662 sMountPoint = self.prepareStorage(self.oStorCfg); 663 if sMountPoint is not None: 664 fRc = self.testBenchmarks(utils.getHostOs(), sMountPoint, oExecutor); 665 self.cleanupStorage(self.oStorCfg); 666 else: 667 reporter.testFailure('Failed to prepare host storage'); 668 reporter.testDone(); 669 670 if fRc: 671 # Loop thru the test VMs. 672 for sVM in self.asTestVMs: 673 # run test on the VM. 674 if not self.testBenchmarkOneVM(sVM): 675 fRc = False; 676 else: 677 fRc = True; 438 678 else: 439 reporter.testFailure('Creating a storage pool on the target failed'); 440 441 return fRc; 442 443 def test1Benchmarks(self, sTargetOs, oTxsSession = None): 444 """ 445 Runs all the configured benchmarks on the target. 446 """ 447 reporter.testStart('Host'); 448 for sTest in self.asTests: 449 self.test1Benchmark(sTargetOs, sTest, oTxsSession); 450 reporter.testDone(); 451 452 def test1(self): 453 """ 454 Executes test #1. 455 """ 456 457 # Test the host first if requested 458 fRc = True; 459 if self.fTestHost: 460 fRc = self.test1Benchmarks(utils.getHostOs()); 461 462 # Loop thru the test VMs. 463 #for sVM in self.asTestVMs: 464 # # run test on the VM. 465 # if not self.test1OneVM(sVM): 466 # fRc = False; 467 # else: 468 # fRc = True; 679 fRc = False; 469 680 470 681 return fRc;
Note:
See TracChangeset
for help on using the changeset viewer.