Skip to content

Commit 3f7915e

Browse files
authored
Merge pull request #48 from redhat-performance/add_validation
Add data validation, fix test_tools
2 parents 1183d61 + 3e2e61b commit 3f7915e

2 files changed

Lines changed: 55 additions & 13 deletions

File tree

passmark/passmark_run

Lines changed: 17 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,12 @@
2121
# This script automates the execution of coremark. It will determine the
2222
# set of default run parameters based on the system configuration.
2323
#
24+
script_dir=$(realpath $(dirname $0))
2425
test_name="passmark"
2526
passmark_version="v1.0"
2627
curdir=`pwd`
27-
script_dir=$(dirname $(realpath $0))
2828
copy_dirs=""
29+
rtc=0
2930

3031
if [ ! -f "/tmp/${test_name}.out" ]; then
3132
command="${0} $@"
@@ -67,8 +68,6 @@ arch=`uname -m`
6768

6869
show_usage=0
6970

70-
# Gather hardware information
71-
$curdir/test_tools/gather_data ${curdir}
7271

7372
exit_out()
7473
{
@@ -111,7 +110,7 @@ usage()
111110
echo "$1 Usage:"
112111
echo " --cpu_add n: add n cpus each iteration until hit max cpus"
113112
echo " --powers_2: starting from 1 cpu, keep doubling the cpus until max cpus"
114-
source ${curdir}/test_tools/general_setup --usage
113+
source ${TOOLS_BIN}/general_setup --usage
115114
exit 1
116115
}
117116

@@ -143,9 +142,9 @@ produce_report()
143142
echo Ran > test_results_report
144143

145144
located=0
146-
[ -f results.csv ] && rm results.csv
145+
[ -f results_passmark.csv ] && rm results_passmark.csv
147146

148-
$TOOLS_BIN/test_header_info --front_matter --results_file results.csv --host $to_configuration --sys_type $to_sys_type --tuned $to_tuned_setting --results_version $passmark_version --test_name $test_name --field_header "Testname,Operations"
147+
$TOOLS_BIN/test_header_info --front_matter --results_file results_passmark.csv --host $to_configuration --sys_type $to_sys_type --tuned $to_tuned_setting --results_version $passmark_version --test_name $test_name --field_header "Testname,Operations"
149148

150149
while IFS= read -r line
151150
do
@@ -169,7 +168,7 @@ produce_report()
169168
ltest_name=`echo $line | cut -d':' -f1`
170169
results=`echo $line | cut -d' ' -f2`
171170
data_string=$(build_data_string "${ltest_name}" "${results}" "${start_time}" "${end_time}")
172-
echo "${data_string}" >> results.csv
171+
echo "${data_string}" >> results_passmark.csv
173172
done < "$summary_file"
174173
fi
175174
echo Checksum: Not applicable for summary file >> $summary_file
@@ -207,8 +206,10 @@ install_tools()
207206
# Check to see if the test tools directory exists. If it does, we do not need to
208207
# clone the repo.
209208
#
210-
if [ ! -d "test_tools" ]; then
211-
git clone $tools_git test_tools
209+
TOOLS_BIN=${HOME}/test_tools
210+
export TOOLS_BIN
211+
if [ ! -d "${TOOLS_BIN}" ]; then
212+
git clone $tools_git ${TOOLS_BIN}
212213
if [ $? -ne 0 ]; then
213214
exit_out "pulling git $tools_git failed." 1
214215
fi
@@ -344,12 +345,15 @@ run_passmark()
344345
if [[ -n "$copy_dirs" ]]; then
345346
copy_dirs="--copy_dir $copy_dirs"
346347
fi
347-
348-
${curdir}/test_tools/save_results --curdir $curdir --home_root $to_home_root --results results.csv --test_name $test_name --tuned_setting=$to_tuned_setting --version NONE --user $to_user --other_files "passmark.summary,results_all_*,${test_name}_${iter}.out,test_results_report" $copy_dirs
348+
${TOOLS_BIN}/csv_to_json $to_json_flags --csv_file results_passmark.csv --output_file results_passmark.json
349+
${TOOLS_BIN}/verify_results $to_verify_flags --schema_file $script_dir/results_schema.py --class_name Passmark_Results --file results_passmark.json
350+
rtc=$?
351+
${TOOLS_BIN}/save_results --curdir $curdir --home_root $to_home_root --results results_passmark.csv --test_name $test_name --tuned_setting=$to_tuned_setting --version NONE --user $to_user --other_files "passmark.summary,results_all_*,${test_name}_${iter}.out,test_results_report" $copy_dirs
349352
popd > /dev/null
350353
}
351354

352355
install_tools "$@"
356+
$TOOLS_BIN/gather_data ${curdir}
353357

354358
#
355359
# Variables set by general setup.
@@ -364,7 +368,7 @@ install_tools "$@"
364368
# to_tuned_setting: tuned setting
365369
#
366370

367-
source ${curdir}/test_tools/general_setup "$@"
371+
source ${TOOLS_BIN}/general_setup "$@"
368372
if [[ $to_use_pcp -eq 1 ]]; then
369373
source $TOOLS_BIN/pcp/pcp_commands.inc
370374
fi
@@ -427,4 +431,4 @@ fi
427431
$TOOLS_BIN/package_tool --no_packages $to_no_pkg_install --wrapper_config $script_dir/../passmark.json
428432

429433
run_passmark
430-
exit 0
434+
exit $rtc

passmark/results_schema.py

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
import pydantic
2+
import datetime
3+
4+
from enum import Enum
5+
6+
class testname(Enum):
7+
CPU_INTEGER_MATH = "CPU_INTEGER_MATH"
8+
CPU_FLOATINGPOINT_MATH = "CPU_FLOATINGPOINT_MATH"
9+
CPU_PRIME = "CPU_PRIME"
10+
CPU_SORTING = "CPU_SORTING"
11+
CPU_ENCRYPTION = "CPU_ENCRYPTION"
12+
CPU_COMPRESSION = "CPU_COMPRESSION"
13+
CPU_SINGLETHREAD = "CPU_SINGLETHREAD"
14+
CPU_PHYSICS = "CPU_PHYSICS"
15+
CPU_MATRIX_MULT_SSE = "CPU_MATRIX_MULT_SSE"
16+
CPU_mm = "CPU_mm"
17+
CPU_sse = "CPU_sse"
18+
CPU_fma = "CPU_fma"
19+
CPU_avx = "CPU_avx"
20+
CPU_avx512 = "CPU_avx512"
21+
m_CPU_enc_SHA = "m_CPU_enc_SHA"
22+
m_CPU_enc_AES = "m_CPU_enc_AES"
23+
m_CPU_enc_ECDSA = "m_CPU_enc_ECDSA"
24+
ME_ALLOC_S = "ME_ALLOC_S"
25+
ME_READ_S = "ME_READ_S"
26+
ME_READ_L = "ME_READ_L"
27+
ME_WRITE = "ME_WRITE"
28+
ME_LARGE = "ME_LARGE"
29+
ME_LATENCY = "ME_LATENCY"
30+
ME_THREADED = "ME_THREADED"
31+
SUMM_CPU = "SUMM_CPU"
32+
SUMM_ME = "SUMM_ME"
33+
34+
class Passmark_Results(pydantic.BaseModel):
35+
Testname: testname
36+
Operations: float = pydantic.Field(gt=0, allow_inf_nan=False)
37+
Start_Date: datetime.datetime
38+
End_Date: datetime.datetime

0 commit comments

Comments
 (0)