Tests: use configured processor count in getcpu override tests
authorJérémie Galarneau <jeremie.galarneau@efficios.com>
Fri, 12 Feb 2016 16:19:22 +0000 (11:19 -0500)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Fri, 12 Feb 2016 16:19:22 +0000 (11:19 -0500)
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
tests/regression/ust/getcpu-override/test_getcpu_override

index 081099e798d5a99fd816b094ba5e044c1bd94ef1..585f3b3a0c58d8593ed720b3dc5c99a5042791f3 100755 (executable)
@@ -46,7 +46,7 @@ SEQUENCE_SEED=(
 )
 
 # Equivalent to the syconf(_SC_NPROCESSORS_CONF) call.
-NPROC=`nproc --all`
+num_cpus=$(conf_proc_count)
 
 source $TESTDIR/utils/utils.sh
 
@@ -90,7 +90,7 @@ compare()
        ok $? "Sequence seed and cpuid sequence have the same size ${#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
@@ -107,7 +107,7 @@ compare()
                                echo -n "# array value is "
                                echo -n "${array_to_compare[$i]}"
                                echo -n " expected "
-                               echo "$(( ${SEQUENCE_SEED[$i]} % $NPROC))"
+                               echo "$(( ${SEQUENCE_SEED[$i]} % $num_cpus))"
                        done
                        diag "Dumping trace"
                        $BABELTRACE_BIN $TRACE_PATH | awk '{print "# " $0}'
This page took 0.034344 seconds and 4 git commands to generate.