aboutsummaryrefslogtreecommitdiffstats
path: root/test-apis-ci/sdc-api-tests/startup.sh
diff options
context:
space:
mode:
Diffstat (limited to 'test-apis-ci/sdc-api-tests/startup.sh')
-rw-r--r--test-apis-ci/sdc-api-tests/startup.sh19
1 files changed, 19 insertions, 0 deletions
diff --git a/test-apis-ci/sdc-api-tests/startup.sh b/test-apis-ci/sdc-api-tests/startup.sh
index 80faeeac2e..7b102cadfd 100644
--- a/test-apis-ci/sdc-api-tests/startup.sh
+++ b/test-apis-ci/sdc-api-tests/startup.sh
@@ -1,5 +1,24 @@
#!/bin/bash
+# prepare env for HTTPS if used
+
+is_https=$(cat /root/chef-solo/environments/${ENVNAME}.json | \
+ jq -cr '.default_attributes.disableHttp' | \
+ tr '[:upper:]' '[:lower:]')
+
+if [ "$is_https" = true ] ; then
+ # setup /etc/hosts
+ SDC_FE_IP=$(cat /root/chef-solo/environments/${ENVNAME}.json | \
+ jq -cr '.default_attributes.Nodes.FE')
+ SDC_FE_HOSTNAME=$(cat /root/chef-solo/environments/${ENVNAME}.json | \
+ jq -cr '.override_attributes.FE.domain_name')
+ if ! grep -q "^[[:space:]]*${SDC_FE_IP}[[:space:]]" ; then
+ echo "${SDC_FE_IP}" "${SDC_FE_HOSTNAME}" >> /etc/hosts
+ fi
+fi
+
+# run tests
+
cd /root/chef-solo
chef-solo -c solo.rb -E ${ENVNAME}