VirtualBox

source: vbox/trunk/src/VBox/ValidationKit/tests/storage/tdStorageBenchmark1.py@ 52776

最後變更 在這個檔案從52776是 52776,由 vboxsync 提交於 11 年 前

fix OSE

  • 屬性 svn:eol-style 設為 LF
  • 屬性 svn:executable 設為 *
  • 屬性 svn:keywords 設為 Author Date Id Revision
檔案大小: 26.0 KB
 
1#!/usr/bin/env python
2# -*- coding: utf-8 -*-
3# $Id: tdStorageBenchmark1.py 52776 2014-09-17 14:51:43Z vboxsync $
4
5"""
6VirtualBox Validation Kit - Storage benchmark.
7"""
8
9__copyright__ = \
10"""
11Copyright (C) 2012-2014 Oracle Corporation
12
13This file is part of VirtualBox Open Source Edition (OSE), as
14available from http://www.alldomusa.eu.org. This file is free software;
15you can redistribute it and/or modify it under the terms of the GNU
16General Public License (GPL) as published by the Free Software
17Foundation, in version 2 as it comes in the "COPYING" file of the
18VirtualBox OSE distribution. VirtualBox OSE is distributed in the
19hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
20
21The contents of this file may alternatively be used under the terms
22of the Common Development and Distribution License Version 1.0
23(CDDL) only, as it comes in the "COPYING.CDDL" file of the
24VirtualBox OSE distribution, in which case the provisions of the
25CDDL are applicable instead of those of the GPL.
26
27You may elect to license modified versions of this file under the
28terms and conditions of either the GPL or the CDDL or both.
29"""
30__version__ = "$Revision: 52776 $"
31
32
33# Standard Python imports.
34import array;
35import os;
36import sys;
37import StringIO;
38
39# Only the main script needs to modify the path.
40try: __file__
41except: __file__ = sys.argv[0];
42g_ksValidationKitDir = os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__))));
43sys.path.append(g_ksValidationKitDir);
44
45# Validation Kit imports.
46from testdriver import reporter;
47from testdriver import base;
48from testdriver import vbox;
49from testdriver import vboxcon;
50
51def _ControllerTypeToName(eControllerType):
52 """ Translate a controller type to a name. """
53 if eControllerType == vboxcon.StorageControllerType_PIIX3 or eControllerType == vboxcon.StorageControllerType_PIIX4:
54 sType = "IDE Controller";
55 elif eControllerType == vboxcon.StorageControllerType_IntelAhci:
56 sType = "SATA Controller";
57 elif eControllerType == vboxcon.StorageControllerType_LsiLogicSas:
58 sType = "SAS Controller";
59 elif eControllerType == vboxcon.StorageControllerType_LsiLogic or eControllerType == vboxcon.StorageControllerType_BusLogic:
60 sType = "SCSI Controller";
61 else:
62 sType = "Storage Controller";
63 return sType;
64
65class 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):
88 try:
89 sText = sText.tostring();
90 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
184class 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;
232
233
234class tdStorageBenchmark(vbox.TestDriver): # pylint: disable=R0902
235 """
236 Storage benchmark.
237 """
238
239 def __init__(self):
240 vbox.TestDriver.__init__(self);
241 self.asRsrcs = None;
242 self.oGuestToGuestVM = None;
243 self.oGuestToGuestSess = None;
244 self.oGuestToGuestTxs = None;
245 self.asTestVMsDef = ['tst-debian'];
246 self.asTestVMs = self.asTestVMsDef;
247 self.asSkipVMs = [];
248 self.asVirtModesDef = ['hwvirt', 'hwvirt-np', 'raw',]
249 self.asVirtModes = self.asVirtModesDef
250 self.acCpusDef = [1, 2,]
251 self.acCpus = self.acCpusDef;
252 self.asStorageCtrlsDef = ['AHCI', 'IDE', 'LsiLogicSAS', 'LsiLogic', 'BusLogic'];
253 self.asStorageCtrls = self.asStorageCtrlsDef;
254 self.asDiskFormatsDef = ['VDI', 'VMDK', 'VHD', 'QED', 'Parallels', 'QCOW', 'iSCSI'];
255 self.asDiskFormats = self.asDiskFormatsDef;
256 self.asTestsDef = ['iozone', 'fio'];
257 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 self.asIscsiTargetsDef = ['aurora|iqn.2011-03.home.aurora:aurora.storagebench|1'];
264 self.asIscsiTargets = self.asIscsiTargetsDef;
265
266 #
267 # Overridden methods.
268 #
269 def showUsage(self):
270 rc = vbox.TestDriver.showUsage(self);
271 reporter.log('');
272 reporter.log('tdStorageBenchmark1 Options:');
273 reporter.log(' --virt-modes <m1[:m2[:]]');
274 reporter.log(' Default: %s' % (':'.join(self.asVirtModesDef)));
275 reporter.log(' --cpu-counts <c1[:c2[:]]');
276 reporter.log(' Default: %s' % (':'.join(str(c) for c in self.acCpusDef)));
277 reporter.log(' --storage-ctrls <type1[:type2[:...]]>');
278 reporter.log(' Default: %s' % (':'.join(self.asStorageCtrls)));
279 reporter.log(' --disk-formats <type1[:type2[:...]]>');
280 reporter.log(' Default: %s' % (':'.join(self.asDiskFormats)));
281 reporter.log(' --disk-dirs <path1[:path2[:...]]>');
282 reporter.log(' Default: %s' % (':'.join(self.asDirs)));
283 reporter.log(' --iscsi-targets <target1[:target2[:...]]>');
284 reporter.log(' Default: %s' % (':'.join(self.asIscsiTargets)));
285 reporter.log(' --tests <test1[:test2[:...]]>');
286 reporter.log(' Default: %s' % (':'.join(self.asTests)));
287 reporter.log(' --test-vms <vm1[:vm2[:...]]>');
288 reporter.log(' Test the specified VMs in the given order. Use this to change');
289 reporter.log(' the execution order or limit the choice of VMs');
290 reporter.log(' Default: %s (all)' % (':'.join(self.asTestVMsDef)));
291 reporter.log(' --skip-vms <vm1[:vm2[:...]]>');
292 reporter.log(' Skip the specified VMs when testing.');
293 return rc;
294
295 def parseOption(self, asArgs, iArg): # pylint: disable=R0912,R0915
296 if asArgs[iArg] == '--virt-modes':
297 iArg += 1;
298 if iArg >= len(asArgs): raise base.InvalidOption('The "--virt-modes" takes a colon separated list of modes');
299 self.asVirtModes = asArgs[iArg].split(':');
300 for s in self.asVirtModes:
301 if s not in self.asVirtModesDef:
302 raise base.InvalidOption('The "--virt-modes" value "%s" is not valid; valid values are: %s' \
303 % (s, ' '.join(self.asVirtModesDef)));
304 elif asArgs[iArg] == '--cpu-counts':
305 iArg += 1;
306 if iArg >= len(asArgs): raise base.InvalidOption('The "--cpu-counts" takes a colon separated list of cpu counts');
307 self.acCpus = [];
308 for s in asArgs[iArg].split(':'):
309 try: c = int(s);
310 except: raise base.InvalidOption('The "--cpu-counts" value "%s" is not an integer' % (s,));
311 if c <= 0: raise base.InvalidOption('The "--cpu-counts" value "%s" is zero or negative' % (s,));
312 self.acCpus.append(c);
313 elif asArgs[iArg] == '--storage-ctrls':
314 iArg += 1;
315 if iArg >= len(asArgs):
316 raise base.InvalidOption('The "--storage-ctrls" takes a colon separated list of Storage controller types');
317 self.asStorageCtrls = asArgs[iArg].split(':');
318 elif asArgs[iArg] == '--disk-formats':
319 iArg += 1;
320 if iArg >= len(asArgs): raise base.InvalidOption('The "--disk-formats" takes a colon separated list of disk formats');
321 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 elif asArgs[iArg] == '--iscsi-targets':
327 iArg += 1;
328 if iArg >= len(asArgs):
329 raise base.InvalidOption('The "--iscsi-targets" takes a colon separated list of iscsi targets');
330 self.asIscsiTargets = asArgs[iArg].split(':');
331 elif asArgs[iArg] == '--tests':
332 iArg += 1;
333 if iArg >= len(asArgs): raise base.InvalidOption('The "--tests" takes a colon separated list of disk formats');
334 self.asTests = asArgs[iArg].split(':');
335 elif asArgs[iArg] == '--test-vms':
336 iArg += 1;
337 if iArg >= len(asArgs): raise base.InvalidOption('The "--test-vms" takes colon separated list');
338 self.asTestVMs = asArgs[iArg].split(':');
339 for s in self.asTestVMs:
340 if s not in self.asTestVMsDef:
341 raise base.InvalidOption('The "--test-vms" value "%s" is not valid; valid values are: %s' \
342 % (s, ' '.join(self.asTestVMsDef)));
343 elif asArgs[iArg] == '--skip-vms':
344 iArg += 1;
345 if iArg >= len(asArgs): raise base.InvalidOption('The "--skip-vms" takes colon separated list');
346 self.asSkipVMs = asArgs[iArg].split(':');
347 for s in self.asSkipVMs:
348 if s not in self.asTestVMsDef:
349 reporter.log('warning: The "--test-vms" value "%s" does not specify any of our test VMs.' % (s));
350 else:
351 return vbox.TestDriver.parseOption(self, asArgs, iArg);
352 return iArg + 1;
353
354 def completeOptions(self):
355 # Remove skipped VMs from the test list.
356 for sVM in self.asSkipVMs:
357 try: self.asTestVMs.remove(sVM);
358 except: pass;
359
360 return vbox.TestDriver.completeOptions(self);
361
362 def getResourceSet(self):
363 # Construct the resource list the first time it's queried.
364 if self.asRsrcs is None:
365 self.asRsrcs = [];
366 if 'tst-debian' in self.asTestVMs:
367 self.asRsrcs.append('4.2/storage/debian.vdi');
368
369 return self.asRsrcs;
370
371 def actionConfig(self):
372
373 # Make sure vboxapi has been imported so we can use the constants.
374 if not self.importVBoxApi():
375 return False;
376
377 #
378 # Configure the VMs we're going to use.
379 #
380
381 # Linux VMs
382 if 'tst-debian' in self.asTestVMs:
383 oVM = self.createTestVM('tst-debian', 1, '4.2/storage/debian.vdi', sKind = 'Debian_64', fIoApic = True, \
384 eNic0AttachType = vboxcon.NetworkAttachmentType_NAT, \
385 eNic0Type = vboxcon.NetworkAdapterType_Am79C973);
386 if oVM is None:
387 return False;
388
389 return True;
390
391 def actionExecute(self):
392 """
393 Execute the testcase.
394 """
395 fRc = self.test1();
396 return fRc;
397
398
399 #
400 # Test execution helpers.
401 #
402
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'));
414 reporter.testDone();
415
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', '-H', '32','-F', '/mnt/iozone'), \
428 (), '', '/dev/null', oStdOut, '/dev/null', '/dev/null');
429 if fRc is True:
430 reporter.log("Initial writer: " + str(oStdOut.getInitWriter()));
431 reporter.log("Rewriter: " + str(oStdOut.getRewriter()));
432 reporter.log("Initial reader: " + str(oStdOut.getReader()));
433 reporter.log("Re-reader: " + str(oStdOut.getRereader()));
434 reporter.log("Reverse reader: " + str(oStdOut.getReverseReader()));
435 reporter.log("Stride reader: " + str(oStdOut.getStrideReader()));
436 reporter.log("Random reader: " + str(oStdOut.getRandomReader()));
437 reporter.log("Mixed Workload: " + str(oStdOut.getMixedWorkload()));
438 reporter.log("Random writer: " + str(oStdOut.getRandomWriter()));
439 reporter.log("pwrite Writer: " + str(oStdOut.getPWrite()));
440 reporter.log("pread Reader: " + str(oStdOut.getPRead()));
441 reporter.testDone();
442 else:
443 reporter.testDone(fSkipped = True);
444
445 reporter.testStart('fio');
446 if fRc and 'fio' in self.asTests:
447 oFioWrapper = FioWrapper('64k', '2g', '32', '/mnt');
448 fRc = self.txsUploadString(oSession, oTxsSession, oFioWrapper.getConfig(), '${SCRATCH}/aio-test');
449 fRc = fRc and self.txsRunTestRedirectStd(oTxsSession, '2G', 3600000, \
450 '/usr/bin/fio', ('fio', '${SCRATCH}/aio-test'), \
451 (), '', '/dev/null', oFioWrapper, '/dev/null', '/dev/null');
452 else:
453 reporter.testDone(fSkipped = True);
454
455 reporter.testDone(not fRc);
456 return fRc;
457
458 def test1OneCfg(self, sVmName, eStorageController, sDiskFormat, sDiskPath, cCpus, fHwVirt, fNestedPaging):
459 """
460 Runs the specified VM thru test #1.
461
462 Returns a success indicator on the general test execution. This is not
463 the actual test result.
464 """
465 oVM = self.getVmByName(sVmName);
466
467 # Reconfigure the VM
468 fRc = True;
469 oSession = self.openSession(oVM);
470 if oSession is not None:
471 # Attach HD
472 fRc = oSession.ensureControllerAttached(_ControllerTypeToName(eStorageController));
473 fRc = fRc and oSession.setStorageControllerType(eStorageController, _ControllerTypeToName(eStorageController));
474
475 if sDiskFormat == "iSCSI":
476 listNames = [];
477 listValues = [];
478 listValues = sDiskPath.split('|');
479 listNames.append('TargetAddress');
480 listNames.append('TargetName');
481 listNames.append('LUN');
482
483 oHd = oSession.oVBox.createHardDisk(sDiskFormat, sDiskPath);
484 oHd.type = vboxcon.MediumType_Normal;
485 oHd.setProperties(listNames, listValues);
486
487 # Attach it.
488 if fRc is True:
489 try:
490 if oSession.fpApiVer >= 4.0:
491 oSession.o.machine.attachDevice(_ControllerTypeToName(eStorageController), \
492 1, 0, vboxcon.DeviceType_HardDisk, oHd);
493 else:
494 oSession.o.machine.attachDevice(_ControllerTypeToName(eStorageController), \
495 1, 0, vboxcon.DeviceType_HardDisk, oHd.id);
496 except:
497 reporter.errorXcpt('attachDevice("%s",%s,%s,HardDisk,"%s") failed on "%s"' \
498 % (_ControllerTypeToName(eStorageController), 1, 0, oHd.id, oSession.sName) );
499 fRc = False;
500 else:
501 reporter.log('attached "%s" to %s' % (sDiskPath, oSession.sName));
502 else:
503 fRc = fRc and oSession.createAndAttachHd(sDiskPath, sDiskFormat, _ControllerTypeToName(eStorageController), \
504 cb = 10*1024*1024*1024, iPort = 1, fImmutable = False);
505 fRc = fRc and oSession.enableVirtEx(fHwVirt);
506 fRc = fRc and oSession.enableNestedPaging(fNestedPaging);
507 fRc = fRc and oSession.setCpuCount(cCpus);
508 fRc = fRc and oSession.saveSettings();
509 fRc = oSession.close() and fRc and True; # pychecker hack.
510 oSession = None;
511 else:
512 fRc = False;
513
514 # Start up.
515 if fRc is True:
516 self.logVmInfo(oVM);
517 oSession, oTxsSession = self.startVmAndConnectToTxsViaTcp(sVmName, fCdWait = False, fNatForwardingForTxs = True);
518 if oSession is not None:
519 self.addTask(oSession);
520
521 # Fudge factor - Allow the guest to finish starting up.
522 self.sleep(5);
523
524 self.test1RunTestProgs(oSession, oTxsSession, fRc, 'Disk benchmark');
525
526 # cleanup.
527 self.removeTask(oTxsSession);
528 self.terminateVmBySession(oSession)
529
530 # Remove disk
531 oSession = self.openSession(oVM);
532 if oSession is not None:
533 try:
534 oSession.o.machine.detachDevice(_ControllerTypeToName(eStorageController), 1, 0);
535
536 # Remove storage controller if it is not an IDE controller.
537 if eStorageController is not vboxcon.StorageControllerType_PIIX3 \
538 and eStorageController is not vboxcon.StorageControllerType_PIIX4:
539 oSession.o.machine.removeStorageController(_ControllerTypeToName(eStorageController));
540
541 oSession.saveSettings();
542 self.oVBox.deleteHdByLocation(sDiskPath);
543 oSession.saveSettings();
544 oSession.close();
545 oSession = None;
546 except:
547 reporter.errorXcpt('failed to detach/delete disk %s from storage controller' % (sDiskPath));
548 else:
549 fRc = False;
550 else:
551 fRc = False;
552 return fRc;
553
554 def test1OneVM(self, sVmName):
555 """
556 Runs one VM thru the various configurations.
557 """
558 reporter.testStart(sVmName);
559 fRc = True;
560 for sStorageCtrl in self.asStorageCtrls:
561 reporter.testStart(sStorageCtrl);
562
563 if sStorageCtrl == 'AHCI':
564 eStorageCtrl = vboxcon.StorageControllerType_IntelAhci;
565 elif sStorageCtrl == 'IDE':
566 eStorageCtrl = vboxcon.StorageControllerType_PIIX4;
567 elif sStorageCtrl == 'LsiLogicSAS':
568 eStorageCtrl = vboxcon.StorageControllerType_LsiLogicSas;
569 elif sStorageCtrl == 'LsiLogic':
570 eStorageCtrl = vboxcon.StorageControllerType_LsiLogic;
571 elif sStorageCtrl == 'BusLogic':
572 eStorageCtrl = vboxcon.StorageControllerType_BusLogic;
573 else:
574 eStorageCtrl = None;
575
576 for sDiskFormat in self.asDiskFormats:
577 reporter.testStart('%s' % (sDiskFormat));
578
579 if sDiskFormat == "iSCSI":
580 asPaths = self.asIscsiTargets;
581 else:
582 asPaths = self.asDirs;
583
584 for sDir in asPaths:
585 reporter.testStart('%s' % (sDir));
586
587 if sDiskFormat == "iSCSI":
588 sPath = sDir;
589 else:
590 sPath = sDir + "/test.disk";
591
592 for cCpus in self.acCpus:
593 if cCpus == 1: reporter.testStart('1 cpu');
594 else: reporter.testStart('%u cpus' % (cCpus));
595
596 for sVirtMode in self.asVirtModes:
597 if sVirtMode == 'raw' and cCpus > 1:
598 continue;
599 hsVirtModeDesc = {};
600 hsVirtModeDesc['raw'] = 'Raw-mode';
601 hsVirtModeDesc['hwvirt'] = 'HwVirt';
602 hsVirtModeDesc['hwvirt-np'] = 'NestedPaging';
603 reporter.testStart(hsVirtModeDesc[sVirtMode]);
604
605 fHwVirt = sVirtMode != 'raw';
606 fNestedPaging = sVirtMode == 'hwvirt-np';
607 fRc = self.test1OneCfg(sVmName, eStorageCtrl, sDiskFormat, sPath, \
608 cCpus, fHwVirt, fNestedPaging) and fRc and True; # pychecker hack.
609 reporter.testDone();
610
611 reporter.testDone();
612 reporter.testDone();
613 reporter.testDone();
614 reporter.testDone();
615 reporter.testDone();
616 return fRc;
617
618 def test1(self):
619 """
620 Executes test #1.
621 """
622
623 # Loop thru the test VMs.
624 for sVM in self.asTestVMs:
625 # run test on the VM.
626 if not self.test1OneVM(sVM):
627 fRc = False;
628 else:
629 fRc = True;
630
631 return fRc;
632
633
634
635if __name__ == '__main__':
636 sys.exit(tdStorageBenchmark().main(sys.argv));
637
注意: 瀏覽 TracBrowser 來幫助您使用儲存庫瀏覽器

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette