blob: 3b7f7d53eb5565d9b94414db3b65b8cdb17cbd89 [file] [log] [blame]
Alexa0053b92022-10-14 16:38:28 -05001#!/bin/bash
pkazlenka4690e832024-10-24 13:28:37 +02002
3. "$(dirname "$0")/functions.sh"
Alexa0053b92022-10-14 16:38:28 -05004tenv=mcc
5. /opt/si-tests/.sivenv/bin/activate
6cd $MY_PROJFOLDER/tmp
Alexc85212b2022-11-08 12:27:01 -06007. $MY_PROJFOLDER/envs/mccrc
8. $MY_PROJFOLDER/envs/target-${tenv}
Alex876e93a2022-12-21 12:02:13 -06009
10# Setting concurrency
11echo "Current conformance concurrency is ${K8S_CONFORMANCE_CONCURRENCY}"
12export K8S_CONFORMANCE_CONCURRENCY=5
13echo "Using concurrency of ${K8S_CONFORMANCE_CONCURRENCY} for MCC"
Alexd1ac2262023-03-31 13:53:33 -050014export K8S_CONFORMANCE_RUN_NETPOLICY_TESTS=False
15echo "Run network policy tests is ${K8S_CONFORMANCE_CONCURRENCY} for MCC"
Alex876e93a2022-12-21 12:02:13 -060016
Ievgeniia Zadorozhna68ba4f32024-01-27 02:51:59 +010017if [ -z "$MCC_K8S_CONFORMANCE_IMAGE_VERSION" ]; then
18 echo "Error: Failed to determine Kubernetes Conformance image version. Please export K8S_CONFORMANCE_IMAGE_VERSION, for example, export K8S_CONFORMANCE_IMAGE_VERSION=1.xx.x-x"
19 exit 1
20else
21 echo "Using K8S Conformance image version ${MCC_K8S_CONFORMANCE_IMAGE_VERSION}"
22 export K8S_CONFORMANCE_IMAGE_VERSION=${MCC_K8S_CONFORMANCE_IMAGE_VERSION}
23fi
24
25if [ -z "$MCC_K8S_CONFORMANCE_IMAGE_URL" ]; then
26 echo "Error: Failed to determine Kubernetes Conformance image path. Please export K8S_CONFORMANCE_IMAGE_URL, for example, export K8S_CONFORMANCE_IMAGE_URL=mirantis.azurecr.io/lcm/kubernetes/k8s-conformance:v1.xx.x-x"
27 exit 1
28else
29 echo "Using K8S Conformance image path ${MCC_K8S_CONFORMANCE_IMAGE_URL}"
30 export K8S_CONFORMANCE_IMAGE_URL=${MCC_K8S_CONFORMANCE_IMAGE_URL}
31fi
32
Ievgeniia Zadorozhnab9b2afa2025-12-02 18:32:29 +010033# Cleaning up
34echo "# Cleaning up '/artifacts/tmp/artifacts/'"
35[ -d "/artifacts/tmp/artifacts/" ] && rm -rf "/artifacts/tmp/artifacts/"
36[ -f "/artifacts/tmp/nosetests.xml" ] && rm "/artifacts/tmp/nosetests.xml"
37mkdir "/artifacts/tmp/artifacts/"
38
Alex876e93a2022-12-21 12:02:13 -060039# Run tests
Alexa0053b92022-10-14 16:38:28 -050040pytest /opt/si-tests/si_tests/tests/deployment/test_k8s_conformance.py
41unset TARGET_CLUSTER
42unset TARGET_NAMESPACE
43deactivate
44# report
45if [ -d $MY_PROJFOLDER/reports/${tenv}-conformance ]; then
46 echo "# Generating repors"
47 yes | rm $MY_PROJFOLDER/reports/${tenv}-conformance/*
48else
49 mkdir $MY_PROJFOLDER/reports/${tenv}-conformance
50fi
51cp ./artifacts/*.xml $MY_PROJFOLDER/reports/${tenv}-conformance/
52cd $MY_PROJFOLDER/reports/
pkazlenka4690e832024-10-24 13:28:37 +020053fname="$MY_CLIENTSHORTNAME-${tenv}-conformance-$(get_timestamp).html"
54tparser -f r_xml --omit-status SKIP --force-single -d -r "${fname}" $MY_PROJFOLDER/reports/${tenv}-conformance/
55update_latest_report_to "${fname}"
Alexa0053b92022-10-14 16:38:28 -050056cd $MY_PROJFOLDER