diff mbox series

[1/5] tests: Fix the condition to check if bmc is up

Message ID 20181108041311.182694-2-amitay@ozlabs.org
State Superseded
Headers show
Series Test framework improvements | expand

Checks

Context Check Description
snowpatch_ozlabs/apply_patch success master/apply_patch Successfully applied
snowpatch_ozlabs/build-multiarch success Test build-multiarch on branch master

Commit Message

Amitay Isaacs Nov. 8, 2018, 4:13 a.m. UTC
Signed-off-by: Amitay Isaacs <amitay@ozlabs.org>
---
 tests/test_hw_bmc.sh | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

Comments

Alistair Popple Nov. 9, 2018, 2:21 a.m. UTC | #1
Worked for me when I tested it.

Reviewed-by: Alistair Popple <alistair@popple.id.au>

On Thursday, 8 November 2018 3:13:07 PM AEDT Amitay Isaacs wrote:
> Signed-off-by: Amitay Isaacs <amitay@ozlabs.org>
> ---
>  tests/test_hw_bmc.sh | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/tests/test_hw_bmc.sh b/tests/test_hw_bmc.sh
> index 7054181..c65a630 100755
> --- a/tests/test_hw_bmc.sh
> +++ b/tests/test_hw_bmc.sh
> @@ -62,15 +62,17 @@ do_skip ()
>      fi
>  }
> 
> +
>  echo -n "Checking if the host is up... "
>  output=$(test_wrapper /usr/sbin/obmcutil state | grep CurrentHostState)
>  rc=$?
>  if [ $rc -ne 0 ] || \
> -    [ "$output" != "xyz.openbmc_project.State.Host.HostState.Running" ] ;
> then +    [ "$output" = "CurrentHostState    :
> xyz.openbmc_project.State.Host.HostState.Running" ] ; then echo "yes"
>  	hw_state=1
>  else
>  	echo "no"
> +	echo "$output"
>  fi
> 
>  result_filter ()
diff mbox series

Patch

diff --git a/tests/test_hw_bmc.sh b/tests/test_hw_bmc.sh
index 7054181..c65a630 100755
--- a/tests/test_hw_bmc.sh
+++ b/tests/test_hw_bmc.sh
@@ -62,15 +62,17 @@  do_skip ()
     fi
 }
 
+
 echo -n "Checking if the host is up... "
 output=$(test_wrapper /usr/sbin/obmcutil state | grep CurrentHostState)
 rc=$?
 if [ $rc -ne 0 ] || \
-    [ "$output" != "xyz.openbmc_project.State.Host.HostState.Running" ] ; then
+    [ "$output" = "CurrentHostState    : xyz.openbmc_project.State.Host.HostState.Running" ] ; then
 	echo "yes"
 	hw_state=1
 else
 	echo "no"
+	echo "$output"
 fi
 
 result_filter ()