aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRam Krishna Verma <ram_krishna.verma@bell.ca>2023-02-21 15:15:21 +0000
committerGerrit Code Review <gerrit@onap.org>2023-02-21 15:15:21 +0000
commita6664dc5c767210a78f140b9fa149c2a8261b428 (patch)
tree4bc90c10e760271de690b16e678ea81120ee920b
parent12dc7f261c9d221cfef3cb991d85034f034020a5 (diff)
parent6ebe5b6521d3dc5f98981ffded70155b537c533e (diff)
Merge "Add volume mount for storing k8s robot logs to the host"
-rwxr-xr-xcsit/run-k8s-csit.sh5
-rw-r--r--helm/robot/templates/test-job.yaml9
-rw-r--r--helm/robot/values.yaml2
-rwxr-xr-xhelm/run-test.sh2
4 files changed, 13 insertions, 5 deletions
diff --git a/csit/run-k8s-csit.sh b/csit/run-k8s-csit.sh
index e348ca80..22a67f9c 100755
--- a/csit/run-k8s-csit.sh
+++ b/csit/run-k8s-csit.sh
@@ -36,6 +36,7 @@ POLICY_APEX_CONTAINER="policy-apex-pdp"
export PROJECT=""
export ROBOT_FILE=""
+export ROBOT_LOG_DIR=${PWD}/archives
export READINESS_CONTAINERS=()
function spin_microk8s_cluster () {
@@ -54,7 +55,7 @@ function spin_microk8s_cluster () {
echo "Microk8s cluster installed successfully"
sudo usermod -a -G microk8s $USER
echo "Enabling DNS and helm3 plugins"
- microk8s.enable dns helm3
+ microk8s.enable dns helm3 hostpath-storage
echo "Creating configuration file for Microk8s"
microk8s kubectl config view --raw > $HOME/.kube/config
chmod 600 $HOME/.kube/config
@@ -93,7 +94,7 @@ function build_robot_image () {
rm -rf tests/models/
echo "---------------------------------------------"
echo "Installing Robot framework pod for running CSIT"
- microk8s helm install csit-robot robot --set robot=$ROBOT_FILE --set "readiness={${READINESS_CONTAINERS[*]}}";
+ microk8s helm install csit-robot robot --set robot=$ROBOT_FILE --set "readiness={${READINESS_CONTAINERS[*]}}" --set robotLogDir=$ROBOT_LOG_DIR;
print_robot_log
fi
}
diff --git a/helm/robot/templates/test-job.yaml b/helm/robot/templates/test-job.yaml
index 5d8a610f..ed1669a9 100644
--- a/helm/robot/templates/test-job.yaml
+++ b/helm/robot/templates/test-job.yaml
@@ -49,4 +49,11 @@ spec:
- name: ROBOT_FILE
value: {{ .Values.robot }}
command: [ "./run-test.sh", "$(ROBOT_FILE)" ]
- restartPolicy: Never \ No newline at end of file
+ volumeMounts:
+ - name: robot-csit-pv
+ mountPath: /tmp
+ restartPolicy: Never
+ volumes:
+ - name: robot-csit-pv
+ hostPath:
+ path: {{ .Values.robotLogDir }} \ No newline at end of file
diff --git a/helm/robot/values.yaml b/helm/robot/values.yaml
index 95df6fa0..5baf8aac 100644
--- a/helm/robot/values.yaml
+++ b/helm/robot/values.yaml
@@ -67,4 +67,4 @@ affinity: {}
robot: ""
readiness: []
-
+robotLogDir: ""
diff --git a/helm/run-test.sh b/helm/run-test.sh
index bb073c38..d40bb585 100755
--- a/helm/run-test.sh
+++ b/helm/run-test.sh
@@ -38,6 +38,6 @@ ROBOT_VARIABLES="-v DATA:$DATA -v NODETEMPLATES:$NODETEMPLATES -v POLICY_RUNTIME
echo "Run Robot test"
echo ROBOT_VARIABLES="${ROBOT_VARIABLES}"
echo "Starting Robot test suites ..."
-python3 -m robot.run $ROBOT_VARIABLES $1
+python3 -m robot.run -d /tmp/ $ROBOT_VARIABLES $1
RESULT=$?
echo "RESULT: ${RESULT}"