summaryrefslogtreecommitdiffstats
path: root/csit/run-k8s-csit.sh
diff options
context:
space:
mode:
authoradheli.tavares <adheli.tavares@est.tech>2023-03-13 16:55:02 +0000
committerAdheli Tavares <adheli.tavares@est.tech>2023-03-14 15:10:40 +0000
commitc244ab0c6dfe6c9a4d23a35710659b511d6d74cb (patch)
treeb7c97e15da2a76ca95795aad0a3ee6e3211da30e /csit/run-k8s-csit.sh
parent4bde5ee757d1141f2e1f1ef55f6e25774d6e806f (diff)
Add prometheus server to k8s charts
- add pap-slas.test to list of robot tests for k8s - fix an export var on docker compose Issue-ID: POLICY-4545 Change-Id: Id1dd55693ab6d016fd0dd38230972ffe96b28b14 Signed-off-by: adheli.tavares <adheli.tavares@est.tech>
Diffstat (limited to 'csit/run-k8s-csit.sh')
-rwxr-xr-xcsit/run-k8s-csit.sh18
1 files changed, 13 insertions, 5 deletions
diff --git a/csit/run-k8s-csit.sh b/csit/run-k8s-csit.sh
index 201c1f5a..fb52b79f 100755
--- a/csit/run-k8s-csit.sh
+++ b/csit/run-k8s-csit.sh
@@ -30,7 +30,7 @@ CSIT_SCRIPT="scripts/run-test.sh"
ROBOT_DOCKER_IMAGE="policy-csit-robot"
POLICY_CLAMP_ROBOT="policy-clamp-test.robot"
POLICY_API_ROBOT="api-test.robot"
-POLICY_PAP_ROBOT="pap-test.robot"
+POLICY_PAP_ROBOT="pap-test.robot pap-slas.robot"
POLICY_APEX_PDP_ROBOT="apex-pdp-test.robot"
POLICY_XACML_PDP_ROBOT="xacml-pdp-test.robot"
POLICY_DROOLS_PDP_ROBOT="drools-pdp-test.robot"
@@ -87,6 +87,8 @@ function teardown_cluster () {
sudo snap remove microk8s;rm -rf $HOME/.kube/config
sudo rm -rf /dockerdata-nfs/mariadb-galera/
echo "K8s Cluster removed"
+ echo "Clean up docker"
+ docker system prune -af
}
@@ -107,16 +109,21 @@ function build_robot_image () {
echo "Importing robot image into microk8s registry"
docker save -o policy-csit-robot.tar ${ROBOT_DOCKER_IMAGE}:latest
microk8s ctr image import policy-csit-robot.tar
+}
+
+
+function start_csit () {
+ build_robot_image
if [ "${?}" -eq 0 ]; then
- rm -rf policy-csit-robot.tar
- rm -rf tests/models/
+ rm -rf ${WORKSPACE}/csit/resources/policy-csit-robot.tar
+ rm -rf ${WORKSPACE}/csit/resources/tests/models/
echo "---------------------------------------------"
echo "Installing Robot framework pod for running CSIT"
cd ${WORKSPACE}/helm
mkdir -p ${ROBOT_LOG_DIR}
microk8s helm install csit-robot robot --set robot="$ROBOT_FILE" --set "readiness={${READINESS_CONTAINERS[*]}}" --set robotLogDir=$ROBOT_LOG_DIR;
print_robot_log
- fi
+ fi
}
@@ -218,6 +225,7 @@ if [ $1 == "install" ]; then
cd ${WORKSPACE}/helm || exit;
microk8s helm dependency build policy
microk8s helm install csit-policy policy
+ microk8s helm install prometheus prometheus
echo "Policy chart installation completed"
echo "-------------------------------------------"
fi
@@ -229,7 +237,7 @@ if [ $1 == "install" ]; then
echo "CSIT will be invoked from $ROBOT_FILE"
echo "Readiness containers: ${READINESS_CONTAINERS[*]}"
echo "-------------------------------------------"
- build_robot_image
+ start_csit
else
echo "No project supplied for running CSIT"
fi