From 7179733784f0a8eec2e47a21dd6f6a3e72b82507 Mon Sep 17 00:00:00 2001 From: Oren Vormaser Date: Sun, 26 Jul 2020 15:46:47 +0000 Subject: [PATCH] common: prplmesh_utils.sh: change prplmesh_utils.sh status output Currently prplmesh_utils.sh status output follows the follwing format: operational test failed! bml_connect: return value is: BML_RET_OK, Success status OK Main radio agent operational bml_device_oper_radios_query: return value is: BML_RET_OK, Success status bml_disconnect: return value is: BML_RET_OK, Success status The command output has been changed to match original FAIL/OK wlan0 report: operational test failed! OK Main agent operational FAIL wlan0 radio agent operational FAIL wlan2 radio agent operational https://jira.prplfoundation.org/browse/PPM-314 Signed-off-by: Oren Vormaser --- common/beerocks/scripts/prplmesh_utils.sh.in | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/common/beerocks/scripts/prplmesh_utils.sh.in b/common/beerocks/scripts/prplmesh_utils.sh.in index 4ed961abef..74efb9eeaf 100755 --- a/common/beerocks/scripts/prplmesh_utils.sh.in +++ b/common/beerocks/scripts/prplmesh_utils.sh.in @@ -310,17 +310,27 @@ status_function() { if pgrep -l beerocks_cont ; then echo "executing operational test using bml" if execute_beerocks_command "$bml_cmd" ; then + OUTPUT=$output # Expecting # > OK Main radio agent operational # > OK wlan0 radio agent operational # > OK wlan2 radio agent operational - OK_Count=$(echo "$output" | grep -c -e "OK.*operational") + OK_Count=$(echo "$OUTPUT" | grep -c -e "OK.*operational") if [ "$OK_Count" -eq 3 ]; then success "operational test success!" + OUTPUT=$(echo "$OUTPUT" | grep -E '(FAIL|OK).*?operational') + success "$OUTPUT" exit 0 else err "operational test failed!" - err "$output" + OUTPUT=$(echo "$OUTPUT" | grep -E '(FAIL| OK).*?operational' | sed -e "s/ OK/OK/") + echo "$OUTPUT" + if [ "$(echo "$OUTPUT" | grep -c -e " @BEEROCKS_WLAN1_IFACE@ .*operational")" -eq 0 ]; then + err "FAIL @BEEROCKS_WLAN1_IFACE@ radio agent operational" + fi + if [ "$(echo "$OUTPUT" | grep -c -e " @BEEROCKS_WLAN2_IFACE@ .*operational")" -eq 0 ]; then + err "FAIL @BEEROCKS_WLAN2_IFACE@ radio agent operational" + fi exit 1 fi else