vbox的更動 62036 路徑 trunk/src/VBox/ValidationKit
- 時間撮記:
- 2016-7-6 上午09:25:30 (8 年 以前)
- 位置:
- trunk/src/VBox/ValidationKit/tests/storage
- 檔案:
-
- 修改 2 筆資料
圖例:
- 未更動
- 新增
- 刪除
-
trunk/src/VBox/ValidationKit/tests/storage/Makefile.kmk
r56295 r62036 35 35 $(PATH_SUB_CURRENT)/tdStorageBenchmark1.py \ 36 36 $(PATH_SUB_CURRENT)/tdStorageSnapshotMerging1.py \ 37 $(PATH_SUB_CURRENT)/tdStorageStress1.py 37 $(PATH_SUB_CURRENT)/tdStorageStress1.py \ 38 $(PATH_SUB_CURRENT)/remoteexecutor.py \ 39 $(PATH_SUB_CURRENT)/storagecfg.py 38 40 39 41 VBOX_VALIDATIONKIT_PYTHON_SOURCES += $(ValidationKitTestsStorage_EXEC_SOURCES) -
trunk/src/VBox/ValidationKit/tests/storage/tdStorageBenchmark1.py
r57289 r62036 32 32 33 33 # Standard Python imports. 34 import array;35 34 import os; 35 import socket; 36 36 import sys; 37 37 import StringIO; … … 44 44 45 45 # Validation Kit imports. 46 from common import constants; 46 47 from testdriver import reporter; 47 48 from testdriver import base; 48 49 from testdriver import vbox; 49 50 from testdriver import vboxcon; 51 52 import remoteexecutor; 53 import storagecfg; 50 54 51 55 def _ControllerTypeToName(eControllerType): … … 63 67 return sType; 64 68 65 class IozoneStdOutWrapper(object): 66 """ Parser for iozone standard output """ 67 def __init__(self): 68 self.fpInitWriter = 0.0; 69 self.fpRewriter = 0.0; 70 self.fpReader = 0.0; 71 self.fpRereader = 0.0; 72 self.fpReverseReader = 0.0; 73 self.fpStrideReader = 0.0; 74 self.fpRandomReader = 0.0; 75 self.fpMixedWorkload = 0.0; 76 self.fpRandomWriter = 0.0; 77 self.fpPWrite = 0.0; 78 self.fpPRead = 0.0; 79 80 def read(self, cb): 81 """file.read""" 82 _ = cb; 83 return ""; 84 85 def write(self, sText): 86 """iozone stdout write""" 87 if isinstance(sText, array.array): 69 class FioTest(object): 70 """ 71 Flexible I/O tester testcase. 72 """ 73 74 kdHostIoEngine = { 75 'solaris': 'solarisaio', 76 'linux': 'libaio' 77 }; 78 79 def __init__(self, oExecutor, dCfg = None): 80 self.oExecutor = oExecutor; 81 self.sCfgFileId = None; 82 self.dCfg = dCfg; 83 84 def prepare(self, cMsTimeout = 30000): 85 """ Prepares the testcase """ 86 87 sTargetOs = self.dCfg.get('TargetOs', 'linux'); 88 sIoEngine = self.kdHostIoEngine.get(sTargetOs); 89 if sIoEngine is None: 90 return False; 91 92 cfgBuf = StringIO.StringIO(); 93 cfgBuf.write('[global]\n'); 94 cfgBuf.write('bs=' + self.dCfg.get('RecordSize', '4k') + '\n'); 95 cfgBuf.write('ioengine=' + sIoEngine + '\n'); 96 cfgBuf.write('iodepth=' + self.dCfg.get('QueueDepth', '32') + '\n'); 97 cfgBuf.write('size=' + self.dCfg.get('TestsetSize', '2g') + '\n'); 98 cfgBuf.write('direct=1\n'); 99 cfgBuf.write('directory=' + self.dCfg.get('FilePath', '/mnt') + '\n'); 100 101 cfgBuf.write('[seq-write]\n'); 102 cfgBuf.write('rw=write\n'); 103 cfgBuf.write('stonewall\n'); 104 105 cfgBuf.write('[rand-write]\n'); 106 cfgBuf.write('rw=randwrite\n'); 107 cfgBuf.write('stonewall\n'); 108 109 cfgBuf.write('[seq-read]\n'); 110 cfgBuf.write('rw=read\n'); 111 cfgBuf.write('stonewall\n'); 112 113 cfgBuf.write('[rand-read]\n'); 114 cfgBuf.write('rw=randread\n'); 115 cfgBuf.write('stonewall\n'); 116 117 self.sCfgFileId = self.oExecutor.copyString(cfgBuf, 'aio-test', cMsTimeout); 118 return self.sCfgFileId is not None; 119 120 def run(self, cMsTimeout = 30000): 121 """ Runs the testcase """ 122 _ = cMsTimeout 123 fRc, sOutput = self.oExecutor.execBinary('fio', (self.sCfgFileId,)); 124 # @todo: Parse output. 125 _ = sOutput; 126 return fRc; 127 128 def cleanup(self): 129 """ Cleans up any leftovers from the testcase. """ 130 131 def reportResult(self): 132 """ 133 Reports the test results to the test manager. 134 """ 135 return True; 136 137 class IozoneTest(object): 138 """ 139 I/O zone testcase. 140 """ 141 def __init__(self, oExecutor, dCfg = None): 142 self.oExecutor = oExecutor; 143 self.sResult = None; 144 self.lstTests = [ ('initial writers', 'FirstWrite'), 145 ('rewriters', 'Rewrite'), 146 ('re-readers', 'ReRead'), 147 ('stride readers', 'StrideRead'), 148 ('random readers', 'RandomRead'), 149 ('mixed workload', 'MixedWorkload'), 150 ('random writers', 'RandomWrite'), 151 ('pwrite writers', 'PWrite'), 152 ('pread readers', 'PRead'), 153 ('readers', 'FirstRead')]; 154 self.sRecordSize = dCfg.get('RecordSize', '4k'); 155 self.sTestsetSize = dCfg.get('TestsetSize', '2g'); 156 self.sQueueDepth = dCfg.get('QueueDepth', '32'); 157 self.sFilePath = dCfg.get('FilePath', '/mnt/iozone'); 158 159 def prepare(self, cMsTimeout = 30000): 160 """ Prepares the testcase """ 161 _ = cMsTimeout; 162 return True; # Nothing to do. 163 164 def run(self, cMsTimeout = 30000): 165 """ Runs the testcase """ 166 fRc, sOutput = self.oExecutor.execBinary('iozone', ('-r', self.sRecordSize, '-s', self.sTestsetSize, \ 167 '-t', '1', '-T', '-I', \ 168 '-H', self.sQueueDepth,'-F', self.sFilePath)); 169 if fRc: 170 self.sResult = sOutput; 171 172 _ = cMsTimeout; 173 return fRc; 174 175 def cleanup(self): 176 """ Cleans up any leftovers from the testcase. """ 177 return True; 178 179 def reportResult(self): 180 """ 181 Reports the test results to the test manager. 182 """ 183 184 fRc = True; 185 if self.sResult is not None: 88 186 try: 89 sText = sText.tostring(); 187 asLines = self.sResult.splitlines(); 188 for sLine in asLines: 189 sLine = sLine.strip(); 190 if sLine.startswith('Children') is True: 191 # Extract the value 192 idxValue = sLine.rfind('='); 193 if idxValue is -1: 194 raise Exception('IozoneTest: Invalid state'); 195 196 idxValue += 1; 197 while sLine[idxValue] == ' ': 198 idxValue += 1; 199 200 idxValueEnd = idxValue; 201 while sLine[idxValueEnd] == '.' or sLine[idxValueEnd].isdigit(): 202 idxValueEnd += 1; 203 204 for sNeedle, sTestVal in self.lstTests: 205 if sLine.rfind(sNeedle) is not -1: 206 reporter.testValue(sTestVal, sLine[idxValue:idxValueEnd], 207 constants.valueunit.g_asNames[constants.valueunit.KILOBYTES_PER_SEC]); 90 208 except: 91 pass; 92 try: 93 asLines = sText.splitlines(); 94 for sLine in asLines: 95 sLine = sLine.strip(); 96 if sLine.startswith('Children') is True: 97 # Extract the value 98 idxValue = sLine.rfind('='); 99 if idxValue is -1: 100 raise Exception('IozoneStdOutWrapper: Invalid state'); 101 102 idxValue += 1; 103 while sLine[idxValue] == ' ': 104 idxValue += 1; 105 106 idxValueEnd = idxValue; 107 while sLine[idxValueEnd] == '.' or sLine[idxValueEnd].isdigit(): 108 idxValueEnd += 1; 109 110 fpValue = float(sLine[idxValue:idxValueEnd]); 111 112 if sLine.rfind('initial writers') is not -1: 113 self.fpInitWriter = fpValue; 114 elif sLine.rfind('rewriters') is not -1: 115 self.fpRewriter = fpValue; 116 elif sLine.rfind('re-readers') is not -1: 117 self.fpRereader = fpValue; 118 elif sLine.rfind('reverse readers') is not -1: 119 self.fpReverseReader = fpValue; 120 elif sLine.rfind('stride readers') is not -1: 121 self.fpStrideReader = fpValue; 122 elif sLine.rfind('random readers') is not -1: 123 self.fpRandomReader = fpValue; 124 elif sLine.rfind('mixed workload') is not -1: 125 self.fpMixedWorkload = fpValue; 126 elif sLine.rfind('random writers') is not -1: 127 self.fpRandomWriter = fpValue; 128 elif sLine.rfind('pwrite writers') is not -1: 129 self.fpPWrite = fpValue; 130 elif sLine.rfind('pread readers') is not -1: 131 self.fpPRead = fpValue; 132 elif sLine.rfind('readers') is not -1: 133 self.fpReader = fpValue; 134 else: 135 reporter.log('Unknown test returned %s' % sLine); 136 except: 137 pass; 138 return None; 139 140 def getInitWriter(self): 141 """Get value for initial writers""" 142 return self.fpInitWriter; 143 144 def getRewriter(self): 145 """Get value for re-writers""" 146 return self.fpRewriter; 147 148 def getReader(self): 149 """Get value for initial readers""" 150 return self.fpReader; 151 152 def getRereader(self): 153 """Get value for re-writers""" 154 return self.fpRereader; 155 156 def getReverseReader(self): 157 """Get value for reverse readers""" 158 return self.fpReverseReader; 159 160 def getStrideReader(self): 161 """Get value for stride readers""" 162 return self.fpStrideReader; 163 164 def getRandomReader(self): 165 """Get value for random readers""" 166 return self.fpRandomReader; 167 168 def getMixedWorkload(self): 169 """Get value for mixed workload""" 170 return self.fpMixedWorkload; 171 172 def getRandomWriter(self): 173 """Get value for random writers""" 174 return self.fpRandomWriter; 175 176 def getPWrite(self): 177 """Get value for pwrite writers""" 178 return self.fpPWrite; 179 180 def getPRead(self): 181 """Get value for pread readers""" 182 return self.fpPRead; 183 184 class FioWrapper(object): 185 """ Fio stdout parser and config file creator """ 186 def __init__(self, sRecordSize, sTestsetSize, sQueueDepth, sPath): 187 188 self.configBuf = StringIO.StringIO(); 189 self.configBuf.write('[global]\n'); 190 self.configBuf.write('bs=' + sRecordSize + '\n'); 191 self.configBuf.write('ioengine=libaio\n'); 192 self.configBuf.write('iodepth=' + sQueueDepth + '\n'); 193 self.configBuf.write('size=' + sTestsetSize + '\n'); 194 self.configBuf.write('direct=1\n'); 195 self.configBuf.write('directory=' + sPath + '\n'); 196 197 self.configBuf.write('[seq-write]\n'); 198 self.configBuf.write('rw=write\n'); 199 self.configBuf.write('stonewall\n'); 200 201 self.configBuf.write('[rand-write]\n'); 202 self.configBuf.write('rw=randwrite\n'); 203 self.configBuf.write('stonewall\n'); 204 205 self.configBuf.write('[seq-read]\n'); 206 self.configBuf.write('rw=read\n'); 207 self.configBuf.write('stonewall\n'); 208 209 self.configBuf.write('[rand-read]\n'); 210 self.configBuf.write('rw=randread\n'); 211 self.configBuf.write('stonewall\n'); 212 return; 213 214 def getConfig(self): 215 """fio stdin feeder, gives the config file based on the given config values""" 216 return self.configBuf.getvalue(); 217 218 def write(self, sText): 219 """fio stdout write""" 220 if isinstance(sText, array.array): 221 try: 222 sText = sText.tostring(); 223 except: 224 pass; 225 try: 226 asLines = sText.splitlines(); 227 for sLine in asLines: 228 reporter.log(sLine); 229 except: 230 pass; 231 return None; 209 fRc = False; 210 else: 211 fRc = False; 212 213 return fRc; 232 214 233 215 … … 256 238 self.asTestsDef = ['iozone', 'fio']; 257 239 self.asTests = self.asTestsDef; 258 self.asDirsDef = ['/run/media/alexander/OWCSSD/alexander', \259 '/run/media/alexander/CrucialSSD/alexander', \260 '/run/media/alexander/HardDisk/alexander', \261 '/home/alexander'];262 self.asDirs = self.asDirsDef;263 240 self.asIscsiTargetsDef = ['aurora|iqn.2011-03.home.aurora:aurora.storagebench|1']; 264 241 self.asIscsiTargets = self.asIscsiTargetsDef; 242 self.fTestHost = False; 265 243 266 244 # … … 279 257 reporter.log(' --disk-formats <type1[:type2[:...]]>'); 280 258 reporter.log(' Default: %s' % (':'.join(self.asDiskFormats))); 281 reporter.log(' --disk-dirs <path1[:path2[:...]]>');282 reporter.log(' Default: %s' % (':'.join(self.asDirs)));283 259 reporter.log(' --iscsi-targets <target1[:target2[:...]]>'); 284 260 reporter.log(' Default: %s' % (':'.join(self.asIscsiTargets))); … … 291 267 reporter.log(' --skip-vms <vm1[:vm2[:...]]>'); 292 268 reporter.log(' Skip the specified VMs when testing.'); 269 reporter.log(' --test-host'); 270 reporter.log(' Do all configured tests on the host first and report the results'); 271 reporter.log(' to get a baseline'); 293 272 return rc; 294 273 … … 320 299 if iArg >= len(asArgs): raise base.InvalidOption('The "--disk-formats" takes a colon separated list of disk formats'); 321 300 self.asDiskFormats = asArgs[iArg].split(':'); 322 elif asArgs[iArg] == '--disk-dirs':323 iArg += 1;324 if iArg >= len(asArgs): raise base.InvalidOption('The "--disk-dirs" takes a colon separated list of directories');325 self.asDirs = asArgs[iArg].split(':');326 301 elif asArgs[iArg] == '--iscsi-targets': 327 302 iArg += 1; … … 348 323 if s not in self.asTestVMsDef: 349 324 reporter.log('warning: The "--test-vms" value "%s" does not specify any of our test VMs.' % (s)); 325 elif asArgs[iArg] == '--test-host': 326 self.fTestHost = True; 350 327 else: 351 328 return vbox.TestDriver.parseOption(self, asArgs, iArg); … … 401 378 # 402 379 403 def test1RunTestProgs(self, oSession, oTxsSession, fRc, sTestName): 404 """ 405 Runs all the test programs on the test machine. 406 """ 407 reporter.testStart(sTestName); 408 409 # Prepare test disk, just create filesystem without partition 410 reporter.testStart('mkfs.ext4'); 411 fRc = self.txsRunTest(oTxsSession, 'Create FS', 60000, 412 '/sbin/mkfs.ext4', 413 ('mkfs.ext4', '-F', '/dev/vboxtest')); 380 def test1Benchmark(self, sBenchmark, oTxsSession = None): 381 """ 382 Runs the given benchmark on the test host. 383 """ 384 lstBinaryPaths = ['/bin', '/sbin', '/usr/bin', '/usr/sbin', \ 385 '/opt/csw/bin', '/usr/ccs/bin', '/usr/sfw/bin']; 386 387 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); 400 if fRc: 401 fRc, sMountpoint = oStorCfg.createVolume(sPoolId); 402 _ = sMountpoint; 403 if fRc: 404 oTst = IozoneTest(oExecutor); 405 fRc = oTst.prepare(); 406 if fRc: 407 fRc = oTst.run(); 408 if fRc: 409 fRc = oTst.reportResult(); 410 else: 411 reporter.testFailure('Running the testcase failed'); 412 else: 413 reporter.testFailure('Preparing the testcase failed'); 414 415 oTst.cleanup(); 416 else: 417 reporter.testFailure('Creating a storage pool on the target failed'); 418 419 oStorCfg.cleanup(); 420 reporter.testDone(); 421 422 return fRc; 423 424 def test1Benchmarks(self, oTxsSession = None): 425 """ 426 Runs all the configured benchmarks on the target. 427 """ 428 reporter.testStart('Host'); 429 for sTest in self.asTests: 430 self.test1Benchmark(sTest, oTxsSession); 414 431 reporter.testDone(); 415 432 416 reporter.testStart('mount'); 417 fRc = self.txsRunTest(oTxsSession, 'Mount FS', 30000, 418 '/bin/mount', 419 ('mount', '/dev/vboxtest', '/mnt')); 420 reporter.testDone(); 421 422 reporter.testStart('iozone'); 423 if fRc and 'iozone' in self.asTests: 424 oStdOut = IozoneStdOutWrapper(); 425 fRc = self.txsRunTestRedirectStd(oTxsSession, '2G', 3600000, 426 '/usr/bin/iozone', 427 ('iozone', '-r', '64k', '-s', '2g', '-t', '1', '-T', '-I', 428 '-H', '32','-F', '/mnt/iozone'), 429 (), '', '/dev/null', oStdOut, '/dev/null', '/dev/null'); 430 if fRc is True: 431 reporter.log("Initial writer: " + str(oStdOut.getInitWriter())); 432 reporter.log("Rewriter: " + str(oStdOut.getRewriter())); 433 reporter.log("Initial reader: " + str(oStdOut.getReader())); 434 reporter.log("Re-reader: " + str(oStdOut.getRereader())); 435 reporter.log("Reverse reader: " + str(oStdOut.getReverseReader())); 436 reporter.log("Stride reader: " + str(oStdOut.getStrideReader())); 437 reporter.log("Random reader: " + str(oStdOut.getRandomReader())); 438 reporter.log("Mixed Workload: " + str(oStdOut.getMixedWorkload())); 439 reporter.log("Random writer: " + str(oStdOut.getRandomWriter())); 440 reporter.log("pwrite Writer: " + str(oStdOut.getPWrite())); 441 reporter.log("pread Reader: " + str(oStdOut.getPRead())); 442 reporter.testDone(); 443 else: 444 reporter.testDone(fSkipped = True); 445 446 reporter.testStart('fio'); 447 if fRc and 'fio' in self.asTests: 448 oFioWrapper = FioWrapper('64k', '2g', '32', '/mnt'); 449 fRc = self.txsUploadString(oSession, oTxsSession, oFioWrapper.getConfig(), '${SCRATCH}/aio-test'); 450 fRc = fRc and self.txsRunTestRedirectStd(oTxsSession, '2G', 3600000, 451 '/usr/bin/fio', ('fio', '${SCRATCH}/aio-test'), 452 (), '', '/dev/null', oFioWrapper, '/dev/null', '/dev/null'); 453 else: 454 reporter.testDone(fSkipped = True); 455 456 reporter.testDone(not fRc); 457 return fRc; 458 459 def test1OneCfg(self, sVmName, eStorageController, sDiskFormat, sDiskPath, cCpus, fHwVirt, fNestedPaging): 460 """ 461 Runs the specified VM thru test #1. 462 463 Returns a success indicator on the general test execution. This is not 464 the actual test result. 465 """ 466 oVM = self.getVmByName(sVmName); 467 468 # Reconfigure the VM 433 def test1(self): 434 """ 435 Executes test #1. 436 """ 437 438 # Test the host first if requested 469 439 fRc = True; 470 oSession = self.openSession(oVM); 471 if oSession is not None: 472 # Attach HD 473 fRc = oSession.ensureControllerAttached(_ControllerTypeToName(eStorageController)); 474 fRc = fRc and oSession.setStorageControllerType(eStorageController, _ControllerTypeToName(eStorageController)); 475 476 if sDiskFormat == "iSCSI": 477 listNames = []; 478 listValues = []; 479 listValues = sDiskPath.split('|'); 480 listNames.append('TargetAddress'); 481 listNames.append('TargetName'); 482 listNames.append('LUN'); 483 484 if self.fpApiVer >= 5.0: 485 oHd = oSession.oVBox.createMedium(sDiskFormat, sDiskPath, vboxcon.AccessMode_ReadWrite, \ 486 vboxcon.DeviceType_HardDisk); 487 else: 488 oHd = oSession.oVBox.createHardDisk(sDiskFormat, sDiskPath); 489 oHd.type = vboxcon.MediumType_Normal; 490 oHd.setProperties(listNames, listValues); 491 492 # Attach it. 493 if fRc is True: 494 try: 495 if oSession.fpApiVer >= 4.0: 496 oSession.o.machine.attachDevice(_ControllerTypeToName(eStorageController), \ 497 1, 0, vboxcon.DeviceType_HardDisk, oHd); 498 else: 499 oSession.o.machine.attachDevice(_ControllerTypeToName(eStorageController), \ 500 1, 0, vboxcon.DeviceType_HardDisk, oHd.id); 501 except: 502 reporter.errorXcpt('attachDevice("%s",%s,%s,HardDisk,"%s") failed on "%s"' \ 503 % (_ControllerTypeToName(eStorageController), 1, 0, oHd.id, oSession.sName) ); 504 fRc = False; 505 else: 506 reporter.log('attached "%s" to %s' % (sDiskPath, oSession.sName)); 507 else: 508 fRc = fRc and oSession.createAndAttachHd(sDiskPath, sDiskFormat, _ControllerTypeToName(eStorageController), \ 509 cb = 10*1024*1024*1024, iPort = 1, fImmutable = False); 510 fRc = fRc and oSession.enableVirtEx(fHwVirt); 511 fRc = fRc and oSession.enableNestedPaging(fNestedPaging); 512 fRc = fRc and oSession.setCpuCount(cCpus); 513 fRc = fRc and oSession.saveSettings(); 514 fRc = oSession.close() and fRc and True; # pychecker hack. 515 oSession = None; 516 else: 517 fRc = False; 518 519 # Start up. 520 if fRc is True: 521 self.logVmInfo(oVM); 522 oSession, oTxsSession = self.startVmAndConnectToTxsViaTcp(sVmName, fCdWait = False, fNatForwardingForTxs = True); 523 if oSession is not None: 524 self.addTask(oSession); 525 526 # Fudge factor - Allow the guest to finish starting up. 527 self.sleep(5); 528 529 self.test1RunTestProgs(oSession, oTxsSession, fRc, 'Disk benchmark'); 530 531 # cleanup. 532 self.removeTask(oTxsSession); 533 self.terminateVmBySession(oSession) 534 535 # Remove disk 536 oSession = self.openSession(oVM); 537 if oSession is not None: 538 try: 539 oSession.o.machine.detachDevice(_ControllerTypeToName(eStorageController), 1, 0); 540 541 # Remove storage controller if it is not an IDE controller. 542 if eStorageController is not vboxcon.StorageControllerType_PIIX3 \ 543 and eStorageController is not vboxcon.StorageControllerType_PIIX4: 544 oSession.o.machine.removeStorageController(_ControllerTypeToName(eStorageController)); 545 546 oSession.saveSettings(); 547 self.oVBox.deleteHdByLocation(sDiskPath); 548 oSession.saveSettings(); 549 oSession.close(); 550 oSession = None; 551 except: 552 reporter.errorXcpt('failed to detach/delete disk %s from storage controller' % (sDiskPath)); 553 else: 554 fRc = False; 555 else: 556 fRc = False; 557 return fRc; 558 559 def test1OneVM(self, sVmName): 560 """ 561 Runs one VM thru the various configurations. 562 """ 563 reporter.testStart(sVmName); 564 fRc = True; 565 for sStorageCtrl in self.asStorageCtrls: 566 reporter.testStart(sStorageCtrl); 567 568 if sStorageCtrl == 'AHCI': 569 eStorageCtrl = vboxcon.StorageControllerType_IntelAhci; 570 elif sStorageCtrl == 'IDE': 571 eStorageCtrl = vboxcon.StorageControllerType_PIIX4; 572 elif sStorageCtrl == 'LsiLogicSAS': 573 eStorageCtrl = vboxcon.StorageControllerType_LsiLogicSas; 574 elif sStorageCtrl == 'LsiLogic': 575 eStorageCtrl = vboxcon.StorageControllerType_LsiLogic; 576 elif sStorageCtrl == 'BusLogic': 577 eStorageCtrl = vboxcon.StorageControllerType_BusLogic; 578 else: 579 eStorageCtrl = None; 580 581 for sDiskFormat in self.asDiskFormats: 582 reporter.testStart('%s' % (sDiskFormat)); 583 584 if sDiskFormat == "iSCSI": 585 asPaths = self.asIscsiTargets; 586 else: 587 asPaths = self.asDirs; 588 589 for sDir in asPaths: 590 reporter.testStart('%s' % (sDir)); 591 592 if sDiskFormat == "iSCSI": 593 sPath = sDir; 594 else: 595 sPath = sDir + "/test.disk"; 596 597 for cCpus in self.acCpus: 598 if cCpus == 1: reporter.testStart('1 cpu'); 599 else: reporter.testStart('%u cpus' % (cCpus)); 600 601 for sVirtMode in self.asVirtModes: 602 if sVirtMode == 'raw' and cCpus > 1: 603 continue; 604 hsVirtModeDesc = {}; 605 hsVirtModeDesc['raw'] = 'Raw-mode'; 606 hsVirtModeDesc['hwvirt'] = 'HwVirt'; 607 hsVirtModeDesc['hwvirt-np'] = 'NestedPaging'; 608 reporter.testStart(hsVirtModeDesc[sVirtMode]); 609 610 fHwVirt = sVirtMode != 'raw'; 611 fNestedPaging = sVirtMode == 'hwvirt-np'; 612 fRc = self.test1OneCfg(sVmName, eStorageCtrl, sDiskFormat, sPath, \ 613 cCpus, fHwVirt, fNestedPaging) and fRc and True; # pychecker hack. 614 reporter.testDone(); 615 616 reporter.testDone(); 617 reporter.testDone(); 618 reporter.testDone(); 619 reporter.testDone(); 620 reporter.testDone(); 621 return fRc; 622 623 def test1(self): 624 """ 625 Executes test #1. 626 """ 440 if self.fTestHost: 441 fRc = self.test1Benchmarks() 627 442 628 443 # Loop thru the test VMs. 629 for sVM in self.asTestVMs:630 # run test on the VM.631 if not self.test1OneVM(sVM):632 fRc = False;633 else:634 fRc = True;444 #for sVM in self.asTestVMs: 445 # # run test on the VM. 446 # if not self.test1OneVM(sVM): 447 # fRc = False; 448 # else: 449 # fRc = True; 635 450 636 451 return fRc;
注意:
瀏覽 TracChangeset
來幫助您使用更動檢視器