blob: c8745d2eda53dbe8f0df0e4381717722fe4562b2 [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"
29cp -v /opt/res-files/k8s/yamls/tempest_custom.yaml.clean $MY_PROJFOLDER/yamls/tempest_custom.yaml
30declare $(kubectl exec toolset --stdin -n qa-space -- bash -c "cat /artifacts/cmp-check/cvp.manifest")
31echo "# Getting network details"
32netid=$(kubectl exec toolset --stdin -n qa-space -- openstack network show ${TEMPEST_CUSTOM_PUBLIC_NET} -c id -f value)
Alexc85212b2022-11-08 12:27:01 -060033subnetid=$(kubectl exec toolset --stdin -n qa-space -- openstack subnet list -f value | grep ${netid} | cut -d' ' -f1)
34echo "# image_ref_name -> ${cirros51_name}"
35sed -i "s/image_ref_name/${cirros51_name}/g" $MY_PROJFOLDER/yamls/tempest_custom.yaml
Alexa0053b92022-10-14 16:38:28 -050036echo "# image_ref_uuid -> ${cirros51_id}"
37sed -i "s/image_ref_uuid/${cirros51_id}/g" $MY_PROJFOLDER/yamls/tempest_custom.yaml
38echo "# image_ref_alt_uuid -> ${cirros52_id}"
39sed -i "s/image_ref_alt_uuid/${cirros52_id}/g" $MY_PROJFOLDER/yamls/tempest_custom.yaml
40echo "# s/public_subnet_uuid/ -> ${subnetid}"
41sed -i "s/public_subnet_uuid/${subnetid}/g" $MY_PROJFOLDER/yamls/tempest_custom.yaml
42echo "# s/public_net_uuid/ -> ${netid}"
43sed -i "s/public_net_uuid/${netid}/g" $MY_PROJFOLDER/yamls/tempest_custom.yaml
44echo "# s/public_net_name/ -> ${TEMPEST_CUSTOM_PUBLIC_NET}"
45sed -i "s/public_net_name/${TEMPEST_CUSTOM_PUBLIC_NET}/g" $MY_PROJFOLDER/yamls/tempest_custom.yaml
Alex35945732023-04-07 10:03:59 -050046echo "# s/volume_type_name/ -> ${TEMPEST_CUSTOM_VOLUME_TYPE}"
47sed -i "s/volume_type_name/${TEMPEST_CUSTOM_VOLUME_TYPE}/g" $MY_PROJFOLDER/yamls/tempest_custom.yaml
Alex2c8b8802022-10-20 14:07:15 -050048echo " "
Alexa0053b92022-10-14 16:38:28 -050049
Alex2c8b8802022-10-20 14:07:15 -050050echo "# Updating SPT global_config.yaml"
51cp -v /opt/res-files/k8s/yamls/spt_global_config.yaml.clean $MY_PROJFOLDER/yamls/global_config.yaml
Alexc85212b2022-11-08 12:27:01 -060052echo "# image_ref_name -> ${ubuntu20_name}"
53sed -i "s/image_ref_name/${ubuntu20_name}/g" $MY_PROJFOLDER/yamls/global_config.yaml
Alex2c8b8802022-10-20 14:07:15 -050054echo "# s/public-network-name/ -> ${TEMPEST_CUSTOM_PUBLIC_NET}"
55sed -i "s/public-network-name/${TEMPEST_CUSTOM_PUBLIC_NET}/g" $MY_PROJFOLDER/yamls/global_config.yaml
56echo "# s/mtu-value/ -> default"
57sed -i "s/mtu-value/default/g" $MY_PROJFOLDER/yamls/global_config.yaml
Alexa0053b92022-10-14 16:38:28 -050058#
59echo "# Done!"