X-Git-Url: https://git.whamcloud.com/?a=blobdiff_plain;f=lustre%2Ftests%2Ffunctions.sh;h=23ff2a435a67215bde59166c0a1e2051421df340;hb=b498499104af17da081f1c22b9c07951104846a3;hp=a3a70e0c3638cc0a7a16bd5192c4916961543a1d;hpb=39b944ec54655bb70bcb79fe8223c724f7d08dbf;p=fs%2Flustre-release.git diff --git a/lustre/tests/functions.sh b/lustre/tests/functions.sh index a3a70e0..23ff2a4 100644 --- a/lustre/tests/functions.sh +++ b/lustre/tests/functions.sh @@ -254,6 +254,19 @@ short_hostname() { echo $(sed 's/\..*//' <<< $1) } +### +# short_nodename +# +# Find remote nodename, stripped of any domain, etc. +# 'hostname -s' is easy, but not implemented on all systems +short_nodename() { + local rname=$(do_node $1 "uname -n" || echo -1) + if [[ "$rname" = "-1" ]]; then + rname=$1 + fi + echo $(short_hostname $rname) +} + print_opts () { local var @@ -267,10 +280,9 @@ print_opts () { } run_compilebench() { - -# Space estimation: -# compile dir kernel-1 680MB -# required space 680MB * cbench_IDIRS = ~1.4 Gb + # Space estimation: + # compile dir kernel-0 ~1GB + # required space ~1GB * cbench_IDIRS cbench_DIR=${cbench_DIR:-""} cbench_IDIRS=${cbench_IDIRS:-2} @@ -284,14 +296,16 @@ run_compilebench() { [ -e $cbench_DIR/compilebench ] || \ { skip_env "No compilebench build" && return; } - local space=$(df -P $DIR | tail -n 1 | awk '{ print $4 }') - if [ $space -le $((680 * 1024 * cbench_IDIRS)) ]; then - cbench_IDIRS=$(( space / 680 / 1024)) - [ $cbench_IDIRS = 0 ] && \ - skip_env "Need free space atleast 680 Mb, have $space" && return + local space=$(lfs_df $DIR | awk '/^filesystem/{ print $4 }') + if [[ $space -le $((1024 * 1024 * cbench_IDIRS)) ]]; then + cbench_IDIRS=$((space / 1024 / 1024)) + [[ $cbench_IDIRS -eq 0 ]] && + skip_env "Need free space at least 1GB, have $space" && + return + + echo "free space=$space, reducing initial dirs to $cbench_IDIRS" + fi - log free space=$space, reducing initial dirs to $cbench_IDIRS - fi # FIXME: # t-f _base needs to be modifyed to set properly tdir # for new "test_foo" functions names