blob: 199816943f17b1585b686944ee5906499f86db81 [file] [log] [blame]
Alexa0053b92022-10-14 16:38:28 -05001#!/bin/bash
2if [ -z ${TEMPEST_CUSTOM_PUBLIC_NET+x} ]; then
3 echo "# WARNING: Public network is empty"
4fi
5# mosrc
6. $MY_PROJFOLDER/envs/mosrc
7
8##
9echo "### Checking openstack resources"
10status=$(kubectl -n qa-space get pod | grep toolset | tr -s " " | cut -d' ' -f3)
11if [ ${status} != "Running" ]; then
12 echo "# 'toolset' container is not Running"
13 exit 1
14fi
15if [ ! -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"
19else
20 echo "# Creating openstack resources"
21 echo " "
22 kubectl exec toolset --stdin -n qa-space -- bash -c "mkdir /artifacts/cmp-check"
Alex2c8b8802022-10-20 14:07:15 -050023 kubectl exec toolset --tty --stdin -n qa-space -- bash -c "cd /artifacts/cmp-check; bash /opt/cmp-check/prepare.sh -w \$(pwd)"
Alexa0053b92022-10-14 16:38:28 -050024fi
25
26#
27echo " "
28echo "# Filling tempest_custom.yaml"
Ievgeniia Zadorozhnadd2a1252024-01-24 23:42:42 +010029# TODO: set the correct availability_zone in case nova is not used (now nova is default option)
Alexa0053b92022-10-14 16:38:28 -050030cp -v /opt/res-files/k8s/yamls/tempest_custom.yaml.clean $MY_PROJFOLDER/yamls/tempest_custom.yaml
31declare $(kubectl exec toolset --stdin -n qa-space -- bash -c "cat /artifacts/cmp-check/cvp.manifest")
32echo "# Getting network details"
33netid=$(kubectl exec toolset --stdin -n qa-space -- openstack network show ${TEMPEST_CUSTOM_PUBLIC_NET} -c id -f value)
Alexc85212b2022-11-08 12:27:01 -060034subnetid=$(kubectl exec toolset --stdin -n qa-space -- openstack subnet list -f value | grep ${netid} | cut -d' ' -f1)
Ievgeniia Zadorozhna1cb5b102024-01-19 04:31:09 +010035echo "# image_ref_name -> ${cirros61_name}"
36sed -i "s/image_ref_name/${cirros61_name}/g" $MY_PROJFOLDER/yamls/tempest_custom.yaml
37echo "# image_ref_uuid -> ${cirros61_id}"
38sed -i "s/image_ref_uuid/${cirros61_id}/g" $MY_PROJFOLDER/yamls/tempest_custom.yaml
39echo "# image_ref_alt_uuid -> ${cirros62_id}"
40sed -i "s/image_ref_alt_uuid/${cirros62_id}/g" $MY_PROJFOLDER/yamls/tempest_custom.yaml
Alexa0053b92022-10-14 16:38:28 -050041echo "# s/public_subnet_uuid/ -> ${subnetid}"
42sed -i "s/public_subnet_uuid/${subnetid}/g" $MY_PROJFOLDER/yamls/tempest_custom.yaml
43echo "# s/public_net_uuid/ -> ${netid}"
44sed -i "s/public_net_uuid/${netid}/g" $MY_PROJFOLDER/yamls/tempest_custom.yaml
45echo "# s/public_net_name/ -> ${TEMPEST_CUSTOM_PUBLIC_NET}"
46sed -i "s/public_net_name/${TEMPEST_CUSTOM_PUBLIC_NET}/g" $MY_PROJFOLDER/yamls/tempest_custom.yaml
Alex35945732023-04-07 10:03:59 -050047echo "# s/volume_type_name/ -> ${TEMPEST_CUSTOM_VOLUME_TYPE}"
48sed -i "s/volume_type_name/${TEMPEST_CUSTOM_VOLUME_TYPE}/g" $MY_PROJFOLDER/yamls/tempest_custom.yaml
Alex2c8b8802022-10-20 14:07:15 -050049echo " "
Alexa0053b92022-10-14 16:38:28 -050050
Alex2c8b8802022-10-20 14:07:15 -050051echo "# Updating SPT global_config.yaml"
52cp -v /opt/res-files/k8s/yamls/spt_global_config.yaml.clean $MY_PROJFOLDER/yamls/global_config.yaml
Alexc85212b2022-11-08 12:27:01 -060053echo "# image_ref_name -> ${ubuntu20_name}"
54sed -i "s/image_ref_name/${ubuntu20_name}/g" $MY_PROJFOLDER/yamls/global_config.yaml
Alex2c8b8802022-10-20 14:07:15 -050055echo "# s/public-network-name/ -> ${TEMPEST_CUSTOM_PUBLIC_NET}"
56sed -i "s/public-network-name/${TEMPEST_CUSTOM_PUBLIC_NET}/g" $MY_PROJFOLDER/yamls/global_config.yaml
Alexa0053b92022-10-14 16:38:28 -050057#
58echo "# Done!"