[Fuego] [PATCH 1/4] linaro: localhost does not require ssh

Daniel Sangorrin <[email protected]> Fri, 20 Aug 2021 15:20:07 +0900
Newsgroups dev.linux.lists.fuego
Message-ID <af01dd89b9a80ba14be37707f76ca46b8e43e152.1629440060.git.daniel.sangorrin@toshiba.co.jp>
From: Nguyen Dat Tho <[email protected]>

When running the test on localhost ssh is not required

Signed-off-by: Nguyen Dat Tho <[email protected]>
Signed-off-by: Daniel Sangorrin <[email protected]>
---
 tests/Functional.linaro/fuego_test.sh | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)

diff --git a/tests/Functional.linaro/fuego_test.sh b/tests/Functional.linaro/fuego_test.sh
index 86d3c43..677ab49 100755
--- a/tests/Functional.linaro/fuego_test.sh
+++ b/tests/Functional.linaro/fuego_test.sh
@@ -19,7 +19,10 @@ function test_pre_check {
     # vi ~/.ssh/config
     #  Host 192.167.1.99 <- replace with your boards ip address ($IPADDR)
     #    IdentityFile ~/.ssh/bbb_id_rsa
-    assert_define SSH_KEY "Please setup SSH_KEY on your board file (fuego-ro/boards/$NODE_NAME.board)"
+    # [Note] when running on localhost SSH_KEY is not required
+    if [ $IPADDR != "127.0.0.1" ]; then
+        assert_define SSH_KEY "Please setup SSH_KEY on your board file (fuego-ro/boards/$NODE_NAME.board)"
+    fi
 }
 
 function test_build {
@@ -57,7 +60,12 @@ function test_run {
         SKIPFLAG=""
     fi
 
-    test-runner -o ${LOGDIR} $test_or_plan_flag ${REPO_PATH}/$yaml_file $PARAMS -g $LOGIN@$IPADDR $SKIPFLAG -e
+    # SSH is not required when running on localhost
+    if [ $IPADDR != "127.0.0.1" ]; then
+        test-runner -o ${LOGDIR} $test_or_plan_flag ${REPO_PATH}/$yaml_file $PARAMS -g $LOGIN@$IPADDR $SKIPFLAG -e
+    else
+        test-runner -o ${LOGDIR} $test_or_plan_flag ${REPO_PATH}/$yaml_file $PARAMS $SKIPFLAG -e
+    fi
 }
 
 # FIXTHIS: the log directory is populated with a copy of the whole repository, clean unnecessary files
-- 
2.17.1