Whamcloud - gitweb
LU-958 tests: debug_mb set incorrectly for smp or vm
[fs/lustre-release.git] / lustre / tests / test-framework.sh
index 4c52a29..640e737 100644 (file)
@@ -256,6 +256,13 @@ init_test_env() {
     rm -f $TMP/*active
 }
 
+kernel_version() {
+    echo -n $((($1 << 16) | ($2 << 8) | $3))
+}
+
+export LINUX_VERSION=$(uname -r | sed -e "s/[-.]/ /3" -e "s/ .*//")
+export LINUX_VERSION_CODE=$(kernel_version ${LINUX_VERSION//\./ })
+
 case `uname -r` in
 2.4.*) EXT=".o"; USE_QUOTA=no; [ ! "$CLIENTONLY" ] && FSTYPE=ext3;;
     *) EXT=".ko"; USE_QUOTA=yes;;
@@ -584,7 +591,7 @@ ostdevlabel() {
 
 set_debug_size () {
     local dz=${1:-$DEBUG_SIZE}
-    local cpus=$(getconf _NPROCESSORS_CONF)
+    local cpus=$(($(cut -d "-" -f 2 /sys/devices/system/cpu/possible)+1))
 
     # bug 19944, adjust size to be -gt num_possible_cpus()
     # promise 2MB for every cpu at least
@@ -3439,6 +3446,11 @@ index_from_ostuuid()
     $LFS osts $2 | sed -ne "/${1}/s/\(.*\): .* .*$/\1/p"
 }
 
+mdtuuid_from_index()
+{
+    $LFS mdts $2 | awk '/^'$1'/ { print $2 }'
+}
+
 remote_node () {
     local node=$1
     [ "$node" != "$(hostname)" ]