diff --git a/test/vhost/common/common.sh b/test/vhost/common/common.sh index 3c88c59c1..09642684e 100644 --- a/test/vhost/common/common.sh +++ b/test/vhost/common/common.sh @@ -799,19 +799,20 @@ function run_fio() esac done + local job_fname=$(basename "$job_file") + # prepare job file for each VM for vm in ${vms[@]}; do local vm_num=${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," - vm_ssh $vm_num ls -al - vm_ssh $vm_num cat /root/fio.job + vm_ssh $vm_num cat /root/$job_fname 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. diff --git a/test/vhost/common/run_fio.py b/test/vhost/common/run_fio.py index 7f4ef2c10..959369a8e 100755 --- a/test/vhost/common/run_fio.py +++ b/test/vhost/common/run_fio.py @@ -45,7 +45,7 @@ def save_file(path, mode, contents): def run_fio(vms, fio_cfg_fname, out_path, perf_vmex=False): 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 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)) sys.exit(rc) 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: # 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) print("VMexit host stats:") 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)) try: os.remove(perf_rec_file)