- accum = []
- suitenum = 0
- for suite in reads:
- jobnum = 0
- for job in suite:
- parameters = [ "--name=job{0}".format(jobnum),
- "--thread",
- "--filename={0}".format(args.read),
- "--rw=randrw", "--rwmixread=100", "--stonewall",
- "--group_reporting", "--numjobs={0}".format(job['numjobs']),
- "--time_based", "--runtime={0}".format(job['timeout']) ]
- if job['s']:
- if job['iops']:
- ss = 'iops'
- else:
- ss = 'bw'
- if job['slope']:
- ss += "_slope"
- ss += ":" + str(job['ss_limit'])
- if job['pct']:
- ss += '%'
- parameters.extend([ '--ss_dur={0}'.format(job['ss_dur']),
- '--ss={0}'.format(ss),
- '--ss_ramp={0}'.format(job['ss_ramp']) ])
- accum.extend(parameters)
- jobnum += 1
-
- tf = tempfile.NamedTemporaryFile(delete=False)
- tf.close()
- output = subprocess.check_output([args.fio,
- "--output-format=json",
- "--output={0}".format(tf.name)] + accum)
- with open(tf.name, 'r') as source:
+ if args.read == None:
+ if os.name == 'posix':
+ args.read = '/dev/zero'
+ extra = [ "--size=134217728" ] # 128 MiB
+ else:
+ print "ERROR: file for read testing must be specified on non-posix systems"
+ sys.exit(1)
+ else:
+ extra = []
+
+ jobnum = 0
+ for job in reads:
+
+ tf = uuid.uuid4().hex
+ parameters = [ "--name=job{0}".format(jobnum) ]
+ parameters.extend(extra)
+ parameters.extend([ "--thread",
+ "--output-format=json",
+ "--output={0}".format(tf),
+ "--filename={0}".format(args.read),
+ "--rw=randrw",
+ "--rwmixread=100",
+ "--stonewall",
+ "--group_reporting",
+ "--numjobs={0}".format(job['numjobs']),
+ "--time_based",
+ "--runtime={0}".format(job['timeout']) ])
+ if job['s']:
+ if job['iops']:
+ ss = 'iops'
+ else:
+ ss = 'bw'
+ if job['slope']:
+ ss += "_slope"
+ ss += ":" + str(job['ss_limit'])
+ if job['pct']:
+ ss += '%'
+ parameters.extend([ '--ss_dur={0}'.format(job['ss_dur']),
+ '--ss={0}'.format(ss),
+ '--ss_ramp={0}'.format(job['ss_ramp']) ])
+
+ output = subprocess.call([args.fio] + parameters)
+ with open(tf, 'r') as source: