3 _root="$(dirname "${0}")"; . "${_root}/lib/sh/env.sh"
6 [ "$(hostname -s)" = "nabihinew" ] || wtf "Run this on nabihinew only!"
12 # Environment and needed stuff
13 tests="${_root}/tests"
17 [ -d "${logs}" ] || mkdir -p "${logs}"
18 run_log="${logs}/bench-$(date +%Y-%m-%d_%H:%M:%S).log"
20 # Scratch directory maintenance
23 [ -d "${scratch}" ] || mkdir -p "${scratch}"
24 mount | grep -q ' on '"${scratch}"' ' && umount "${scratch}" || true
25 find "${scratch}" -uid "${bonnie_uid}" -xdev -delete
31 bonnie_opts="-q -d /bonnie -u ${bonnie_uid} -s 12288 -n 16:16384:0 -f 0"
32 bonnie_log="${logs}/bonnie-%s-$(date +%Y-%m-%d_%H:%M:%S).csv"
34 chown "${bonnie_uid}" "${scratch}"
35 /usr/local/sbin/bonnie++ ${bonnie_opts} -m "${test}" >> "$(printf "${bonnie_log}" "${test}")"
52 log "Considering tests: $(cd "${tests}"; echo *)" | tee -a "${run_log}"
53 ( cd "${tests}"; ls -1 ) | script -a "${run_log}" xargs -L1 "${0}"
56 testfile="${tests}/${test}"
57 [ -f "${testfile}" ] || wtf "Test '${test}' does not exist"
58 ( log "Preparing test: ${test}"
62 log "$(stopwatch run start)"
64 log "$(stopwatch run stop) Test result ${result}"