diff options
author | JohnKeeney <john.keeney@est.tech> | 2022-05-24 12:34:49 +0100 |
---|---|---|
committer | JohnKeeney <john.keeney@est.tech> | 2022-05-25 16:26:44 +0100 |
commit | 08486cf3a7972219c3d017d5e47a2c802b225794 (patch) | |
tree | 871ede7b291e9d7b94544fd091a29d8494a9ef9e /csit/scripts/healthcheck | |
parent | ca9a543e882c0fa891230d72311d5f7631d099bc (diff) |
Attempt to get stdout&stderr for CSIT tests
Also small tweak for RTD documentation
Issue-ID: CCSDK-3675
Change-Id: Idd8acca0e07dc45c6f76a78a321b1075f3ee31ef
Signed-off-by: JohnKeeney <john.keeney@est.tech>
Diffstat (limited to 'csit/scripts/healthcheck')
-rwxr-xr-x | csit/scripts/healthcheck/data/preparePmsData.sh | 25 |
1 files changed, 24 insertions, 1 deletions
diff --git a/csit/scripts/healthcheck/data/preparePmsData.sh b/csit/scripts/healthcheck/data/preparePmsData.sh index 3891728f..c21747f5 100755 --- a/csit/scripts/healthcheck/data/preparePmsData.sh +++ b/csit/scripts/healthcheck/data/preparePmsData.sh @@ -32,6 +32,8 @@ a1_sim_OSC_port=${2:-30001} a1_sim_STD_port=${3:-30005} httpx=${4:-"http"} SHELL_FOLDER=$(cd "$(dirname "$0")";pwd) +ric1_id="ric1" +ric2_id="ric2" echo "using policy_agent port: "$policy_agent_port echo "using a1-sim-OSC port: "$a1_sim_OSC_port @@ -45,8 +47,21 @@ checkRes (){ exit 1; fi } +checkReturnContains(){ + for ((i=0; i<$1; i++)); do + res=$($2) + expect=$3 + echo "Check \"$4\" Expected to contain: \"$expect\" Received \"$res\"" + if [[ "$res" =~ "$expect" ]]; then + echo -e "$4 is as expected!\n" + break; + else + sleep 1 + fi + done +} -echo "policy agent status:" +echo "A1 policy management service status:" curlString="curl -skw %{http_code} $httpx://localhost:$policy_agent_port/status" res=$($curlString) echo "$res" @@ -86,6 +101,14 @@ expect="Policy type 2 is OK.201" 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" +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" +echo -e "\n" + for i in {1..300}; do echo "policy types from policy agent:" curlString="curl -skw %{http_code} $httpx://localhost:$policy_agent_port/a1-policy/v2/policy-types" |