diff --git a/etc/evergreen_yml_components/definitions.yml b/etc/evergreen_yml_components/definitions.yml index a7cb98f39f6..a7fd660f6b5 100644 --- a/etc/evergreen_yml_components/definitions.yml +++ b/etc/evergreen_yml_components/definitions.yml @@ -2439,6 +2439,16 @@ functions: binary: bash args: - "./src/evergreen/external_auth_gcp_teardown.sh" + - command: subprocess.exec + params: + binary: bash + args: + - "./src/evergreen/external_auth_azure_teardown.sh" + - command: subprocess.exec + params: + binary: bash + args: + - "./src/evergreen/external_auth_oidc_teardown.sh" "do scons setup": - command: manifest.load diff --git a/etc/evergreen_yml_components/tasks/resmoke/server_divisions/clusters_and_integrations/tasks.yml b/etc/evergreen_yml_components/tasks/resmoke/server_divisions/clusters_and_integrations/tasks.yml index 0c685e80248..ded6806f6bf 100644 --- a/etc/evergreen_yml_components/tasks/resmoke/server_divisions/clusters_and_integrations/tasks.yml +++ b/etc/evergreen_yml_components/tasks/resmoke/server_divisions/clusters_and_integrations/tasks.yml @@ -797,11 +797,6 @@ tasks: args: - "src/evergreen/external_auth_azure_setup.sh" - func: "run tests" - - command: subprocess.exec - params: - binary: bash - args: - - "src/evergreen/external_auth_azure_teardown.sh" - <<: *task_template name: external_auth_oidc_gcp diff --git a/evergreen/external_auth_azure_teardown.sh b/evergreen/external_auth_azure_teardown.sh index 81d547f21ac..a62cb65a02d 100644 --- a/evergreen/external_auth_azure_teardown.sh +++ b/evergreen/external_auth_azure_teardown.sh @@ -1,6 +1,25 @@ DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" > /dev/null 2>&1 && pwd)" . "$DIR/prelude.sh" +# Only run this script for the external_auth_oidc_azure task. +if [ "${task_name}" != "external_auth_oidc_azure" ]; then + exit 0 +fi + +echo "Cleaning up Azure OIDC test artifacts" + cd src +# Clean up the SSH keyfile, if it exists +if [ -f "${HOME}/oidc_azure_container_key" ]; then + rm -f $HOME/oidc_azure_container_key + 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 + +# 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 diff --git a/evergreen/external_auth_gcp_teardown.sh b/evergreen/external_auth_gcp_teardown.sh index 95018846bde..f6e72fcf77f 100755 --- a/evergreen/external_auth_gcp_teardown.sh +++ b/evergreen/external_auth_gcp_teardown.sh @@ -10,6 +10,8 @@ if [ "${task_name}" != "external_auth_oidc_gcp" ]; then exit 0 fi +echo "Cleaning up OIDC GCP test artifacts" + # Delete the GCP VM specified in gce_vm_info.json if GOOGLE_APPLICATION_CREDENTIALS is set, points # to a file, and the GCE config and VM info files exist. if [ ! -z "${GOOGLE_APPLICATION_CREDENTIALS}" ] \ diff --git a/evergreen/external_auth_oidc_teardown.sh b/evergreen/external_auth_oidc_teardown.sh new file mode 100644 index 00000000000..5216e93c6c9 --- /dev/null +++ b/evergreen/external_auth_oidc_teardown.sh @@ -0,0 +1,15 @@ +DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" > /dev/null 2>&1 && pwd)" +. "$DIR/prelude.sh" + +# Only run this script for the external_auth_oidc_azure task. +if [ "${task_name}" != "external_auth_oidc" ]; then + exit 0 +fi + +echo "Cleaning up OIDC Okta test artifacts" + +#Clean up the config file, if it exists +if [ -f "${HOME}/oidc_e2e_setup.json" ]; then + rm -f $HOME/oidc_e2e_setup.json + echo "Cleaned up oidc_e2e_setup.json" +fi