generic/574: fix sporadic failure with test_dummy_encryption
[xfstests-dev.git] / common / perf
1 #
2 # Common perf specific functions
3 #
4
5
6 _require_fio_results()
7 {
8         if [ -z "$PERF_CONFIGNAME" ]
9         then
10                 _notrun "this test requires \$PERF_CONFIGNAME to be set"
11         fi
12         _require_command $PYTHON2_PROG python2
13
14         $PYTHON2_PROG -c "import sqlite3" >/dev/null 2>&1
15         [ $? -ne 0 ] && _notrun "this test requires python sqlite support"
16
17         $PYTHON2_PROG -c "import json" >/dev/null 2>&1
18         [ $? -ne 0 ] && _notrun "this test requires python json support"
19
20         _require_command $SQLITE3_PROG sqlite3
21 }
22
23 _fio_results_init()
24 {
25         cat $here/src/perf/fio-results.sql | \
26                 $SQLITE3_PROG $RESULT_BASE/fio-results.db
27         [ $? -ne 0 ] && _fail "failed to create results database"
28         [ ! -e $RESULT_BASE/fio-results.db ] && \
29                 _fail "failed to create results database"
30 }
31
32 _fio_results_compare()
33 {
34         _testname=$1
35         _resultfile=$2
36
37         $PYTHON2_PROG $here/src/perf/fio-insert-and-compare.py \
38                 -c $PERF_CONFIGNAME -d $RESULT_BASE/fio-results.db \
39                 -n $_testname $_resultfile
40 }