Some improvements and changed from Docker container to Pod

- Improved Sanity tests (timeouts, assertion details)
- Changed the YAML of the toolset pod to run the tests
  from instead of the Docker container approach
- Deleted some obsolete scripts from the MOS testing

Related-PROD: K0RQA-15
Change-Id: I9d6482324c75db8e667c6d17ab948bdba4a05bcc
diff --git a/k8s/workspace/run-ceph-info-mos.sh b/k8s/workspace/run-ceph-info-mos.sh
deleted file mode 100644
index 462b05b..0000000
--- a/k8s/workspace/run-ceph-info-mos.sh
+++ /dev/null
@@ -1,9 +0,0 @@
-#!/bin/bash
-
-. "$(dirname "$0")/functions.sh"
-. /opt/cfg-checker/.checkervenv/bin/activate
-
-fname="$MY_PROJFOLDER/reports/$MY_CLIENTSHORTNAME-mos-ceph-info-$(get_timestamp).html"
-mos-checker ceph info --client-name $MY_CLIENTNAME --project-name $MY_PROJNAME --html "${fname}"
-update_latest_report_to "${fname}"
-deactivate
diff --git a/k8s/workspace/run-conformance-mcc.sh b/k8s/workspace/run-conformance-mcc.sh
deleted file mode 100644
index c49bcb7..0000000
--- a/k8s/workspace/run-conformance-mcc.sh
+++ /dev/null
@@ -1,50 +0,0 @@
-#!/bin/bash
-
-. "$(dirname "$0")/functions.sh"
-tenv=mcc
-. /opt/si-tests/.sivenv/bin/activate
-cd $MY_PROJFOLDER/tmp
-. $MY_PROJFOLDER/envs/mccrc
-. $MY_PROJFOLDER/envs/target-${tenv}
-
-# Setting concurrency
-echo "Current conformance concurrency is ${K8S_CONFORMANCE_CONCURRENCY}"
-export K8S_CONFORMANCE_CONCURRENCY=5
-echo "Using concurrency of ${K8S_CONFORMANCE_CONCURRENCY} for MCC"
-export K8S_CONFORMANCE_RUN_NETPOLICY_TESTS=False
-echo "Run network policy tests is ${K8S_CONFORMANCE_CONCURRENCY} for MCC"
-
-if [ -z "$MCC_K8S_CONFORMANCE_IMAGE_VERSION" ]; then
-  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"
-  exit 1
-else
-  echo "Using K8S Conformance image version ${MCC_K8S_CONFORMANCE_IMAGE_VERSION}"
-  export K8S_CONFORMANCE_IMAGE_VERSION=${MCC_K8S_CONFORMANCE_IMAGE_VERSION}
-fi
-
-if [ -z "$MCC_K8S_CONFORMANCE_IMAGE_URL" ]; then
-  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"
-  exit 1
-else
-  echo "Using K8S Conformance image path ${MCC_K8S_CONFORMANCE_IMAGE_URL}"
-  export K8S_CONFORMANCE_IMAGE_URL=${MCC_K8S_CONFORMANCE_IMAGE_URL}
-fi
-
-# Run tests
-pytest /opt/si-tests/si_tests/tests/deployment/test_k8s_conformance.py
-unset TARGET_CLUSTER
-unset TARGET_NAMESPACE
-deactivate
-# report
-if [ -d $MY_PROJFOLDER/reports/${tenv}-conformance ]; then
-	echo "# Generating repors"
-	yes | rm $MY_PROJFOLDER/reports/${tenv}-conformance/*
-else
-	mkdir $MY_PROJFOLDER/reports/${tenv}-conformance
-fi
-cp ./artifacts/*.xml $MY_PROJFOLDER/reports/${tenv}-conformance/
-cd $MY_PROJFOLDER/reports/
-fname="$MY_CLIENTSHORTNAME-${tenv}-conformance-$(get_timestamp).html"
-tparser -f r_xml --omit-status SKIP --force-single -d -r "${fname}" $MY_PROJFOLDER/reports/${tenv}-conformance/
-update_latest_report_to "${fname}"
-cd $MY_PROJFOLDER
diff --git a/k8s/workspace/run-conformance-mos.sh b/k8s/workspace/run-conformance-mos.sh
deleted file mode 100644
index 05e0bcc..0000000
--- a/k8s/workspace/run-conformance-mos.sh
+++ /dev/null
@@ -1,49 +0,0 @@
-#!/bin/bash
-
-. "$(dirname "$0")/functions.sh"
-tenv=mos
-. /opt/si-tests/.sivenv/bin/activate
-cd $MY_PROJFOLDER/tmp
-. $MY_PROJFOLDER/envs/mccrc
-. $MY_PROJFOLDER/envs/target-${tenv}
-# Set concurrency
-echo "Current conformance concurrency is ${K8S_CONFORMANCE_CONCURRENCY}"
-export K8S_CONFORMANCE_CONCURRENCY=10
-echo "Using concurrency of ${K8S_CONFORMANCE_CONCURRENCY} for MOS"
-export K8S_CONFORMANCE_RUN_NETPOLICY_TESTS=False
-echo "Run network policy tests is ${K8S_CONFORMANCE_CONCURRENCY} for MCC"
-
-if [ -z "$MOS_K8S_CONFORMANCE_IMAGE_VERSION" ]; then
-  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"
-  exit 1
-else
-  echo "Using K8S Conformance image version ${MOS_K8S_CONFORMANCE_IMAGE_VERSION}"
-  export K8S_CONFORMANCE_IMAGE_VERSION=${MOS_K8S_CONFORMANCE_IMAGE_VERSION}
-fi
-
-if [ -z "$MOS_K8S_CONFORMANCE_IMAGE_URL" ]; then
-  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"
-  exit 1
-else
-  echo "Using K8S Conformance image path ${MOS_K8S_CONFORMANCE_IMAGE_URL}"
-  export K8S_CONFORMANCE_IMAGE_URL=${MOS_K8S_CONFORMANCE_IMAGE_URL}
-fi
-
-# Run tests
-pytest /opt/si-tests/si_tests/tests/deployment/test_k8s_conformance.py
-unset TARGET_CLUSTER
-unset TARGET_NAMESPACE
-deactivate
-# report
-if [ -d $MY_PROJFOLDER/reports/${tenv}-conformance ]; then
-	echo "# Generating repors"
-	yes | rm $MY_PROJFOLDER/reports/${tenv}-conformance/*
-else
-	mkdir $MY_PROJFOLDER/reports/${tenv}-conformance
-fi
-cp ./artifacts/*.xml $MY_PROJFOLDER/reports/${tenv}-conformance/
-cd $MY_PROJFOLDER/reports/
-fname="$MY_CLIENTSHORTNAME-${tenv}-conformance-$(get_timestamp).html"
-tparser -f r_xml --omit-status SKIP --force-single -d -r "${fname}" $MY_PROJFOLDER/reports/${tenv}-conformance/
-update_latest_report_to "${fname}"
-cd $MY_PROJFOLDER
diff --git a/k8s/workspace/run-k0rdent-sanity-for-child.sh b/k8s/workspace/run-k0rdent-sanity-for-child.sh
index becfdf9..b163521 100644
--- a/k8s/workspace/run-k0rdent-sanity-for-child.sh
+++ b/k8s/workspace/run-k0rdent-sanity-for-child.sh
@@ -1,5 +1,10 @@
 #!/bin/bash
 
+if [ -z "$MY_PROJFOLDER" ]; then
+  echo "The /artifacts/env.sh script is not sourced. Please do 'source env.sh' before running the Sanity tests"
+  exit 1
+fi
+
 . "$(dirname "$0")/functions.sh"
 cd $MY_PROJFOLDER/tmp
 source $MY_PROJFOLDER/env.sh
@@ -73,4 +78,6 @@
 cp $sanity_reports_dir/sanity-checks-results-$TARGET_CLD.html ${fname}
 update_latest_report_to "${fname}"
 
+echo "The test report can be found at ${fname}"
+
 deactivate
\ No newline at end of file
diff --git a/k8s/workspace/run-k0rdent-sanity.sh b/k8s/workspace/run-k0rdent-sanity.sh
index 4037697..9ab9b52 100644
--- a/k8s/workspace/run-k0rdent-sanity.sh
+++ b/k8s/workspace/run-k0rdent-sanity.sh
@@ -1,5 +1,10 @@
 #!/bin/bash
 
+if [ -z "$MY_PROJFOLDER" ]; then
+  echo "The /artifacts/env.sh script is not sourced. Please do 'source env.sh' before running the Sanity tests"
+  exit 1
+fi
+
 . "$(dirname "$0")/functions.sh"
 cd $MY_PROJFOLDER/tmp
 source $MY_PROJFOLDER/env.sh
@@ -43,4 +48,6 @@
 cp $sanity_reports_dir/sanity-checks-results.html ${fname}
 update_latest_report_to "${fname}"
 
+echo "The test report can be found at ${fname}"
+
 deactivate
\ No newline at end of file
diff --git a/k8s/workspace/run-k8s-perf.sh b/k8s/workspace/run-k8s-perf.sh
deleted file mode 100644
index 549428d..0000000
--- a/k8s/workspace/run-k8s-perf.sh
+++ /dev/null
@@ -1,27 +0,0 @@
-#!/bin/bash
-
-. "$(dirname "$0")/functions.sh"
-##
-echo "### Checking rally environments"
-status=$(kubectl -n qa-space get pod | grep rally | tr -s " " | cut -d' ' -f3)
-if [ ${status} != "Running" ]; then
-	echo "# 'rally' container is not Running"
-	echo "# Consider creating resources and/or creating environments"
-	exit 1
-fi
-
-###
-if [ -z $(kubectl exec -n qa-space --stdin rally -- rally env list | grep kubernetes | cut -d' ' -f2) ]; then
-        echo "# Kubernetes env not found. Please, run 'create-rally-deployments.sh'"
-        kubectl exec -n qa-space --stdin rally -- rally env list
-else
-        echo "# Running k8s performance tests"
-        kubectl exec -n qa-space --stdin rally -- rally env use kubernetes
-        kubectl exec -n qa-space --stdin rally -- rally task start /rally/rally-files/k8s-mos-scn-i100c5.yaml
-	# generate report
-	echo "# Generating report"
-	fname="$MY_CLIENTSHORTNAME-mos-k8s-perf-$(get_timestamp).html"
-	kubectl exec -n qa-space --stdin rally -- rally task report $(kubectl exec -n qa-space --stdin rally -- rally task list | grep kubernetes | cut -d' ' -f2 | tail -1) --html-static --out ${fname}
-	kubectl cp qa-space/rally:/rally/${fname} "${MY_PROJFOLDER}/reports/${fname}"
-	update_latest_report_to "${MY_PROJFOLDER}/reports/${fname}"
-fi
diff --git a/k8s/workspace/update-openstack-resources.sh b/k8s/workspace/update-openstack-resources.sh
deleted file mode 100644
index dbbfd14..0000000
--- a/k8s/workspace/update-openstack-resources.sh
+++ /dev/null
@@ -1,104 +0,0 @@
-#!/bin/bash
-echo "Sourcing $MY_PROJFOLDER/env.sh"
-. $MY_PROJFOLDER/env.sh
-if [ -z ${TEMPEST_CUSTOM_PUBLIC_NET+x} ]; then
-	echo "# WARNING: Public network is empty, please export its name to TEMPEST_CUSTOM_PUBLIC_NET environment variable to use some specific external net in case of several networks. Otherwise random external network will be used."
-fi
-# mosrc
-. $MY_PROJFOLDER/envs/mosrc
-
-# local vars
-raw_disk_format=false
-
-function show_help {
-    printf "QA verification: Resources creation script\n\t-h, -?\t\tShow this help\n"
-    printf "\t-r\t\tTo create the images in RAW disk format instead of the QCOW2\n"
-}
-
-OPTIND=1 # Reset in case getopts has been used previously in the shell.
-while getopts "rh?"  opt; do
-    case "$opt" in
-    h|\?)
-        show_help
-        exit 0
-        ;;
-    r)  raw_disk_format=true
-        printf "# Creating the images in RAW disk format instead of the QCOW2\n"
-        ;;
-    esac
-done
-
-##
-echo "### Checking openstack resources"
-status=$(kubectl -n qa-space get pod | grep toolset | tr -s " " | cut -d' ' -f3)
-if [ ${status} != "Running" ]; then
-	echo "# 'toolset' container is not Running"
-	exit 1
-fi
-if [ ! -z $(kubectl exec toolset --stdin -n qa-space -- bash -c "openstack user show cvp.admin -c id -f value") ]; then
-        echo "# Resources already created"
-	echo " "
-	kubectl exec toolset --stdin -n qa-space -- bash -c "cat /artifacts/cmp-check/cvp.manifest"
-else
-  echo "# Creating openstack resources"
-	echo " "
-	kubectl exec toolset --stdin -n qa-space -- bash -c "mkdir /artifacts/cmp-check"
-	if [ "$raw_disk_format" = true ]; then
-    kubectl exec toolset --tty --stdin -n qa-space -- bash -c "cd /artifacts/cmp-check; export CUSTOM_PUBLIC_NET_NAME="${TEMPEST_CUSTOM_PUBLIC_NET:-}"; bash /opt/cmp-check/prepare.sh -r -w \$(pwd)"
-	else
-   kubectl exec toolset --tty --stdin -n qa-space -- bash -c "cd /artifacts/cmp-check; export CUSTOM_PUBLIC_NET_NAME="${TEMPEST_CUSTOM_PUBLIC_NET:-}"; bash /opt/cmp-check/prepare.sh -w \$(pwd)"
-  fi
-fi
-
-#
-echo " "
-echo "# Filling tempest_custom.yaml"
-# TODO: set the correct availability_zone in case nova is not used (now nova is default option)
-cp -v /opt/res-files/k8s/yamls/tempest_custom.yaml.clean $MY_PROJFOLDER/yamls/tempest_custom.yaml
-declare $(kubectl exec toolset --stdin -n qa-space -- bash -c "cat /artifacts/cmp-check/cvp.manifest")
-echo "# Getting network details"
-netid=$(kubectl exec toolset --stdin -n qa-space -- openstack network show ${TEMPEST_CUSTOM_PUBLIC_NET} -c id -f value)
-subnetid=$(kubectl exec toolset --stdin -n qa-space -- openstack subnet list -f value | grep ${netid} | cut -d' ' -f1)
-#echo "# image_ref_name -> ${cirros61_name}"
-#sed -i "s/image_ref_name/${cirros61_name}/g" $MY_PROJFOLDER/yamls/tempest_custom.yaml
-#echo "# image_ref_uuid -> ${cirros61_id}"
-#sed -i "s/image_ref_uuid/${cirros61_id}/g" $MY_PROJFOLDER/yamls/tempest_custom.yaml
-#echo "# image_ref_alt_uuid -> ${cirros62_id}"
-#sed -i "s/image_ref_alt_uuid/${cirros62_id}/g" $MY_PROJFOLDER/yamls/tempest_custom.yaml
-echo "# s/public_subnet_uuid/ -> ${subnetid}"
-sed -i "s/public_subnet_uuid/${subnetid}/g" $MY_PROJFOLDER/yamls/tempest_custom.yaml
-echo "# s/public_net_uuid/ -> ${netid}"
-sed -i "s/public_net_uuid/${netid}/g" $MY_PROJFOLDER/yamls/tempest_custom.yaml
-echo "# s/public_net_name/ -> ${TEMPEST_CUSTOM_PUBLIC_NET}"
-sed -i "s/public_net_name/${TEMPEST_CUSTOM_PUBLIC_NET}/g" $MY_PROJFOLDER/yamls/tempest_custom.yaml
-echo "# s/volume_type_name/ -> ${TEMPEST_CUSTOM_VOLUME_TYPE}"
-sed -i "s/volume_type_name/${TEMPEST_CUSTOM_VOLUME_TYPE}/g" $MY_PROJFOLDER/yamls/tempest_custom.yaml
-echo " "
-
-echo "# Checking Neutron global physnet mtu value"
-global_physnet_mtu=""
-global_physnet_mtu=$(kubectl get osdpl -A -o wide -o yaml | grep global_physnet_mtu | tail -n1 | cut -d':' -f2 | tr -d ' ')
-if [ -n "$global_physnet_mtu" ]; then
-    echo "global_physnet_mtu is set to: $global_physnet_mtu"
-    echo "" >> $MY_PROJFOLDER/yamls/tempest_custom.yaml
-    cat <<EOF >> $MY_PROJFOLDER/yamls/tempest_custom.yaml
-neutron_plugin_options:
-    max_mtu: $global_physnet_mtu
-EOF
-fi
-
-echo "# Updating SPT global_config.yaml"
-cp -v /opt/res-files/k8s/yamls/spt_global_config.yaml.clean $MY_PROJFOLDER/yamls/global_config.yaml
-echo "# image_ref_name -> ${ubuntu20_name}"
-sed -i "s/image_ref_name/${ubuntu20_name}/g" $MY_PROJFOLDER/yamls/global_config.yaml
-echo "# s/public-network-name/ -> ${TEMPEST_CUSTOM_PUBLIC_NET}"
-sed -i "s/public-network-name/${TEMPEST_CUSTOM_PUBLIC_NET}/g" $MY_PROJFOLDER/yamls/global_config.yaml
-#
-
-echo "# Copying files"
-kubectl exec toolset --tty --stdin -n qa-space -- bash -c "cp /artifacts/cmp-check/cvp.manifest /opt/cmp-check/cvp.manifest"
-kubectl exec toolset --tty --stdin -n qa-space -- bash -c "cp /artifacts/cmp-check/cvprc /opt/cmp-check/cvprc"
-kubectl exec toolset --tty --stdin -n qa-space -- bash -c "cp /artifacts/cmp-check/cvprc /opt/cvprc"
-kubectl exec toolset --tty --stdin -n qa-space -- bash -c "cp /artifacts/cmp-check/cvp_testkey /opt/cmp-check/cvp_testkey"
-
-echo "# Done!"