diff --git a/scripts/tests/test_all.sh b/scripts/tests/test_all.sh new file mode 100755 index 0000000..f14bb5c --- /dev/null +++ b/scripts/tests/test_all.sh @@ -0,0 +1,12 @@ +#!/usr/bin/env bash + +if [ -z $1 ]; then + procs=1 +else + procs=$1 +fi + +. test_cpu.sh +. test_threads.sh +. test_mem.sh +. test_fileio.sh diff --git a/scripts/tests/test_cpu.sh b/scripts/tests/test_cpu.sh new file mode 100755 index 0000000..19bac5b --- /dev/null +++ b/scripts/tests/test_cpu.sh @@ -0,0 +1,13 @@ +#!/usr/bin/env bash + +if [ -z $1 ]; then + procs=1 +else + procs=$1 +fi + +bench_exec="sysbench" +bench_var="--num-threads=$procs" +bench="$bench_exec $benc_var" + +$bench --test=cpu --cpu-max-prime=20000 run diff --git a/scripts/tests/test_fileio.sh b/scripts/tests/test_fileio.sh new file mode 100755 index 0000000..f1515c6 --- /dev/null +++ b/scripts/tests/test_fileio.sh @@ -0,0 +1,19 @@ +#!/usr/bin/env bash + +if [ -z $1 ]; then + procs=1 +else + procs=$1 +fi + +bench_exec="sysbench" +bench_var="--num-threads=$procs" +bench="$bench_exec $benc_var" + +$bench --test=fileio --file-test-mode=seqwr run +free && sync && sudo sh -c 'echo 3 > /proc/sys/vm/drop_caches' && free +$bench --test=fileio --file-test-mode=seqrd run +rm -f test_file.* +#$bench --test=fileio --file-test-mode=rndwr run +#$bench --test=fileio --file-test-mode=rndrd run +#rm -f test_file.* diff --git a/scripts/tests/test_mem.sh b/scripts/tests/test_mem.sh new file mode 100755 index 0000000..51013c0 --- /dev/null +++ b/scripts/tests/test_mem.sh @@ -0,0 +1,13 @@ +#!/usr/bin/env bash + +if [ -z $1 ]; then + procs=1 +else + procs=$1 +fi + +bench_exec="sysbench" +bench_var="--num-threads=$procs" +bench="$bench_exec $benc_var" + +$bench --test=mem run diff --git a/scripts/tests/test_threads.sh b/scripts/tests/test_threads.sh new file mode 100755 index 0000000..898bc3a --- /dev/null +++ b/scripts/tests/test_threads.sh @@ -0,0 +1,13 @@ +#!/usr/bin/env bash + +if [ -z $1 ]; then + procs=1 +else + procs=$1 +fi + +bench_exec="sysbench" +bench_var="--num-threads=$procs" +bench="$bench_exec $benc_var" + +$bench --test=threads run