Skip to content

Commit

Permalink
test: fix the bind_range test
Browse files Browse the repository at this point in the history
Make the test script executable in the repo (and remove the chmod 755 at
test run time), set $PATH and $LD_LIBRARY_PATH correctly to use the
numactl and libnuma.so from the build tree.

Tested:
- Running "make regress2" passed.

Signed-off-by: Filipe Brandenburger <[email protected]>
  • Loading branch information
filbranden committed Aug 5, 2014
1 parent 06131f4 commit 965cddd
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
15 changes: 9 additions & 6 deletions test/bind_range
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@

# NOTE: Test needs two nodes and two cpus at least

BASE=`pwd`/..
export LD_LIBRARY_PATH=$BASE
export PATH=$BASE:$PATH

export old_mask

Expand All @@ -22,11 +25,11 @@ eval_test() {

function check_arg_order
{
../numactl --all --physcpubind=$HIGHESTCPU ls > /dev/null 2>&1
numactl --all --physcpubind=$HIGHESTCPU ls > /dev/null 2>&1
if [ $? == 1 ] ; then
return 1;
fi
../numactl --physcpubind=$HIGHESTCPU --all ls > /dev/null 2>&1
numactl --physcpubind=$HIGHESTCPU --all ls > /dev/null 2>&1
if [ $? == 0 ] ; then
return 1;
fi
Expand All @@ -38,11 +41,11 @@ function check_physcpubind
{
reset_mask
set_cpu_affinity 0
../numactl --physcpubind=$HIGHESTCPU ls > /dev/null 2>&1
numactl --physcpubind=$HIGHESTCPU ls > /dev/null 2>&1
if [ $? == 0 ] ; then # shouldn't pass so easy
return 1;
fi
../numactl --all --physcpubind=$HIGHESTCPU ls > /dev/null 2>&1
numactl --all --physcpubind=$HIGHESTCPU ls > /dev/null 2>&1
if [ $? == 1 ] ; then # shouldn't fail
return 1;
fi
Expand All @@ -58,11 +61,11 @@ function check_cpunodebind
reset_mask
low_cpu_range=$(cat /sys/devices/system/node/node$LOWESTNODE/cpulist)
set_cpu_affinity $low_cpu_range
../numactl --cpunodebind=$HIGHESTNODE ls > /dev/null 2>&1
numactl --cpunodebind=$HIGHESTNODE ls > /dev/null 2>&1
if [ $? == 1 ] ; then # should pass
return 1;
fi
../numactl --all --cpunodebind=$HIGHESTNODE ls > /dev/null 2>&1
numactl --all --cpunodebind=$HIGHESTNODE ls > /dev/null 2>&1
if [ $? == 1 ] ; then # should pass for sure
return 1;
fi
Expand Down
3 changes: 0 additions & 3 deletions test/regress2
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,6 @@ T() {
echo
}

# various tests
chmod 755 bind_range

# still broken
#T ./prefered
T ./distance
Expand Down

0 comments on commit 965cddd

Please sign in to comment.