From: Lee Schermerhorn <lee.schermerhorn@hp.com>
To: Cliff Wickman <cpi@sgi.com>
Cc: Kornilios Kourtis <kkourt@cslab.ece.ntua.gr>,
	Brice Goglin <Brice.Goglin@inria.fr>, <linux-numa@vger.kernel.org>,
	<eric.whitney@hp.com>
Date:	Tue, 28 Apr 2009 12:37:08 -0400
Subject: [PATCH 8/8] numactl/test - Make checkaffinity more robust

[PATCH 08/08] Make 'checkaffinity' test script more robust

Against:  numactl-2.0.3-rc2

Add quotes around operands in test expressions, lest empty strings
in the case of numactl failure result in shell errors, obscuring the
test error message.

 test/checkaffinity |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Index: numactl-dev/test/checkaffinity
===================================================================
--- numactl-dev.orig/test/checkaffinity
+++ numactl-dev/test/checkaffinity
@@ -9,11 +9,11 @@ numcpus=$(grep -c processor /proc/cpuinf
 numnodes=$(ls -1d /sys/devices/system/node/node[0-9]* | wc -l )
 
 for i in $(seq 0 $[$numcpus - 1]) ; do
-    if [ $(numactl --physcpubind=$i ./printcpu) != $i ] ; then
+    if [ "$(numactl --physcpubind=$i ./printcpu)" != "$i" ] ; then
        echo "--physcpubind for $i doesn't work"
        exit 1
     fi
-    if [ $(numactl --physcpubind=$i numactl --show | awk '/^physcpubind/ { print $2 }' ) != $i ] ; then
+    if [ "$(numactl --physcpubind=$i numactl --show | awk '/^physcpubind/ { print $2 }' )" != "$i" ] ; then
 	echo "--show doesn't agree with physcpubind for cpu $i"
 	exit 1
     fi
