Skip to content
This repository has been archived by the owner on Sep 7, 2020. It is now read-only.

Commit

Permalink
common: prplmesh_utils.sh: change prplmesh_utils.sh status output
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
orenvor committed Aug 3, 2020
1 parent 842bc5b commit 7179733
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions common/beerocks/scripts/prplmesh_utils.sh.in
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 7179733

Please sign in to comment.