Alex | a0053b9 | 2022-10-14 16:38:28 -0500 | [diff] [blame] | 1 | #!/bin/bash |
| 2 | tenv=mcc |
| 3 | . /opt/si-tests/.sivenv/bin/activate |
| 4 | cd $MY_PROJFOLDER/tmp |
Alex | c85212b | 2022-11-08 12:27:01 -0600 | [diff] [blame] | 5 | . $MY_PROJFOLDER/envs/mccrc |
| 6 | . $MY_PROJFOLDER/envs/target-${tenv} |
Alex | 876e93a | 2022-12-21 12:02:13 -0600 | [diff] [blame] | 7 | |
| 8 | # Setting concurrency |
| 9 | echo "Current conformance concurrency is ${K8S_CONFORMANCE_CONCURRENCY}" |
| 10 | export K8S_CONFORMANCE_CONCURRENCY=5 |
| 11 | echo "Using concurrency of ${K8S_CONFORMANCE_CONCURRENCY} for MCC" |
Alex | d1ac226 | 2023-03-31 13:53:33 -0500 | [diff] [blame] | 12 | export K8S_CONFORMANCE_RUN_NETPOLICY_TESTS=False |
| 13 | echo "Run network policy tests is ${K8S_CONFORMANCE_CONCURRENCY} for MCC" |
Alex | 876e93a | 2022-12-21 12:02:13 -0600 | [diff] [blame] | 14 | |
Ievgeniia Zadorozhna | 68ba4f3 | 2024-01-27 02:51:59 +0100 | [diff] [blame] | 15 | if [ -z "$MCC_K8S_CONFORMANCE_IMAGE_VERSION" ]; then |
| 16 | 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" |
| 17 | exit 1 |
| 18 | else |
| 19 | echo "Using K8S Conformance image version ${MCC_K8S_CONFORMANCE_IMAGE_VERSION}" |
| 20 | export K8S_CONFORMANCE_IMAGE_VERSION=${MCC_K8S_CONFORMANCE_IMAGE_VERSION} |
| 21 | fi |
| 22 | |
| 23 | if [ -z "$MCC_K8S_CONFORMANCE_IMAGE_URL" ]; then |
| 24 | 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" |
| 25 | exit 1 |
| 26 | else |
| 27 | echo "Using K8S Conformance image path ${MCC_K8S_CONFORMANCE_IMAGE_URL}" |
| 28 | export K8S_CONFORMANCE_IMAGE_URL=${MCC_K8S_CONFORMANCE_IMAGE_URL} |
| 29 | fi |
| 30 | |
Alex | 876e93a | 2022-12-21 12:02:13 -0600 | [diff] [blame] | 31 | # Run tests |
Alex | a0053b9 | 2022-10-14 16:38:28 -0500 | [diff] [blame] | 32 | pytest /opt/si-tests/si_tests/tests/deployment/test_k8s_conformance.py |
| 33 | unset TARGET_CLUSTER |
| 34 | unset TARGET_NAMESPACE |
| 35 | deactivate |
| 36 | # report |
| 37 | if [ -d $MY_PROJFOLDER/reports/${tenv}-conformance ]; then |
| 38 | echo "# Generating repors" |
| 39 | yes | rm $MY_PROJFOLDER/reports/${tenv}-conformance/* |
| 40 | else |
| 41 | mkdir $MY_PROJFOLDER/reports/${tenv}-conformance |
| 42 | fi |
| 43 | cp ./artifacts/*.xml $MY_PROJFOLDER/reports/${tenv}-conformance/ |
| 44 | cd $MY_PROJFOLDER/reports/ |
| 45 | tparser -f r_xml --omit-status SKIP --force-single -d -r $MY_CLIENTSHORTNAME-${tenv}-conformance-latest.html $MY_PROJFOLDER/reports/${tenv}-conformance/ |
| 46 | cd $MY_PROJFOLDER |