Alex | a0053b9 | 2022-10-14 16:38:28 -0500 | [diff] [blame] | 1 | #!/bin/bash |
| 2 | if [ -z ${TEMPEST_CUSTOM_PUBLIC_NET+x} ]; then |
| 3 | echo "# WARNING: Public network is empty" |
| 4 | fi |
| 5 | # mosrc |
| 6 | . $MY_PROJFOLDER/envs/mosrc |
| 7 | |
| 8 | ## |
| 9 | echo "### Checking openstack resources" |
| 10 | status=$(kubectl -n qa-space get pod | grep toolset | tr -s " " | cut -d' ' -f3) |
| 11 | if [ ${status} != "Running" ]; then |
| 12 | echo "# 'toolset' container is not Running" |
| 13 | exit 1 |
| 14 | fi |
| 15 | if [ ! -z $(kubectl exec toolset --stdin -n qa-space -- bash -c "openstack user show cvp.admin -c id -f value") ]; then |
| 16 | echo "# Resources already created" |
| 17 | echo " " |
| 18 | kubectl exec toolset --stdin -n qa-space -- bash -c "cat /artifacts/cmp-check/cvp.manifest" |
| 19 | else |
| 20 | echo "# Creating openstack resources" |
| 21 | echo " " |
| 22 | kubectl exec toolset --stdin -n qa-space -- bash -c "mkdir /artifacts/cmp-check" |
Alex | 2c8b880 | 2022-10-20 14:07:15 -0500 | [diff] [blame] | 23 | kubectl exec toolset --tty --stdin -n qa-space -- bash -c "cd /artifacts/cmp-check; bash /opt/cmp-check/prepare.sh -w \$(pwd)" |
Alex | a0053b9 | 2022-10-14 16:38:28 -0500 | [diff] [blame] | 24 | fi |
| 25 | |
| 26 | # |
| 27 | echo " " |
| 28 | echo "# Filling tempest_custom.yaml" |
| 29 | cp -v /opt/res-files/k8s/yamls/tempest_custom.yaml.clean $MY_PROJFOLDER/yamls/tempest_custom.yaml |
| 30 | declare $(kubectl exec toolset --stdin -n qa-space -- bash -c "cat /artifacts/cmp-check/cvp.manifest") |
| 31 | echo "# Getting network details" |
| 32 | netid=$(kubectl exec toolset --stdin -n qa-space -- openstack network show ${TEMPEST_CUSTOM_PUBLIC_NET} -c id -f value) |
Alex | c85212b | 2022-11-08 12:27:01 -0600 | [diff] [blame] | 33 | subnetid=$(kubectl exec toolset --stdin -n qa-space -- openstack subnet list -f value | grep ${netid} | cut -d' ' -f1) |
| 34 | echo "# image_ref_name -> ${cirros51_name}" |
| 35 | sed -i "s/image_ref_name/${cirros51_name}/g" $MY_PROJFOLDER/yamls/tempest_custom.yaml |
Alex | a0053b9 | 2022-10-14 16:38:28 -0500 | [diff] [blame] | 36 | echo "# image_ref_uuid -> ${cirros51_id}" |
| 37 | sed -i "s/image_ref_uuid/${cirros51_id}/g" $MY_PROJFOLDER/yamls/tempest_custom.yaml |
| 38 | echo "# image_ref_alt_uuid -> ${cirros52_id}" |
| 39 | sed -i "s/image_ref_alt_uuid/${cirros52_id}/g" $MY_PROJFOLDER/yamls/tempest_custom.yaml |
| 40 | echo "# s/public_subnet_uuid/ -> ${subnetid}" |
| 41 | sed -i "s/public_subnet_uuid/${subnetid}/g" $MY_PROJFOLDER/yamls/tempest_custom.yaml |
| 42 | echo "# s/public_net_uuid/ -> ${netid}" |
| 43 | sed -i "s/public_net_uuid/${netid}/g" $MY_PROJFOLDER/yamls/tempest_custom.yaml |
| 44 | echo "# s/public_net_name/ -> ${TEMPEST_CUSTOM_PUBLIC_NET}" |
| 45 | sed -i "s/public_net_name/${TEMPEST_CUSTOM_PUBLIC_NET}/g" $MY_PROJFOLDER/yamls/tempest_custom.yaml |
Alex | 3594573 | 2023-04-07 10:03:59 -0500 | [diff] [blame] | 46 | echo "# s/volume_type_name/ -> ${TEMPEST_CUSTOM_VOLUME_TYPE}" |
| 47 | sed -i "s/volume_type_name/${TEMPEST_CUSTOM_VOLUME_TYPE}/g" $MY_PROJFOLDER/yamls/tempest_custom.yaml |
Alex | 2c8b880 | 2022-10-20 14:07:15 -0500 | [diff] [blame] | 48 | echo " " |
Alex | a0053b9 | 2022-10-14 16:38:28 -0500 | [diff] [blame] | 49 | |
Alex | 2c8b880 | 2022-10-20 14:07:15 -0500 | [diff] [blame] | 50 | echo "# Updating SPT global_config.yaml" |
| 51 | cp -v /opt/res-files/k8s/yamls/spt_global_config.yaml.clean $MY_PROJFOLDER/yamls/global_config.yaml |
Alex | c85212b | 2022-11-08 12:27:01 -0600 | [diff] [blame] | 52 | echo "# image_ref_name -> ${ubuntu20_name}" |
| 53 | sed -i "s/image_ref_name/${ubuntu20_name}/g" $MY_PROJFOLDER/yamls/global_config.yaml |
Alex | 2c8b880 | 2022-10-20 14:07:15 -0500 | [diff] [blame] | 54 | echo "# s/public-network-name/ -> ${TEMPEST_CUSTOM_PUBLIC_NET}" |
| 55 | sed -i "s/public-network-name/${TEMPEST_CUSTOM_PUBLIC_NET}/g" $MY_PROJFOLDER/yamls/global_config.yaml |
| 56 | echo "# s/mtu-value/ -> default" |
| 57 | sed -i "s/mtu-value/default/g" $MY_PROJFOLDER/yamls/global_config.yaml |
Alex | a0053b9 | 2022-10-14 16:38:28 -0500 | [diff] [blame] | 58 | # |
| 59 | echo "# Done!" |