From mboxrd@z Thu Jan 1 00:00:00 1970 From: Lee Schermerhorn Subject: [PATCH 8/8] numactl/test - Make checkaffinity more robust Date: Tue, 28 Apr 2009 12:37:08 -0400 Message-ID: <20090428163708.24945.56292.sendpatchset@localhost.localdomain> References: <20090428163621.24945.95516.sendpatchset@localhost.localdomain> Return-path: In-Reply-To: <20090428163621.24945.95516.sendpatchset@localhost.localdomain> Sender: linux-numa-owner@vger.kernel.org List-ID: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: Cliff Wickman Cc: Kornilios Kourtis , Brice Goglin , linux-numa@vger.kernel.org, eric.whitney@hp.com [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-2.0.3-rc2/test/checkaffinity =================================================================== --- numactl-2.0.3-rc2.orig/test/checkaffinity 2009-02-13 11:17:57.000000000 -0500 +++ numactl-2.0.3-rc2/test/checkaffinity 2009-02-13 11:35:27.000000000 -0500 @@ -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