SPEC-2996: Fix ip check 82/23082/1
authorCorentin LABBE <clabbe@baylibre.com>
Thu, 28 Nov 2019 09:05:10 +0000 (10:05 +0100)
committerCorentin LABBE <clabbe@baylibre.com>
Thu, 28 Nov 2019 09:07:44 +0000 (10:07 +0100)
BusyBox ip print its version stderr, so we need to redirect it to stdin.
Furthermore, using set -x reset the error code, we need to store it before.

Bug-AGL: SPEC-2996
Change-Id: I4b80475b0f9291fc55e661362a981ac14dbdb9b0
Signed-off-by: Corentin LABBE <clabbe@baylibre.com>
common/scripts/test_can_loopback_mode.sh
common/scripts/test_can_modules.sh

index 4f4ae76..96b1091 100755 (executable)
@@ -15,9 +15,10 @@ fi
 
 sleep 2
 set -x
-ip -V | grep -q -i BusyBox
+ip -V 2>&1 | grep -q -i BusyBox
+RET=$?
 set +x
-if [ $? -eq 0 ];then
+if [ $RET -eq 0 ];then
        echo "WARN: busybox ip is not handled"
        # busybox ip does not handle bitrate option
        skip_tests
index 9a5a6bd..3b317af 100755 (executable)
@@ -50,7 +50,7 @@ remove_module c_can
 
 remove_module can_dev unload_can_dev_module
 
-ip -V | grep -q -i BusyBox
+ip -V 2>&1 | grep -q -i BusyBox
 if [ $? -eq 0 ];then
        lava-test-case canconfig_can0 --result skip
 else
@@ -76,7 +76,7 @@ modprobe_module can_dev
 #starting the config step.
 ip link set can0 down
 
-ip -V | grep -q -i BusyBox
+ip -V 2>&1 | grep -q -i BusyBox
 if [ $? -eq 0 ];then
        lava-test-case canconfig_can0 --result skip
 else