Tests fix: source utils.sh before using conf_proc_count
[lttng-tools.git] / tests / regression / ust / getcpu-override / test_getcpu_override
index 2492c9c1133eb7b3bd170afd15b9e36d584676cc..1aa50ad97afb9ad16628b81f0ecc84ae26975715 100755 (executable)
@@ -44,11 +44,11 @@ SEQUENCE_SEED=(
 89 13 63 6 136 153 23 16 47 130 75 62
 )
 
-# Equivalent to the syconf(_SC_NPROCESSORS_CONF) call.
-NPROC=`nproc --all`
-
 source $TESTDIR/utils/utils.sh
 
+# Equivalent to the syconf(_SC_NPROCESSORS_CONF) call.
+num_cpus=$(conf_proc_count)
+
 if [ ! -x "$CURDIR/.libs/lttng-ust-getcpu-override-test.so" ]; then
        BAIL_OUT "No shared object generated"
 fi
@@ -89,7 +89,7 @@ compare()
        ok $? "Sequence seed and cpuid sequence are equal ${#SEQUENCE_SEED[*]}/${#array_to_compare[*]}"
 
        for (( i = 0; i < ${#SEQUENCE_SEED[*]}; i++ )); do
-               if [ "${array_to_compare[$i]}" -ne "$(( ${SEQUENCE_SEED[$i]} % $NPROC))" ]; then
+               if [ "${array_to_compare[$i]}" -ne "$(( ${SEQUENCE_SEED[$i]} % $num_cpus))" ]; then
                        valid=1
                        break
                fi
This page took 0.023777 seconds and 4 git commands to generate.