summaryrefslogtreecommitdiffstats
path: root/csit/scripts/healthcheck/test
diff options
context:
space:
mode:
authorraviteja.karumuri <raviteja.karumuri@est.tech>2023-09-14 12:38:49 +0100
committerraviteja.karumuri <raviteja.karumuri@est.tech>2023-09-27 10:45:15 +0100
commita4687d9a257e6d95cdca6182d5a012a149f5f716 (patch)
tree6fe6288bcc45d49c3a13c9edb00470fab64f5ec2 /csit/scripts/healthcheck/test
parentaeb5e2ac45f459a9145a3898b8144387a1703a97 (diff)
OpenApi-First approach
Issue-ID: CCSDK-3927 Signed-off-by: raviteja.karumuri <raviteja.karumuri@est.tech> Change-Id: Ie88b84cce42081f1becdf186813b2e557479297b Signed-off-by: raviteja.karumuri <raviteja.karumuri@est.tech>
Diffstat (limited to 'csit/scripts/healthcheck/test')
-rwxr-xr-xcsit/scripts/healthcheck/test/health_check.sh30
-rwxr-xr-xcsit/scripts/healthcheck/test/pms_a1sim.sh19
-rwxr-xr-xcsit/scripts/healthcheck/test/pms_a1sim_sdnc.sh21
3 files changed, 41 insertions, 29 deletions
diff --git a/csit/scripts/healthcheck/test/health_check.sh b/csit/scripts/healthcheck/test/health_check.sh
index 05bfeae5..ad23632f 100755
--- a/csit/scripts/healthcheck/test/health_check.sh
+++ b/csit/scripts/healthcheck/test/health_check.sh
@@ -35,34 +35,42 @@ chmod +x docker-compose
checkStatus(){
- for i in {1..60}; do
- res=$($1)
+ for ((i=0; i<$1; i++)); do
+ res=$($2)
echo "$res"
- expect=$2
+ expect=$3
if [ "$res" == "$expect" ]; then
- echo -e "$3 is alive!\n"
+ echo -e "$i sec: $4 is alive!\n"
+ return 0
break;
else
- sleep $i
+ sleep 1
fi
done
+ echo -e "$i sec: $4 is NOT alive!\n"
+ exit -1
}
+
# Healthcheck docker containers
# check SIM1 status
echo "check SIM1 status:"
-checkStatus "curl -skw %{http_code} http://localhost:30001/" "OK200" "SIM1"
+checkStatus 120 "curl -sSkw %{http_code} http://localhost:30001/ " "OK200" "SIM1"
# check SIM2 status
echo "check SIM2 status:"
-checkStatus "curl -skw %{http_code} http://localhost:30003/" "OK200" "SIM2"
+checkStatus 120 "curl -sSkw %{http_code} http://localhost:30003/ " "OK200" "SIM2"
# check SIM3 status
echo "check SIM3 status:"
-checkStatus "curl -skw %{http_code} http://localhost:30005/" "OK200" "SIM3"
+checkStatus 120 "curl -sSkw %{http_code} http://localhost:30005/ " "OK200" "SIM3"
+
+# check PMS status (HTTPS)
+echo "check PMS status (HTTPS):"
+checkStatus 120 "curl -sSkw %{http_code} https://localhost:8433/status " "success200" "PMS (HTTPS)"
-# check PMS status
-echo "check PMS status:"
-checkStatus "curl -skw %{http_code} http://localhost:8081/status" "success200" "PMS"
+# check PMS status (HTTPS)
+echo "check PMS status (HTTPS):"
+checkStatus 120 "curl -sSkw %{http_code} http://localhost:8081/status " "success200" "PMS (HTTP)"
echo "NONRTRIC health check passed."
diff --git a/csit/scripts/healthcheck/test/pms_a1sim.sh b/csit/scripts/healthcheck/test/pms_a1sim.sh
index 8ba4ef44..d91821f4 100755
--- a/csit/scripts/healthcheck/test/pms_a1sim.sh
+++ b/csit/scripts/healthcheck/test/pms_a1sim.sh
@@ -30,35 +30,36 @@ chmod +x docker-compose
./docker-compose --env-file .env up -d
checkStatus(){
- for i in {1..60}; do
- res=$($1)
+ for ((i=0; i<$1; i++)); do
+ res=$($2)
echo "$res"
- expect=$2
+ expect=$3
if [ "$res" == "$expect" ]; then
- echo -e "$3 is alive!\n"
+ echo -e "$4 is alive!\n"
break;
else
- sleep $i
+ sleep 1
fi
done
}
+
# Healthcheck docker containers
# check SIM1 status
echo "check SIM1 status:"
-checkStatus "curl -skw %{http_code} http://localhost:30001/" "OK200" "SIM1"
+checkStatus 120 "curl -sSkw %{http_code} http://localhost:30001/ " "OK200" "SIM1"
# check SIM2 status
echo "check SIM2 status:"
-checkStatus "curl -skw %{http_code} http://localhost:30003/" "OK200" "SIM2"
+checkStatus 120 "curl -sSkw %{http_code} http://localhost:30003/ " "OK200" "SIM2"
# check SIM3 status
echo "check SIM3 status:"
-checkStatus "curl -skw %{http_code} http://localhost:30005/" "OK200" "SIM3"
+checkStatus 120 "curl -sSkw %{http_code} http://localhost:30005/ " "OK200" "SIM3"
# check PMS status
echo "check PMS status:"
-checkStatus "curl -skw %{http_code} http://localhost:8081/status" "success200" "PMS"
+checkStatus 120 "curl -sSkw %{http_code} http://localhost:8081/status " "success200" "PMS"
cd ${SHELL_FOLDER}/../data
./preparePmsData.sh
diff --git a/csit/scripts/healthcheck/test/pms_a1sim_sdnc.sh b/csit/scripts/healthcheck/test/pms_a1sim_sdnc.sh
index a71e3b1d..6513f789 100755
--- a/csit/scripts/healthcheck/test/pms_a1sim_sdnc.sh
+++ b/csit/scripts/healthcheck/test/pms_a1sim_sdnc.sh
@@ -37,38 +37,41 @@ checkStatus(){
echo "$res"
expect=$3
if [ "$res" == "$expect" ]; then
- echo -e "$4 is alive!\n"
+ echo -e "$i sec: $4 is alive!\n"
+ return 0
break;
else
sleep 1
fi
done
+ echo -e "$i sec: $4 is NOT alive!\n"
+ exit -1
}
+
# Healthcheck docker containers
# check SIM1 status
echo "check SIM1 status:"
-checkStatus 60 "curl -skw %{http_code} http://localhost:30001/" "OK200" "SIM1"
+checkStatus 120 "curl -sSkw %{http_code} http://localhost:30001/ " "OK200" "SIM1"
# check SIM2 status
echo "check SIM2 status:"
-checkStatus 60 "curl -skw %{http_code} http://localhost:30003/" "OK200" "SIM2"
+checkStatus 120 "curl -sSkw %{http_code} http://localhost:30003/ " "OK200" "SIM2"
# check SIM3 status
echo "check SIM3 status:"
-checkStatus 60 "curl -skw %{http_code} http://localhost:30005/" "OK200" "SIM3"
+checkStatus 120 "curl -sSkw %{http_code} http://localhost:30005/ " "OK200" "SIM3"
# check PMS status
echo "check PMS status:"
-checkStatus 60 "curl -skw %{http_code} http://localhost:8081/status" "success200" "PMS"
+checkStatus 120 "curl -sSkw %{http_code} http://localhost:8081/status " "success200" "PMS"
-curl -skw %{http_code} http://localhost:8081/actuator/loggers/org.onap.ccsdk.oran.a1policymanagementservice -X POST -H Content-Type:application/json -d '{"configuredLevel":"debug"}'
-curl -skw %{http_code} http://localhost:8081/actuator/loggers/org.onap.ccsdk.oran.a1policymanagementservice.tasks -X POST -H Content-Type:application/json -d '{"configuredLevel":"trace"}'
+curl -sSkw %{http_code} http://localhost:8081/actuator/loggers/org.onap.ccsdk.oran.a1policymanagementservice -X POST -H Content-Type:application/json -d '{"configuredLevel":"debug"}'
+curl -sSkw %{http_code} http://localhost:8081/actuator/loggers/org.onap.ccsdk.oran.a1policymanagementservice.tasks -X POST -H Content-Type:application/json -d '{"configuredLevel":"trace"}'
# check SDNC status
echo "check SDNC status:"
-checkStatus 300 "curl -s -o /dev/null -I -w %{http_code} http://localhost:8282/apidoc/explorer/" "200" "SDNC"
+checkStatus 300 "curl -sS -o /dev/null -I -w %{http_code} http://localhost:8282/apidoc/explorer/ " "200" "SDNC"
cd ${SHELL_FOLDER}/../data
./preparePmsData.sh
-