summaryrefslogtreecommitdiffstats
path: root/csit/scripts
diff options
context:
space:
mode:
authorJohnKeeney <john.keeney@est.tech>2022-05-25 18:38:12 +0100
committerJohnKeeney <john.keeney@est.tech>2022-05-25 18:38:31 +0100
commit83a5153735b420b439917e643dbebc06b04f1e3a (patch)
tree6290532b51504ff3975a8ec27193761687c5fa2f /csit/scripts
parent08486cf3a7972219c3d017d5e47a2c802b225794 (diff)
Attempt to get stdout&stderr for CSIT tests - contd
Issue-ID: CCSDK-3675 Change-Id: I6d0df063518b5441112b6afb2ba1f80da4668000 Signed-off-by: JohnKeeney <john.keeney@est.tech>
Diffstat (limited to 'csit/scripts')
-rwxr-xr-xcsit/scripts/healthcheck/data/preparePmsData.sh16
1 files 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