diff --git a/evergreen/external_auth_azure_setup.sh b/evergreen/external_auth_azure_setup.sh index 7adfbe4ade7..76909fbe7d5 100644 --- a/evergreen/external_auth_azure_setup.sh +++ b/evergreen/external_auth_azure_setup.sh @@ -44,4 +44,4 @@ ls -al $HOME/azure_remote_key # This script enables ingress on the Azure Container App instance that we will use to obtain our managed identity token, # restrict ingress to the local, publicly-facing IP of the host we are running on, and then output the hostname of the container app into a local file # so that it can be dynamically consumed by subsequent test steps (such as get_token.py) -python src/mongo/db/modules/enterprise/jstests/external_auth_oidc_azure/lib/toggle_ingress.py enable --config_file=$HOME/azure_e2e_config.json --debug | tee $HOME/azure_remote_host +python src/mongo/db/modules/enterprise/jstests/external_auth_oidc_azure/lib/toggle_ingress.py enable --config_file=$HOME/azure_e2e_config.json --lock_file=/tmp/azure_oidc.lock | tee $HOME/azure_remote_host diff --git a/evergreen/external_auth_azure_teardown.sh b/evergreen/external_auth_azure_teardown.sh index a62cb65a02d..03b8e7ce0d6 100644 --- a/evergreen/external_auth_azure_teardown.sh +++ b/evergreen/external_auth_azure_teardown.sh @@ -1,6 +1,8 @@ DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" > /dev/null 2>&1 && pwd)" . "$DIR/prelude.sh" +set -o errexit + # Only run this script for the external_auth_oidc_azure task. if [ "${task_name}" != "external_auth_oidc_azure" ]; then exit 0 @@ -16,10 +18,16 @@ if [ -f "${HOME}/oidc_azure_container_key" ]; then echo "Cleaned up container key" fi -python src/mongo/db/modules/enterprise/jstests/external_auth_oidc_azure/lib/toggle_ingress.py disable --config_file=$HOME/azure_e2e_config.json +python src/mongo/db/modules/enterprise/jstests/external_auth_oidc_azure/lib/toggle_ingress.py disable --config_file=$HOME/azure_e2e_config.json --lock_file=/tmp/azure_oidc.lock # Clean up the config file, if it exists if [ -f "${HOME}/azure_e2e_config.json" ]; then rm -f $HOME/azure_e2e_config.json echo "Cleaned up azure_e2e_config.json" fi + +# Clean up the lock file, if it exists +if [ -f "/tmp/azure_oidc.lock" ]; then + rm -f /tmp/azure_oidc.lock + echo "Cleaned up /tmp/azure_oidc.lock" +fi