@@ -24,6 +24,8 @@ test_name="fio"
2424arguments=" $@ "
2525disk_options=" "
2626curdir=` pwd`
27+ header_txt=" op,blocksize_KiB,njobs,ndisks,iodepth,bw_KiB_s,iops,clat_us,lat_us,slat_us,Start_Date,End_Date"
28+ script_dir=$( realpath $( dirname $0 ) )
2729
2830#
2931# Check to see if the test tools directory exists. If it does, we do not need to
@@ -37,7 +39,7 @@ if [ ! -d "${TOOLS_BIN}" ]; then
3739 git clone $tools_git $TOOLS_BIN
3840 if [ $? -ne 0 ]; then
3941 echo " pulling git $tools_git failed."
40- exit $E_GENERAL
42+ exit 101
4143 fi
4244fi
4345
@@ -319,7 +321,7 @@ reduce_data()
319321 # Now sort the results csv files and place headers
320322 #
321323 $TOOLS_BIN /test_header_info --test_name ${test_name} --info_in_dir_name " $file 2,3 4,5,6 9,10" --results_file ${working_dir} /results_fio.csv
322- echo " op:blocksize_KiB:njobs:ndisks:iodepth:bw_KiB_s:iops:clat_us:lat_us:slat_us " >> ${working_dir} /results_fio.csv
324+ echo $header_txt >> ${working_dir} /results_fio.csv
323325 for list in ` ls -d results_* ` ; do
324326 pushd $list > /dev/null
325327 op_and_size=` echo $list | cut -d' _' -f 2`
@@ -400,6 +402,23 @@ reduce_io_data()
400402 popd
401403 done
402404 done
405+ #
406+ # Validate data
407+ #
408+ tmp_file=$( mktemp /tmp/fio_results.XXXXX)
409+ echo $header_txt > $tmp_file
410+ grep -v " ^#" $working_dir /results_fio.csv | grep -v " ^op" >> $tmp_file
411+ ${TOOLS_BIN} /csv_to_json $to_json_flags --csv_file $tmp_file --output_file results_fio.json
412+ rtc=$?
413+ if [[ $rtc -ne 0 ]]; then
414+ exit out " Error: csv_to_json failed" $rtc
415+ fi
416+ ${TOOLS_BIN} /verify_results $to_verify_flags --schema_file $script_dir /results_fio_schema.py --class_name Fio_Results --file results_fio.json
417+
418+ rtc=$?
419+ if [[ $rtc -ne 0 ]]; then
420+ exit_out " Error: fio data verification failed" $rtc
421+ fi
403422}
404423
405424# Create the required file systems.
@@ -1224,6 +1243,7 @@ if [[ $to_use_pcp -eq 1 ]]; then
12241243 shutdown_pcp
12251244fi
12261245
1246+
12271247if [ $file_count -ne 0 ]; then
12281248 if [ $lvm_disk -eq 1 ]; then
12291249 $TOOLS_BIN /lvm_delete --lvm_vol fio --lvm_grp fio --mount_pnt /perf1
0 commit comments