test/vhost: keep fio config file name for log output
Copy fio config to guest VM with the same name instead of renaming to /root/fio.job. Use the same file name for creating log file in desired directory. Remove not needed ls command in common/run_fio while at it. Change-Id: I9e13d8cd6f7892a77d89afb99f7d57ef79f7b11f Signed-off-by: Karol Latecki <karol.latecki@intel.com> Reviewed-on: https://review.gerrithub.io/393469 Tested-by: SPDK Automated Test System <sys_sgsw@intel.com> Reviewed-by: Pawel Wodkowski <pawelx.wodkowski@intel.com> Reviewed-by: Jim Harris <james.r.harris@intel.com> Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com> Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
This commit is contained in:
parent
3166267411
commit
6d8dc5239e
@ -799,19 +799,20 @@ function run_fio()
|
|||||||
esac
|
esac
|
||||||
done
|
done
|
||||||
|
|
||||||
|
local job_fname=$(basename "$job_file")
|
||||||
|
|
||||||
# prepare job file for each VM
|
# prepare job file for each VM
|
||||||
for vm in ${vms[@]}; do
|
for vm in ${vms[@]}; do
|
||||||
local vm_num=${vm%%:*}
|
local vm_num=${vm%%:*}
|
||||||
local vmdisks=${vm#*:}
|
local vmdisks=${vm#*:}
|
||||||
|
|
||||||
sed "s@filename=@filename=$vmdisks@" $job_file | vm_ssh $vm_num 'cat > /root/fio.job'
|
sed "s@filename=@filename=$vmdisks@" $job_file | vm_ssh $vm_num "cat > /root/$job_fname"
|
||||||
fio_disks+="127.0.0.1:$(vm_fio_socket $vm_num):$vmdisks,"
|
fio_disks+="127.0.0.1:$(vm_fio_socket $vm_num):$vmdisks,"
|
||||||
|
|
||||||
vm_ssh $vm_num ls -al
|
vm_ssh $vm_num cat /root/$job_fname
|
||||||
vm_ssh $vm_num cat /root/fio.job
|
|
||||||
done
|
done
|
||||||
|
|
||||||
python $SPDK_BUILD_DIR/test/vhost/common/run_fio.py --job-file=/root/fio.job $fio_bin $out ${fio_disks%,}
|
python $SPDK_BUILD_DIR/test/vhost/common/run_fio.py --job-file=/root/$job_fname $fio_bin $out ${fio_disks%,}
|
||||||
}
|
}
|
||||||
|
|
||||||
# Shutdown or kill any running VM and SPDK APP.
|
# Shutdown or kill any running VM and SPDK APP.
|
||||||
|
@ -45,7 +45,7 @@ def save_file(path, mode, contents):
|
|||||||
|
|
||||||
def run_fio(vms, fio_cfg_fname, out_path, perf_vmex=False):
|
def run_fio(vms, fio_cfg_fname, out_path, perf_vmex=False):
|
||||||
global fio_bin
|
global fio_bin
|
||||||
fio_cfg_prefix = fio_cfg_fname.split(".")[0]
|
job_name = os.path.splitext(os.path.basename(fio_cfg_fname))[0]
|
||||||
|
|
||||||
# Build command for FIO
|
# Build command for FIO
|
||||||
fio_cmd = " ".join([fio_bin, "--eta=never"])
|
fio_cmd = " ".join([fio_bin, "--eta=never"])
|
||||||
@ -82,7 +82,7 @@ def run_fio(vms, fio_cfg_fname, out_path, perf_vmex=False):
|
|||||||
print("ERROR! While executing FIO jobs - RC: {rc}".format(rc=rc, out=out))
|
print("ERROR! While executing FIO jobs - RC: {rc}".format(rc=rc, out=out))
|
||||||
sys.exit(rc)
|
sys.exit(rc)
|
||||||
else:
|
else:
|
||||||
save_file(os.path.join(out_path, ".".join([fio_cfg_prefix, "log"])), "w", out)
|
save_file(os.path.join(out_path, ".".join([job_name, "log"])), "w", out)
|
||||||
|
|
||||||
if perf_vmex:
|
if perf_vmex:
|
||||||
# Stop gathering perf statistics and prepare some result files
|
# Stop gathering perf statistics and prepare some result files
|
||||||
@ -96,7 +96,7 @@ def run_fio(vms, fio_cfg_fname, out_path, perf_vmex=False):
|
|||||||
blocking=True)
|
blocking=True)
|
||||||
print("VMexit host stats:")
|
print("VMexit host stats:")
|
||||||
print("{perf_out}".format(perf_out=out))
|
print("{perf_out}".format(perf_out=out))
|
||||||
save_file(os.path.join(perf_dir, "vmexit_stats_" + fio_cfg_prefix),
|
save_file(os.path.join(perf_dir, "vmexit_stats_" + job_name),
|
||||||
"w", "{perf_out}".format(perf_out=out))
|
"w", "{perf_out}".format(perf_out=out))
|
||||||
try:
|
try:
|
||||||
os.remove(perf_rec_file)
|
os.remove(perf_rec_file)
|
||||||
|
Loading…
Reference in New Issue
Block a user