[PATCH 8/8] numactl/test - Make checkaffinity more robust

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



[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
--
To unsubscribe from this list: send the line "unsubscribe linux-numa" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux SCSI]     [Devices]

  Powered by Linux