From 83a5153735b420b439917e643dbebc06b04f1e3a Mon Sep 17 00:00:00 2001 From: JohnKeeney Date: Wed, 25 May 2022 18:38:12 +0100 Subject: Attempt to get stdout&stderr for CSIT tests - contd Issue-ID: CCSDK-3675 Change-Id: I6d0df063518b5441112b6afb2ba1f80da4668000 Signed-off-by: JohnKeeney --- csit/scripts/healthcheck/data/preparePmsData.sh | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/csit/scripts/healthcheck/data/preparePmsData.sh b/csit/scripts/healthcheck/data/preparePmsData.sh index c21747f5..69dc92d2 100755 --- a/csit/scripts/healthcheck/data/preparePmsData.sh +++ b/csit/scripts/healthcheck/data/preparePmsData.sh @@ -48,11 +48,15 @@ checkRes (){ fi } checkReturnContains(){ +#arg 1 max time, seconds +#arg 2 command +#arg 3 value (regex) +#arg 4 description for ((i=0; i<$1; i++)); do - res=$($2) - expect=$3 - echo "Check \"$4\" Expected to contain: \"$expect\" Received \"$res\"" - if [[ "$res" =~ "$expect" ]]; then + resin=$($2) + exp=$3 + echo "Check \"$4\" Expected to contain: \"$exp\" Received \"$resin\"" + if [[ $resin =~ $exp ]]; then echo -e "$4 is as expected!\n" break; else @@ -102,11 +106,11 @@ checkRes echo -e "\n" echo "check $ric1_id sync status:" -checkReturnContains 60 "curl -skw %{http_code} $httpx://localhost:$policy_agent_port/a1-policy/v2/rics/ric?ric_id=$ric1_id" "\"state\": \"AVAILABLE\"" "$ric1_id status" +checkReturnContains 90 "curl -skw %{http_code} $httpx://localhost:$policy_agent_port/a1-policy/v2/rics/ric?ric_id=$ric1_id" "\"state\"\s*:\s*\"AVAILABLE\"" "$ric1_id status" echo -e "\n" echo "check $ric2_id sync status:" -checkReturnContains 60 "curl -skw %{http_code} $httpx://localhost:$policy_agent_port/a1-policy/v2/rics/ric?ric_id=$ric2_id" "\"state\": \"AVAILABLE\"" "$ric2_id status" +checkReturnContains 30 "curl -skw %{http_code} $httpx://localhost:$policy_agent_port/a1-policy/v2/rics/ric?ric_id=$ric2_id" "\"state\"\s*:\s*\"AVAILABLE\"" "$ric2_id status" echo -e "\n" for i in {1..300}; do -- cgit 1.2.3-korg