From c3907ee73d726130d126860a8c0f34556eb82b4a Mon Sep 17 00:00:00 2001 From: Nikolas Rieble Date: Wed, 4 Sep 2024 20:56:15 +0200 Subject: [PATCH] Chore: Remove module tests --- .github/workflows/auto.yml | 9 - .github/workflows/dispatcher.yml | 28 --- .github/workflows/handler-destroy.yml | 214 ---------------- .github/workflows/handler-help.yml | 43 ---- .github/workflows/handler-test.yml | 234 ------------------ tests/private-active-active/README.md | 35 --- tests/private-active-active/data.tf | 21 -- tests/private-active-active/locals.tf | 17 -- tests/private-active-active/main.tf | 74 ------ tests/private-active-active/outputs.tf | 44 ---- tests/private-active-active/providers.tf | 7 - tests/private-active-active/run-tests.sh | 108 -------- tests/private-active-active/variables.tf | 79 ------ tests/private-active-active/versions.tf | 29 --- tests/private-tcp-active-active/README.md | 35 --- tests/private-tcp-active-active/data.tf | 21 -- tests/private-tcp-active-active/locals.tf | 17 -- tests/private-tcp-active-active/main.tf | 78 ------ tests/private-tcp-active-active/outputs.tf | 44 ---- tests/private-tcp-active-active/providers.tf | 7 - tests/private-tcp-active-active/run-tests.sh | 117 --------- tests/private-tcp-active-active/variables.tf | 79 ------ tests/private-tcp-active-active/versions.tf | 29 --- tests/public-active-active/README.md | 35 --- tests/public-active-active/data.tf | 16 -- tests/public-active-active/locals.tf | 6 - tests/public-active-active/main.tf | 69 ------ tests/public-active-active/outputs.tf | 32 --- tests/public-active-active/providers.tf | 7 - tests/public-active-active/run-tests.sh | 102 -------- tests/public-active-active/variables.tf | 87 ------- tests/public-active-active/versions.tf | 29 --- .../README.md | 27 -- .../standalone-external-rhel8-worker/data.tf | 41 --- .../locals.tf | 16 -- .../standalone-external-rhel8-worker/main.tf | 112 --------- .../outputs.tf | 58 ----- .../providers.tf | 7 - .../run-tests.sh | 100 -------- .../templates/ssh-config.tpl | 11 - .../variables.tf | 78 ------ .../versions.tf | 44 ---- tests/standalone-mounted-disk/README.md | 24 -- tests/standalone-mounted-disk/data.tf | 39 --- tests/standalone-mounted-disk/locals.tf | 18 -- tests/standalone-mounted-disk/main.tf | 94 ------- tests/standalone-mounted-disk/outputs.tf | 58 ----- tests/standalone-mounted-disk/providers.tf | 7 - tests/standalone-mounted-disk/run-tests.sh | 100 -------- .../templates/ssh-config.tpl | 11 - tests/standalone-mounted-disk/variables.tf | 79 ------ tests/standalone-mounted-disk/versions.tf | 39 --- 52 files changed, 2715 deletions(-) delete mode 100644 .github/workflows/dispatcher.yml delete mode 100644 .github/workflows/handler-destroy.yml delete mode 100644 .github/workflows/handler-help.yml delete mode 100644 .github/workflows/handler-test.yml delete mode 100644 tests/private-active-active/README.md delete mode 100644 tests/private-active-active/data.tf delete mode 100644 tests/private-active-active/locals.tf delete mode 100644 tests/private-active-active/main.tf delete mode 100644 tests/private-active-active/outputs.tf delete mode 100644 tests/private-active-active/providers.tf delete mode 100644 tests/private-active-active/run-tests.sh delete mode 100644 tests/private-active-active/variables.tf delete mode 100644 tests/private-active-active/versions.tf delete mode 100644 tests/private-tcp-active-active/README.md delete mode 100644 tests/private-tcp-active-active/data.tf delete mode 100644 tests/private-tcp-active-active/locals.tf delete mode 100644 tests/private-tcp-active-active/main.tf delete mode 100644 tests/private-tcp-active-active/outputs.tf delete mode 100644 tests/private-tcp-active-active/providers.tf delete mode 100644 tests/private-tcp-active-active/run-tests.sh delete mode 100644 tests/private-tcp-active-active/variables.tf delete mode 100644 tests/private-tcp-active-active/versions.tf delete mode 100644 tests/public-active-active/README.md delete mode 100644 tests/public-active-active/data.tf delete mode 100644 tests/public-active-active/locals.tf delete mode 100644 tests/public-active-active/main.tf delete mode 100644 tests/public-active-active/outputs.tf delete mode 100644 tests/public-active-active/providers.tf delete mode 100644 tests/public-active-active/run-tests.sh delete mode 100644 tests/public-active-active/variables.tf delete mode 100644 tests/public-active-active/versions.tf delete mode 100644 tests/standalone-external-rhel8-worker/README.md delete mode 100644 tests/standalone-external-rhel8-worker/data.tf delete mode 100644 tests/standalone-external-rhel8-worker/locals.tf delete mode 100644 tests/standalone-external-rhel8-worker/main.tf delete mode 100644 tests/standalone-external-rhel8-worker/outputs.tf delete mode 100644 tests/standalone-external-rhel8-worker/providers.tf delete mode 100644 tests/standalone-external-rhel8-worker/run-tests.sh delete mode 100644 tests/standalone-external-rhel8-worker/templates/ssh-config.tpl delete mode 100644 tests/standalone-external-rhel8-worker/variables.tf delete mode 100644 tests/standalone-external-rhel8-worker/versions.tf delete mode 100644 tests/standalone-mounted-disk/README.md delete mode 100644 tests/standalone-mounted-disk/data.tf delete mode 100644 tests/standalone-mounted-disk/locals.tf delete mode 100644 tests/standalone-mounted-disk/main.tf delete mode 100644 tests/standalone-mounted-disk/outputs.tf delete mode 100644 tests/standalone-mounted-disk/providers.tf delete mode 100644 tests/standalone-mounted-disk/run-tests.sh delete mode 100644 tests/standalone-mounted-disk/templates/ssh-config.tpl delete mode 100644 tests/standalone-mounted-disk/variables.tf delete mode 100644 tests/standalone-mounted-disk/versions.tf diff --git a/.github/workflows/auto.yml b/.github/workflows/auto.yml index 2d2b3087..78cd8f87 100644 --- a/.github/workflows/auto.yml +++ b/.github/workflows/auto.yml @@ -72,15 +72,6 @@ jobs: ${{ github.workspace }}/${m} done - - name: Lint tests directory in a loop - run: | - for m in $(ls -1d tests/*/) - do - tflint \ - --config ${{ github.workspace }}/.tflint.hcl \ - ${{ github.workspace }}/${m} - done - - name: Lint examples directory in a loop run: | for m in $(ls -1d examples/*/) diff --git a/.github/workflows/dispatcher.yml b/.github/workflows/dispatcher.yml deleted file mode 100644 index 15628fd3..00000000 --- a/.github/workflows/dispatcher.yml +++ /dev/null @@ -1,28 +0,0 @@ -name: Pull Request Dispatcher - -on: - issue_comment: - types: - - created - -jobs: - slash_command_dispatch: - name: Slash Command Dispatcher - runs-on: ubuntu-latest - permissions: - pull-requests: write - steps: - - name: Slash Command Dispatch - uses: peter-evans/slash-command-dispatch@13bc09769d122a64f75aa5037256f6f2d78be8c4 # v4.0.0 - with: - # The `public_repo` scope is required by this token to create repository_dispatch and workflow_dispatch - # events on public repositories. The default GITHUB_TOKEN does not support the `public_repo` scope. - token: ${{ secrets.GH_DISPATCH_TOKEN }} - reaction-token: ${{ secrets.GITHUB_TOKEN }} - commands: | - test - destroy - help - permission: maintain - issue-type: pull-request - event-type-suffix: -command diff --git a/.github/workflows/handler-destroy.yml b/.github/workflows/handler-destroy.yml deleted file mode 100644 index 6ad6149c..00000000 --- a/.github/workflows/handler-destroy.yml +++ /dev/null @@ -1,214 +0,0 @@ -name: Pull Request Destroy Handler - -on: - repository_dispatch: - types: - - destroy-command - -env: - GOOGLE_CREDENTIALS: ${{ secrets.GOOGLE_CREDENTIALS }} - GOOGLE_PROJECT: ${{ secrets.GOOGLE_PROJECT }} - GOOGLE_REGION: ${{ secrets.GOOGLE_REGION }} - GOOGLE_ZONE: ${{ secrets.GOOGLE_ZONE }} - -jobs: - public_active_active: - uses: hashicorp/terraform-random-tfe-utility/.github/workflows/destroy.yml@main - secrets: inherit - name: Public Active/Active - if: ${{ github.event.client_payload.slash_command.args.unnamed.all == 'all' || github.event.client_payload.slash_command.args.unnamed.all == 'public-active-active' }} - with: - cloud: Google - test_name: Public Active/Active - is_replicated_deployment: false - module_repository_id: hashicorp/terraform-google-terraform-enterprise - work_dir: ./tests/public-active-active - utility_test: false - pull_request_repo_name: ${{ github.event.client_payload.github.payload.repository.full_name }} - pull_request_ref: ${{ github.event.client_payload.pull_request.head.sha }} - pull_request_comment_id: ${{ github.event.client_payload.github.payload.comment.id }} - TFC_token_secret_name: PUBLIC_ACTIVE_ACTIVE_TFC_TOKEN - - private_active_active: - uses: hashicorp/terraform-random-tfe-utility/.github/workflows/destroy.yml@main - secrets: inherit - name: Private Active/Active - if: ${{ github.event.client_payload.slash_command.args.unnamed.all == 'all' || github.event.client_payload.slash_command.args.unnamed.all == 'private-active-active' }} - with: - cloud: Google - test_name: Private Active/Active - utility_test: false - is_replicated_deployment: false - module_repository_id: hashicorp/terraform-google-terraform-enterprise - work_dir: ./tests/private-active-active - pull_request_repo_name: ${{ github.event.client_payload.github.payload.repository.full_name }} - pull_request_ref: ${{ github.event.client_payload.pull_request.head.sha }} - pull_request_comment_id: ${{ github.event.client_payload.github.payload.comment.id }} - TFC_token_secret_name: PRIVATE_ACTIVE_ACTIVE_TFC_TOKEN - - private_tcp_active_active: - uses: hashicorp/terraform-random-tfe-utility/.github/workflows/destroy.yml@main - secrets: inherit - name: Private TCP Active/Active - if: ${{ github.event.client_payload.slash_command.args.unnamed.all == 'all' || github.event.client_payload.slash_command.args.unnamed.all == 'private-tcp-active-active' }} - with: - cloud: Google - test_name: Private TCP Active/Active - utility_test: false - is_replicated_deployment: false - module_repository_id: hashicorp/terraform-google-terraform-enterprise - work_dir: ./tests/private-tcp-active-active - pull_request_repo_name: ${{ github.event.client_payload.github.payload.repository.full_name }} - pull_request_ref: ${{ github.event.client_payload.pull_request.head.sha }} - pull_request_comment_id: ${{ github.event.client_payload.github.payload.comment.id }} - TFC_token_secret_name: PRIVATE_TCP_ACTIVE_ACTIVE_TFC_TOKEN - - standalone_external_rhel8_worker: - uses: hashicorp/terraform-random-tfe-utility/.github/workflows/destroy.yml@main - secrets: inherit - name: Standalone External Rhel8 Worker - if: ${{ github.event.client_payload.slash_command.args.unnamed.all == 'all' || github.event.client_payload.slash_command.args.unnamed.all == 'standalone-external-rhel8-worker' }} - with: - cloud: Google - test_name: Standalone External Rhel8 Worker - is_replicated_deployment: false - module_repository_id: hashicorp/terraform-google-terraform-enterprise - work_dir: ./tests/standalone-external-rhel8-worker - utility_test: false - pull_request_repo_name: ${{ github.event.client_payload.github.payload.repository.full_name }} - pull_request_ref: ${{ github.event.client_payload.pull_request.head.sha }} - pull_request_comment_id: ${{ github.event.client_payload.github.payload.comment.id }} - TFC_token_secret_name: STANDALONE_EXTERNAL_RHEL8_WORKER_TFC_TOKEN - TFC_workspace_substitution_pattern: 's/terraform {/terraform {\n\ - backend "remote" {\n\ - organization = "terraform-enterprise-modules-test"\n\ - workspaces {\n\ - name = "google-standalone-external-rhel8-worker"\n\ - }\n\ - }\n/' - - standalone_mounted_disk: - uses: hashicorp/terraform-random-tfe-utility/.github/workflows/destroy.yml@main - secrets: inherit - name: Standalone Mounted Disk - if: ${{ github.event.client_payload.slash_command.args.unnamed.all == 'all' || github.event.client_payload.slash_command.args.unnamed.all == 'standalone-mounted-disk' }} - with: - cloud: Google - test_name: Standalone Mounted Disk - is_replicated_deployment: false - module_repository_id: hashicorp/terraform-google-terraform-enterprise - work_dir: ./tests/standalone-mounted-disk - utility_test: false - pull_request_repo_name: ${{ github.event.client_payload.github.payload.repository.full_name }} - pull_request_ref: ${{ github.event.client_payload.pull_request.head.sha }} - pull_request_comment_id: ${{ github.event.client_payload.github.payload.comment.id }} - TFC_token_secret_name: STANDALONE_MOUNTED_DISK_TFC_TOKEN - TFC_workspace_substitution_pattern: 's/terraform {/terraform {\n\ - backend "remote" {\n\ - organization = "terraform-enterprise-modules-test"\n\ - workspaces {\n\ - name = "google-standalone-mounted-disk"\n\ - }\n\ - }\n/' - - public_active_active_replicated: - uses: hashicorp/terraform-random-tfe-utility/.github/workflows/destroy.yml@main - secrets: inherit - name: Public Active/Active - if: ${{ github.event.client_payload.slash_command.args.unnamed.all == 'all' || github.event.client_payload.slash_command.args.unnamed.all == 'public-active-active-replicated' }} - with: - cloud: Google - test_name: Public Active/Active - is_replicated_deployment: true - module_repository_id: hashicorp/terraform-google-terraform-enterprise - work_dir: ./tests/public-active-active - utility_test: false - pull_request_repo_name: ${{ github.event.client_payload.github.payload.repository.full_name }} - pull_request_ref: ${{ github.event.client_payload.pull_request.head.sha }} - pull_request_comment_id: ${{ github.event.client_payload.github.payload.comment.id }} - TFC_token_secret_name: PUBLIC_ACTIVE_ACTIVE_REPLICATED_TFC_TOKEN - TFC_workspace_substitution_pattern: s/google-public-active-active/google-public-active-active-replicated/ - - private_active_active_replicated: - uses: hashicorp/terraform-random-tfe-utility/.github/workflows/destroy.yml@main - secrets: inherit - name: Private Active/Active - if: ${{ github.event.client_payload.slash_command.args.unnamed.all == 'all' || github.event.client_payload.slash_command.args.unnamed.all == 'private-active-active-replicated' }} - with: - cloud: Google - test_name: Private Active/Active - utility_test: false - is_replicated_deployment: true - module_repository_id: hashicorp/terraform-google-terraform-enterprise - work_dir: ./tests/private-active-active - pull_request_repo_name: ${{ github.event.client_payload.github.payload.repository.full_name }} - pull_request_ref: ${{ github.event.client_payload.pull_request.head.sha }} - pull_request_comment_id: ${{ github.event.client_payload.github.payload.comment.id }} - TFC_token_secret_name: PRIVATE_ACTIVE_ACTIVE_REPLICATED_TFC_TOKEN - TFC_workspace_substitution_pattern: s/google-private-active-active/google-private-active-active-replicated/ - - private_tcp_active_active_replicated: - uses: hashicorp/terraform-random-tfe-utility/.github/workflows/destroy.yml@main - secrets: inherit - name: Private TCP Active/Active - if: ${{ github.event.client_payload.slash_command.args.unnamed.all == 'all' || github.event.client_payload.slash_command.args.unnamed.all == 'private-tcp-active-active-replicated' }} - with: - cloud: Google - test_name: Private TCP Active/Active - utility_test: false - is_replicated_deployment: true - module_repository_id: hashicorp/terraform-google-terraform-enterprise - work_dir: ./tests/private-tcp-active-active - pull_request_repo_name: ${{ github.event.client_payload.github.payload.repository.full_name }} - pull_request_ref: ${{ github.event.client_payload.pull_request.head.sha }} - pull_request_comment_id: ${{ github.event.client_payload.github.payload.comment.id }} - TFC_token_secret_name: PRIVATE_TCP_ACTIVE_ACTIVE_REPLICATED_TFC_TOKEN - TFC_workspace_substitution_pattern: s/google-private-tcp-active-active/google-private-tcp-active-active-replicated/ - - standalone_external_rhel8_worker_replicated: - uses: hashicorp/terraform-random-tfe-utility/.github/workflows/destroy.yml@main - secrets: inherit - name: Standalone External Rhel8 Worker - if: ${{ github.event.client_payload.slash_command.args.unnamed.all == 'all' || github.event.client_payload.slash_command.args.unnamed.all == 'standalone-external-rhel8-worker-replicated' }} - with: - cloud: Google - test_name: Standalone External Rhel8 Worker - is_replicated_deployment: true - module_repository_id: hashicorp/terraform-google-terraform-enterprise - work_dir: ./tests/standalone-external-rhel8-worker - utility_test: false - pull_request_repo_name: ${{ github.event.client_payload.github.payload.repository.full_name }} - pull_request_ref: ${{ github.event.client_payload.pull_request.head.sha }} - pull_request_comment_id: ${{ github.event.client_payload.github.payload.comment.id }} - TFC_token_secret_name: STANDALONE_EXTERNAL_RHEL8_WORKER_REPLICATED_TFC_TOKEN - TFC_workspace_substitution_pattern: 's/terraform {/terraform {\n\ - backend "remote" {\n\ - organization = "terraform-enterprise-modules-test"\n\ - workspaces {\n\ - name = "google-standalone-external-rhel8-worker-replicated"\n\ - }\n\ - }\n/' - - standalone_mounted_disk_replicated: - uses: hashicorp/terraform-random-tfe-utility/.github/workflows/destroy.yml@main - secrets: inherit - name: Standalone Mounted Disk - if: ${{ github.event.client_payload.slash_command.args.unnamed.all == 'all' || github.event.client_payload.slash_command.args.unnamed.all == 'standalone-mounted-disk-replicated' }} - with: - cloud: Google - test_name: Standalone Mounted Disk - is_replicated_deployment: true - module_repository_id: hashicorp/terraform-google-terraform-enterprise - work_dir: ./tests/standalone-mounted-disk - utility_test: false - pull_request_repo_name: ${{ github.event.client_payload.github.payload.repository.full_name }} - pull_request_ref: ${{ github.event.client_payload.pull_request.head.sha }} - pull_request_comment_id: ${{ github.event.client_payload.github.payload.comment.id }} - TFC_token_secret_name: STANDALONE_MOUNTED_DISK_REPLICATED_TFC_TOKEN - TFC_workspace_substitution_pattern: 's/terraform {/terraform {\n\ - backend "remote" {\n\ - organization = "terraform-enterprise-modules-test"\n\ - workspaces {\n\ - name = "google-standalone-mounted-disk-replicated"\n\ - }\n\ - }\n/' diff --git a/.github/workflows/handler-help.yml b/.github/workflows/handler-help.yml deleted file mode 100644 index d5a128e6..00000000 --- a/.github/workflows/handler-help.yml +++ /dev/null @@ -1,43 +0,0 @@ -name: Pull Request Help Handler - -on: - repository_dispatch: - types: - - help-command - -jobs: - help: - name: Run help - runs-on: ubuntu-latest - permissions: - pull-requests: write - steps: - - name: Update comment - uses: peter-evans/create-or-update-comment@71345be0265236311c031f5c7866368bd1eff043 # v4.0.0 - with: - token: ${{ secrets.GITHUB_TOKEN }} - repository: ${{ github.event.client_payload.github.payload.repository.full_name }} - comment-id: ${{ github.event.client_payload.github.payload.comment.id }} - body: | - > | Command | Description | - > | ------- | ----------- | - > | /test [destroy=false] | Run the Terraform test workflow on the modules in the tests/ directory. Unnamed arguments can be "all" to run all test cases or specific test case names to only run selected cases. The named argument "destroy=false" will disable the destruction of test infrastructure for debugging purposes. | - > | /destroy | Destroy any resources that may still be in Terraform state from previous tests. Unnamed arguments can be "all" to destroy all resources from all test cases or specific test case names to only destroy selected test case resources. | - > | /help | Shows this help message | - > - > ## Test Case Names - > - > ### FDO - > * private-active-active - > * private-tcp-active-active - > * public-active-active - > * standalone-mounted-disk - > * standalone-external-rhel8-worker - > - > ### Replicated - > * private-active-active-replicated - > * private-tcp-active-active-replicated - > * public-active-active-replicated - > * standalone-mounted-disk-replicated - > * standalone-external-rhel8-worker-replicated - reactions: confused diff --git a/.github/workflows/handler-test.yml b/.github/workflows/handler-test.yml deleted file mode 100644 index ebc3d1f1..00000000 --- a/.github/workflows/handler-test.yml +++ /dev/null @@ -1,234 +0,0 @@ -name: Pull Request Test Handler - -on: - repository_dispatch: - types: - - test-command - -env: - GOOGLE_CREDENTIALS: ${{ secrets.GOOGLE_CREDENTIALS }} - GOOGLE_PROJECT: ${{ secrets.GOOGLE_PROJECT }} - GOOGLE_REGION: ${{ secrets.GOOGLE_REGION }} - GOOGLE_ZONE: ${{ secrets.GOOGLE_ZONE }} - -jobs: - public_active_active: - uses: hashicorp/terraform-random-tfe-utility/.github/workflows/google-tests.yml@main - secrets: inherit - name: Public Active/Active - if: ${{ github.event.client_payload.slash_command.args.unnamed.all == 'all' || github.event.client_payload.slash_command.args.unnamed.all == 'public-active-active' }} - with: - test_name: Public Active/Active - module_repository_id: hashicorp/terraform-google-terraform-enterprise - work_dir: ./tests/public-active-active - k6_work_dir: ./tests/tfe-load-test - utility_test: false - is_replicated_deployment: false - enable_iact_subnet_list: true - private_test: false - pull_request_repo_name: ${{ github.event.client_payload.github.payload.repository.full_name }} - pull_request_ref: ${{ github.event.client_payload.pull_request.head.sha }} - pull_request_comment_id: ${{ github.event.client_payload.github.payload.comment.id }} - TFC_token_secret_name: PUBLIC_ACTIVE_ACTIVE_TFC_TOKEN - - private_active_active: - uses: hashicorp/terraform-random-tfe-utility/.github/workflows/google-tests.yml@main - secrets: inherit - name: Private Active/Active - if: ${{ github.event.client_payload.slash_command.args.unnamed.all == 'all' || github.event.client_payload.slash_command.args.unnamed.all == 'private-active-active' }} - with: - test_name: Private Active/Active - utility_test: false - is_replicated_deployment: false - enable_iact_subnet_list: false - module_repository_id: hashicorp/terraform-google-terraform-enterprise - work_dir: ./tests/private-active-active - k6_work_dir: ./tests/tfe-load-test - pull_request_repo_name: ${{ github.event.client_payload.github.payload.repository.full_name }} - pull_request_ref: ${{ github.event.client_payload.pull_request.head.sha }} - pull_request_comment_id: ${{ github.event.client_payload.github.payload.comment.id }} - TFC_token_secret_name: PRIVATE_ACTIVE_ACTIVE_TFC_TOKEN - private_test: true - - private_tcp_active_active: - uses: hashicorp/terraform-random-tfe-utility/.github/workflows/google-tests.yml@main - secrets: inherit - name: Private TCP Active/Active - if: ${{ github.event.client_payload.slash_command.args.unnamed.all == 'all' || github.event.client_payload.slash_command.args.unnamed.all == 'private-tcp-active-active' }} - with: - test_name: Private TCP Active/Active - utility_test: false - is_replicated_deployment: false - enable_iact_subnet_list: false - module_repository_id: hashicorp/terraform-google-terraform-enterprise - work_dir: ./tests/private-tcp-active-active - k6_work_dir: ./tests/tfe-load-test - pull_request_repo_name: ${{ github.event.client_payload.github.payload.repository.full_name }} - pull_request_ref: ${{ github.event.client_payload.pull_request.head.sha }} - pull_request_comment_id: ${{ github.event.client_payload.github.payload.comment.id }} - TFC_token_secret_name: PRIVATE_TCP_ACTIVE_ACTIVE_TFC_TOKEN - private_test: true - - standalone_external_rhel8_worker: - uses: hashicorp/terraform-random-tfe-utility/.github/workflows/google-tests.yml@main - secrets: inherit - name: Standalone External Rhel8 Worker - if: ${{ github.event.client_payload.slash_command.args.unnamed.all == 'all' || github.event.client_payload.slash_command.args.unnamed.all == 'standalone-external-rhel8-worker' }} - with: - test_name: Standalone External Rhel8 Worker - module_repository_id: hashicorp/terraform-google-terraform-enterprise - work_dir: ./tests/standalone-external-rhel8-worker - k6_work_dir: ./tests/tfe-load-test - private_test: false - utility_test: false - is_replicated_deployment: false - enable_iact_subnet_list: false - pull_request_repo_name: ${{ github.event.client_payload.github.payload.repository.full_name }} - pull_request_ref: ${{ github.event.client_payload.pull_request.head.sha }} - pull_request_comment_id: ${{ github.event.client_payload.github.payload.comment.id }} - TFC_token_secret_name: STANDALONE_EXTERNAL_RHEL8_WORKER_TFC_TOKEN - TFC_workspace_substitution_pattern: 's/terraform {/terraform {\n\ - backend "remote" {\n\ - organization = "terraform-enterprise-modules-test"\n\ - workspaces {\n\ - name = "google-standalone-external-rhel8-worker"\n\ - }\n\ - }\n/' - - standalone_mounted_disk: - uses: hashicorp/terraform-random-tfe-utility/.github/workflows/google-tests.yml@main - secrets: inherit - name: Standalone Mounted Disk - if: ${{ github.event.client_payload.slash_command.args.unnamed.all == 'all' || github.event.client_payload.slash_command.args.unnamed.all == 'standalone-mounted-disk' }} - with: - test_name: Standalone Mounted Disk - module_repository_id: hashicorp/terraform-google-terraform-enterprise - work_dir: ./tests/standalone-mounted-disk - k6_work_dir: ./tests/tfe-load-test - utility_test: false - is_replicated_deployment: false - private_test: false - enable_iact_subnet_list: false - pull_request_repo_name: ${{ github.event.client_payload.github.payload.repository.full_name }} - pull_request_ref: ${{ github.event.client_payload.pull_request.head.sha }} - pull_request_comment_id: ${{ github.event.client_payload.github.payload.comment.id }} - TFC_token_secret_name: STANDALONE_MOUNTED_DISK_TFC_TOKEN - TFC_workspace_substitution_pattern: 's/terraform {/terraform {\n\ - backend "remote" {\n\ - organization = "terraform-enterprise-modules-test"\n\ - workspaces {\n\ - name = "google-standalone-mounted-disk"\n\ - }\n\ - }\n/' - - public_active_active_replicated: - uses: hashicorp/terraform-random-tfe-utility/.github/workflows/google-tests.yml@main - secrets: inherit - name: Public Active/Active - if: ${{ github.event.client_payload.slash_command.args.unnamed.all == 'all' || github.event.client_payload.slash_command.args.unnamed.all == 'public-active-active-replicated' }} - with: - test_name: Public Active/Active - module_repository_id: hashicorp/terraform-google-terraform-enterprise - work_dir: ./tests/public-active-active - k6_work_dir: ./tests/tfe-load-test - utility_test: false - is_replicated_deployment: true - enable_iact_subnet_list: true - private_test: false - pull_request_repo_name: ${{ github.event.client_payload.github.payload.repository.full_name }} - pull_request_ref: ${{ github.event.client_payload.pull_request.head.sha }} - pull_request_comment_id: ${{ github.event.client_payload.github.payload.comment.id }} - TFC_token_secret_name: PUBLIC_ACTIVE_ACTIVE_REPLICATED_TFC_TOKEN - TFC_workspace_substitution_pattern: s/google-public-active-active/google-public-active-active-replicated/ - - private_active_active_replicated: - uses: hashicorp/terraform-random-tfe-utility/.github/workflows/google-tests.yml@main - secrets: inherit - name: Private Active/Active - if: ${{ github.event.client_payload.slash_command.args.unnamed.all == 'all' || github.event.client_payload.slash_command.args.unnamed.all == 'private-active-active-replicated'}} - with: - test_name: Private Active/Active - utility_test: false - is_replicated_deployment: true - enable_iact_subnet_list: false - module_repository_id: hashicorp/terraform-google-terraform-enterprise - work_dir: ./tests/private-active-active - k6_work_dir: ./tests/tfe-load-test - pull_request_repo_name: ${{ github.event.client_payload.github.payload.repository.full_name }} - pull_request_ref: ${{ github.event.client_payload.pull_request.head.sha }} - pull_request_comment_id: ${{ github.event.client_payload.github.payload.comment.id }} - TFC_token_secret_name: PRIVATE_ACTIVE_ACTIVE_REPLICATED_TFC_TOKEN - TFC_workspace_substitution_pattern: s/google-private-active-active/google-private-active-active-replicated/ - private_test: true - - private_tcp_active_active_replicated: - uses: hashicorp/terraform-random-tfe-utility/.github/workflows/google-tests.yml@main - secrets: inherit - name: Private TCP Active/Active - if: ${{ github.event.client_payload.slash_command.args.unnamed.all == 'all' || github.event.client_payload.slash_command.args.unnamed.all == 'private-tcp-active-active-replicated' }} - with: - test_name: Private TCP Active/Active - utility_test: false - is_replicated_deployment: true - enable_iact_subnet_list: false - module_repository_id: hashicorp/terraform-google-terraform-enterprise - work_dir: ./tests/private-tcp-active-active - k6_work_dir: ./tests/tfe-load-test - pull_request_repo_name: ${{ github.event.client_payload.github.payload.repository.full_name }} - pull_request_ref: ${{ github.event.client_payload.pull_request.head.sha }} - pull_request_comment_id: ${{ github.event.client_payload.github.payload.comment.id }} - TFC_token_secret_name: PRIVATE_TCP_ACTIVE_ACTIVE_REPLICATED_TFC_TOKEN - TFC_workspace_substitution_pattern: s/google-private-tcp-active-active/google-private-tcp-active-active-replicated/ - private_test: true - - standalone_external_rhel8_worker_replicated: - uses: hashicorp/terraform-random-tfe-utility/.github/workflows/google-tests.yml@main - secrets: inherit - name: Standalone External Rhel8 Worker - if: ${{ github.event.client_payload.slash_command.args.unnamed.all == 'all' || github.event.client_payload.slash_command.args.unnamed.all == 'standalone-external-rhel8-worker-replicated'}} - with: - test_name: Standalone External Rhel8 Worker - module_repository_id: hashicorp/terraform-google-terraform-enterprise - work_dir: ./tests/standalone-external-rhel8-worker - k6_work_dir: ./tests/tfe-load-test - private_test: false - utility_test: false - is_replicated_deployment: true - enable_iact_subnet_list: false - pull_request_repo_name: ${{ github.event.client_payload.github.payload.repository.full_name }} - pull_request_ref: ${{ github.event.client_payload.pull_request.head.sha }} - pull_request_comment_id: ${{ github.event.client_payload.github.payload.comment.id }} - TFC_token_secret_name: STANDALONE_EXTERNAL_RHEL8_WORKER_REPLICATED_TFC_TOKEN - TFC_workspace_substitution_pattern: 's/terraform {/terraform {\n\ - backend "remote" {\n\ - organization = "terraform-enterprise-modules-test"\n\ - workspaces {\n\ - name = "google-standalone-external-rhel8-worker-replicated"\n\ - }\n\ - }\n/' - - standalone_mounted_disk_replicated: - uses: hashicorp/terraform-random-tfe-utility/.github/workflows/google-tests.yml@main - secrets: inherit - name: Standalone Mounted Disk - if: ${{ github.event.client_payload.slash_command.args.unnamed.all == 'all' || github.event.client_payload.slash_command.args.unnamed.all == 'standalone-mounted-disk-replicated' }} - with: - test_name: Standalone Mounted Disk - module_repository_id: hashicorp/terraform-google-terraform-enterprise - work_dir: ./tests/standalone-mounted-disk - k6_work_dir: ./tests/tfe-load-test - utility_test: false - is_replicated_deployment: true - private_test: false - enable_iact_subnet_list: false - pull_request_repo_name: ${{ github.event.client_payload.github.payload.repository.full_name }} - pull_request_ref: ${{ github.event.client_payload.pull_request.head.sha }} - pull_request_comment_id: ${{ github.event.client_payload.github.payload.comment.id }} - TFC_token_secret_name: STANDALONE_MOUNTED_DISK_REPLICATED_TFC_TOKEN - TFC_workspace_substitution_pattern: 's/terraform {/terraform {\n\ - backend "remote" {\n\ - organization = "terraform-enterprise-modules-test"\n\ - workspaces {\n\ - name = "google-standalone-mounted-disk-replicated"\n\ - }\n\ - }\n/' diff --git a/tests/private-active-active/README.md b/tests/private-active-active/README.md deleted file mode 100644 index 3618b0aa..00000000 --- a/tests/private-active-active/README.md +++ /dev/null @@ -1,35 +0,0 @@ -# TEST: Private Active/Active Terraform Enterprise - -## About This Test - -This test for Terraform Enterprise creates an installation with the -following traits: - -- Active/Active mode - -- a medium VM machine type (n1-standard-16) - -- Red Hat 7.8 as the VM image - -- a privately accessible HTTP load balancer with TLS termination - -- a proxy server with TLS pass-through - -- Redis authentication - -- no Redis encryption in transit - -## Prerequisites - -This test assumes the following resources exist: - -- a Cloud DNS managed zone -- a Cloud Load Balancing SSL certificate -- a Secret Manager secret that comprises a Base64 encoded Replicated - license file - -## How This Test Is Used - -This test is leveraged by this repository's continuous integration -setup which leverages workspaces in a Terraform Cloud workspaces as a -remote backend so that Terraform state is preserved. diff --git a/tests/private-active-active/data.tf b/tests/private-active-active/data.tf deleted file mode 100644 index 0aa89281..00000000 --- a/tests/private-active-active/data.tf +++ /dev/null @@ -1,21 +0,0 @@ -# Copyright (c) HashiCorp, Inc. -# SPDX-License-Identifier: MPL-2.0 - -data "tfe_outputs" "base" { - organization = try(var.tfe.organization, var.tfe_organization) - workspace = try(var.tfe.workspace, var.tfe_workspace) -} - -data "google_dns_managed_zone" "main" { - name = data.tfe_outputs.base.values.cloud_dns_name -} - -data "google_compute_image" "rhel" { - name = "rhel-8-v20231010" - project = "rhel-cloud" -} - -data "google_compute_image" "ubuntu" { - name = "ubuntu-2004-focal-v20220118" - project = "ubuntu-os-cloud" -} diff --git a/tests/private-active-active/locals.tf b/tests/private-active-active/locals.tf deleted file mode 100644 index 0882da23..00000000 --- a/tests/private-active-active/locals.tf +++ /dev/null @@ -1,17 +0,0 @@ -# Copyright (c) HashiCorp, Inc. -# SPDX-License-Identifier: MPL-2.0 - -locals { - name = "${random_pet.main.id}-proxy" - labels = { - oktodelete = "true" - department = "engineering" - product = "terraform-enterprise" - repository = "terraform-google-terraform-enterprise" - description = "private-active-active" - environment = "test" - team = "terraform-enterprise" - } - - registry = "quay.io" -} diff --git a/tests/private-active-active/main.tf b/tests/private-active-active/main.tf deleted file mode 100644 index 67fe9179..00000000 --- a/tests/private-active-active/main.tf +++ /dev/null @@ -1,74 +0,0 @@ -# Copyright (c) HashiCorp, Inc. -# SPDX-License-Identifier: MPL-2.0 - -resource "random_pet" "main" { - length = 1 - prefix = "praa" - separator = "-" -} - -module "test_proxy" { - source = "../../fixtures/test_proxy" - - instance_image = data.google_compute_image.ubuntu.id - name = local.name - network = module.tfe.network - subnetwork = module.tfe.subnetwork - existing_service_account_id = var.existing_service_account_id - - labels = local.labels -} - -# Store TFE License as secret -# --------------------------- -module "secrets" { - count = var.license_file == null || !var.is_replicated_deployment ? 0 : 1 - source = "../../fixtures/secrets" - - license = { - id = random_pet.main.id - path = var.license_file - } -} - -module "tfe" { - source = "../.." - - distribution = "rhel" - dns_zone_name = data.google_dns_managed_zone.main.name - fqdn = "${random_pet.main.id}.${data.google_dns_managed_zone.main.dns_name}" - namespace = random_pet.main.id - existing_service_account_id = var.existing_service_account_id - node_count = 2 - tfe_license_secret_id = try(module.secrets[0].license_secret, data.tfe_outputs.base.values.license_secret_id) - labels = local.labels - - iact_subnet_list = ["${module.test_proxy.compute_instance.network_interface[0].network_ip}/32"] - iact_subnet_time_limit = 1440 - load_balancer = "PRIVATE" - proxy_ip = module.test_proxy.proxy_ip - proxy_port = module.test_proxy.proxy_port - redis_auth_enabled = true - redis_version = "REDIS_7_0" - ssl_certificate_name = data.tfe_outputs.base.values.wildcard_region_ssl_certificate_name - ssl_certificate_secret = var.is_replicated_deployment ? null : data.tfe_outputs.base.values.wildcard_ssl_certificate_secret_id - ssl_private_key_secret = var.is_replicated_deployment ? null : data.tfe_outputs.base.values.wildcard_ssl_private_key_secret_id - vm_disk_source_image = data.google_compute_image.rhel.self_link - vm_machine_type = "n1-standard-16" - vm_mig_check_interval_sec = 300 - vm_mig_healthy_threshold = 1 - vm_mig_initial_delay_sec = 3600 - vm_mig_timeout_sec = 300 - vm_mig_unhealthy_threshold = 10 - - # FDO Specific Values - is_replicated_deployment = var.is_replicated_deployment - hc_license = var.hc_license - http_port = 8080 - https_port = 8443 - license_reporting_opt_out = true - registry = local.registry - registry_password = var.registry_password - registry_username = var.registry_username - tfe_image = "${local.registry}/hashicorp/terraform-enterprise:${var.tfe_image_tag}" -} diff --git a/tests/private-active-active/outputs.tf b/tests/private-active-active/outputs.tf deleted file mode 100644 index 47da8cf7..00000000 --- a/tests/private-active-active/outputs.tf +++ /dev/null @@ -1,44 +0,0 @@ -# Copyright (c) HashiCorp, Inc. -# SPDX-License-Identifier: MPL-2.0 - -output "health_check_url" { - value = module.tfe.health_check_url - - description = "The URL of the Terraform Enterprise health check endpoint." -} - -output "iact_url" { - value = module.tfe.iact_url - - description = "The URL of the Terraform Enterprise IACT." -} - -output "initial_admin_user_url" { - value = module.tfe.initial_admin_user_url - - description = "The URL of the Terraform Enterprise initial admin user." -} - -output "proxy_instance_name" { - value = module.test_proxy.compute_instance.name - - description = "The name of the HTTP proxy compute instance." -} - -output "proxy_instance_zone" { - value = module.test_proxy.compute_instance.zone - - description = "The zone of the HTTP proxy compute instance." -} - -output "tfe" { - value = module.tfe - sensitive = true - description = "The Terraform Enterprise deployment." -} - -output "tfe_url" { - value = module.tfe.url - - description = "The URL of Terraform Enterprise." -} diff --git a/tests/private-active-active/providers.tf b/tests/private-active-active/providers.tf deleted file mode 100644 index 62c66138..00000000 --- a/tests/private-active-active/providers.tf +++ /dev/null @@ -1,7 +0,0 @@ -# Copyright (c) HashiCorp, Inc. -# SPDX-License-Identifier: MPL-2.0 - -provider "tfe" { - hostname = try(var.tfe.hostname, var.tfe_hostname) - token = try(var.tfe.token, var.tfe_token) -} diff --git a/tests/private-active-active/run-tests.sh b/tests/private-active-active/run-tests.sh deleted file mode 100644 index 20d874a4..00000000 --- a/tests/private-active-active/run-tests.sh +++ /dev/null @@ -1,108 +0,0 @@ -#!/bin/bash -# Copyright (c) HashiCorp, Inc. -# SPDX-License-Identifier: MPL-2.0 - - -k6_path="" -k6_tests_dir="" -bastion_key_file="" -skip_init="" - -Help() -{ - # Display Help - echo "This script bootstraps the k6 / tfe-load-test environment and executes a smoke-test against an active TFE instance deployed with the terraform-azure-terraform-enterprise module." - echo - echo "Syntax: run-tests.sh [-h|k|t|b|s|l]" - echo "options:" - echo "h Print this Help." - echo "k (required) The path to the k6 binary." - echo "t (required) The path to the tfe-load-test repository." - echo "s (optional) Skip the admin user initialization and tfe token retrieval (This is useful for secondary / repeated test runs)." - echo -} - -# Get the options -while getopts ":hk:t:b:sl" option; do - case $option in - h) # display Help - Help - exit;; - k) # Enter a path to the k6 binary - k6_path=$OPTARG;; - - t) # Enter a path to the tfe-load-test repo - k6_tests_dir=$OPTARG;; - s) # Skip the admin user boostrapping process? - skip_init=1;; - \?) # Invalid option - echo "Error: Invalid option" - exit;; - esac -done - -if [[ -z "$k6_path" ]]; then - echo "k6 path missing. Please use the -k option." - Help - exit 1 -fi - -if [[ -z "$k6_tests_dir" ]]; then - echo "The tfe-load-test repository path missing. Please use the -t option." - Help - exit 1 -fi - -echo " -Executing tests with the following configuration: - k6_path=$k6_path - k6_tests_dir=$k6_tests_dir - skip_init=$skip_init -" - -SCRIPT_DIR="$( cd -- "$( dirname -- "${BASH_SOURCE[0]:-$0}"; )" &> /dev/null && pwd 2> /dev/null; )"; - -cd $SCRIPT_DIR - -gcloud compute ssh --quiet --ssh-key-expire-after="1440m" --tunnel-through-iap --zone="$PROXY_ZONE" "$PROXY_INSTANCE" -- -f -N -p 22 -D localhost:5000 - -if [[ -z "$skip_init" ]]; then - while ! curl \ - -sfS --max-time 5 --proxy socks5://localhost:5000 \ - $HEALTHCHECK_URL; \ - do sleep 5; done - echo " : TFE is healthy and listening." - echo "Sleeping for 3 minutes to ensure that both instances are ready." - sleep 180 - - echo "Fetching iact token.." - iact_token=$(curl --fail --retry 5 --proxy socks5://localhost:5000 "$IACT_URL") - - - TFE_USERNAME="test$(date +%s)" - TFE_PASSWORD=`openssl rand -base64 32` - echo "{\"username\": \"$TFE_USERNAME\", \"email\": \"tf-onprem-team@hashicorp.com\", \"password\": \"$TFE_PASSWORD\"}" \ > ./payload.json - - response=$(\ - curl \ - --retry 5 \ - --header 'Content-Type: application/json' \ - --data @./payload.json \ - --request POST \ - --proxy socks5://localhost:5000 \ - "$IAU_URL"?token="$iact_token") - - tfe_token=$(echo "$response" | jq --raw-output '.token') - rm -f payload.json - - echo "export K6_PATHNAME=$k6_path - export TFE_URL=$TFE_URL - export TFE_API_TOKEN=$tfe_token - export TFE_EMAIL=tf-onprem-team@hashicorp.com - export http_proxy=socks5://localhost:5000/ - export https_proxy=socks5://localhost:5000/" > .env.sh -fi - -source .env.sh -cd $k6_tests_dir -make smoke-test diff --git a/tests/private-active-active/variables.tf b/tests/private-active-active/variables.tf deleted file mode 100644 index 90cc9cbe..00000000 --- a/tests/private-active-active/variables.tf +++ /dev/null @@ -1,79 +0,0 @@ -# Copyright (c) HashiCorp, Inc. -# SPDX-License-Identifier: MPL-2.0 - -variable "existing_service_account_id" { - default = null - type = string - description = "The id of the logging service account to use for compute resources deployed." -} - -variable "hc_license" { - default = null - type = string - description = "(Not needed if is_replicated_deployment is true) The raw TFE license that is validated on application startup." -} - -variable "is_replicated_deployment" { - type = bool - description = "TFE will be installed using a Replicated license and deployment method." - default = true -} - -variable "license_file" { - default = null - type = string - description = "The local path to the Terraform Enterprise license to be provided by CI." -} - -variable "registry_password" { - default = null - type = string - description = "(Not needed if is_replicated_deployment is true) The password for the docker registry from which to source the terraform_enterprise container images." -} - -variable "registry_username" { - default = null - type = string - description = "(Not needed if is_replicated_deployment is true) The username for the docker registry from which to source the terraform_enterprise container images." -} - -variable "tfe_hostname" { - default = null - description = "Hostname of the Terraform Enterprise instance which manages the base infrastructure." - type = string -} - -variable "tfe_image_tag" { - default = "latest" - type = string - description = "(Not needed if is_replicated_deployment is true) The image version of the terraform-enterprise image (e.g. \"1234567\")" -} - -variable "tfe_organization" { - default = null - description = "Organization of the Terraform Enterprise instance which manages the base infrastructure." - type = string -} - -variable "tfe_token" { - default = null - description = "Token of the Terraform Enterprise instance which manages the base infrastructure." - type = string -} - -variable "tfe_workspace" { - default = null - description = "Workspace of the Terraform Enterprise instance which manages the base infrastructure." - type = string -} - -variable "tfe" { - default = null - description = "Attributes of the Terraform Enterprise instance which manages the base infrastructure." - type = object({ - hostname = string - organization = string - token = string - workspace = string - }) -} diff --git a/tests/private-active-active/versions.tf b/tests/private-active-active/versions.tf deleted file mode 100644 index da3a1b94..00000000 --- a/tests/private-active-active/versions.tf +++ /dev/null @@ -1,29 +0,0 @@ -# Copyright (c) HashiCorp, Inc. -# SPDX-License-Identifier: MPL-2.0 - -terraform { - required_version = ">= 0.14" - backend "remote" { - organization = "terraform-enterprise-modules-test" - - workspaces { - name = "google-private-active-active" - } - } - required_providers { - google = { - source = "hashicorp/google" - version = "~> 5.0" - } - - random = { - source = "hashicorp/random" - version = "~> 3.0" - } - - tfe = { - source = "hashicorp/tfe" - version = "~> 0.26" - } - } -} diff --git a/tests/private-tcp-active-active/README.md b/tests/private-tcp-active-active/README.md deleted file mode 100644 index b54e5855..00000000 --- a/tests/private-tcp-active-active/README.md +++ /dev/null @@ -1,35 +0,0 @@ -# TEST: Private TCP Active/Active Terraform Enterprise - -## About This Test - -This test for Terraform Enterprise creates an installation with the -following traits: - -- Active/Active mode - -- a large VM machine type (n1-standard-32) - -- Red Hat 7.8 as the VM image - -- a privately accessible TCP load balancer with TLS pass-through - -- a proxy server with TLS termination - -- Redis authentication - -- Redis encryption in transit - -## Prerequisites - -This test assumes the following resources exist: - -- a Cloud DNS managed zone -- a Cloud Load Balancing SSL certificate -- a Secret Manager secret that comprises a Base64 encoded Replicated - license file - -## How This Test Is Used - -This test is leveraged by this repository's continuous integration -setup which leverages workspaces in a Terraform Cloud workspaces as a -remote backend so that Terraform state is preserved. diff --git a/tests/private-tcp-active-active/data.tf b/tests/private-tcp-active-active/data.tf deleted file mode 100644 index 0aa89281..00000000 --- a/tests/private-tcp-active-active/data.tf +++ /dev/null @@ -1,21 +0,0 @@ -# Copyright (c) HashiCorp, Inc. -# SPDX-License-Identifier: MPL-2.0 - -data "tfe_outputs" "base" { - organization = try(var.tfe.organization, var.tfe_organization) - workspace = try(var.tfe.workspace, var.tfe_workspace) -} - -data "google_dns_managed_zone" "main" { - name = data.tfe_outputs.base.values.cloud_dns_name -} - -data "google_compute_image" "rhel" { - name = "rhel-8-v20231010" - project = "rhel-cloud" -} - -data "google_compute_image" "ubuntu" { - name = "ubuntu-2004-focal-v20220118" - project = "ubuntu-os-cloud" -} diff --git a/tests/private-tcp-active-active/locals.tf b/tests/private-tcp-active-active/locals.tf deleted file mode 100644 index d9ceb5e6..00000000 --- a/tests/private-tcp-active-active/locals.tf +++ /dev/null @@ -1,17 +0,0 @@ -# Copyright (c) HashiCorp, Inc. -# SPDX-License-Identifier: MPL-2.0 - -locals { - name = "${random_pet.main.id}-proxy" - labels = { - oktodelete = "true" - department = "engineering" - product = "terraform-enterprise" - repository = "terraform-google-terraform-enterprise" - description = "private-tcp-active-active" - environment = "test" - team = "terraform-enterprise" - } - - registry = "quay.io" -} diff --git a/tests/private-tcp-active-active/main.tf b/tests/private-tcp-active-active/main.tf deleted file mode 100644 index 12f0fb1c..00000000 --- a/tests/private-tcp-active-active/main.tf +++ /dev/null @@ -1,78 +0,0 @@ -# Copyright (c) HashiCorp, Inc. -# SPDX-License-Identifier: MPL-2.0 - -resource "random_pet" "main" { - length = 1 - prefix = "ptaa" - separator = "-" -} - -module "test_proxy" { - source = "../../fixtures/test_proxy" - - instance_image = data.google_compute_image.ubuntu.id - name = local.name - network = module.tfe.network - subnetwork = module.tfe.subnetwork - existing_service_account_id = var.existing_service_account_id - - labels = local.labels - mitmproxy_ca_certificate_secret = data.tfe_outputs.base.values.ca_certificate_secret_id - mitmproxy_ca_private_key_secret = data.tfe_outputs.base.values.ca_private_key_secret_id -} - -# Store TFE License as secret -# --------------------------- -module "secrets" { - count = var.license_file == null || !var.is_replicated_deployment ? 0 : 1 - source = "../../fixtures/secrets" - - license = { - id = random_pet.main.id - path = var.license_file - } -} - -module "tfe" { - source = "../.." - - bypass_preflight_checks = true - distribution = "rhel" - dns_zone_name = data.google_dns_managed_zone.main.name - fqdn = "${random_pet.main.id}.${data.google_dns_managed_zone.main.dns_name}" - namespace = random_pet.main.id - existing_service_account_id = var.existing_service_account_id - node_count = 2 - tfe_license_secret_id = try(module.secrets[0].license_secret, data.tfe_outputs.base.values.license_secret_id) - labels = local.labels - ca_certificate_secret_id = data.tfe_outputs.base.values.ca_certificate_secret_id - iact_subnet_list = ["${module.test_proxy.compute_instance.network_interface[0].network_ip}/32"] - iact_subnet_time_limit = 1440 - load_balancer = "PRIVATE_TCP" - proxy_ip = module.test_proxy.proxy_ip - proxy_port = module.test_proxy.proxy_port - redis_auth_enabled = true - redis_version = "REDIS_7_0" - ssl_certificate_secret = data.tfe_outputs.base.values.wildcard_ssl_certificate_secret_id - ssl_private_key_secret = data.tfe_outputs.base.values.wildcard_ssl_private_key_secret_id - tls_bootstrap_cert_pathname = "/var/lib/terraform-enterprise/certificate.pem" - tls_bootstrap_key_pathname = "/var/lib/terraform-enterprise/key.pem" - vm_disk_source_image = data.google_compute_image.rhel.self_link - vm_machine_type = "n1-standard-32" - vm_mig_check_interval_sec = 300 - vm_mig_healthy_threshold = 1 - vm_mig_initial_delay_sec = 3600 - vm_mig_timeout_sec = 300 - vm_mig_unhealthy_threshold = 10 - - # FDO Specific Values - is_replicated_deployment = var.is_replicated_deployment - hc_license = var.hc_license - http_port = 8080 - https_port = 8443 - license_reporting_opt_out = true - registry = local.registry - registry_password = var.registry_password - registry_username = var.registry_username - tfe_image = "${local.registry}/hashicorp/terraform-enterprise:${var.tfe_image_tag}" -} diff --git a/tests/private-tcp-active-active/outputs.tf b/tests/private-tcp-active-active/outputs.tf deleted file mode 100644 index 47da8cf7..00000000 --- a/tests/private-tcp-active-active/outputs.tf +++ /dev/null @@ -1,44 +0,0 @@ -# Copyright (c) HashiCorp, Inc. -# SPDX-License-Identifier: MPL-2.0 - -output "health_check_url" { - value = module.tfe.health_check_url - - description = "The URL of the Terraform Enterprise health check endpoint." -} - -output "iact_url" { - value = module.tfe.iact_url - - description = "The URL of the Terraform Enterprise IACT." -} - -output "initial_admin_user_url" { - value = module.tfe.initial_admin_user_url - - description = "The URL of the Terraform Enterprise initial admin user." -} - -output "proxy_instance_name" { - value = module.test_proxy.compute_instance.name - - description = "The name of the HTTP proxy compute instance." -} - -output "proxy_instance_zone" { - value = module.test_proxy.compute_instance.zone - - description = "The zone of the HTTP proxy compute instance." -} - -output "tfe" { - value = module.tfe - sensitive = true - description = "The Terraform Enterprise deployment." -} - -output "tfe_url" { - value = module.tfe.url - - description = "The URL of Terraform Enterprise." -} diff --git a/tests/private-tcp-active-active/providers.tf b/tests/private-tcp-active-active/providers.tf deleted file mode 100644 index 62c66138..00000000 --- a/tests/private-tcp-active-active/providers.tf +++ /dev/null @@ -1,7 +0,0 @@ -# Copyright (c) HashiCorp, Inc. -# SPDX-License-Identifier: MPL-2.0 - -provider "tfe" { - hostname = try(var.tfe.hostname, var.tfe_hostname) - token = try(var.tfe.token, var.tfe_token) -} diff --git a/tests/private-tcp-active-active/run-tests.sh b/tests/private-tcp-active-active/run-tests.sh deleted file mode 100644 index 97cef186..00000000 --- a/tests/private-tcp-active-active/run-tests.sh +++ /dev/null @@ -1,117 +0,0 @@ -#!/bin/bash -# Copyright (c) HashiCorp, Inc. -# SPDX-License-Identifier: MPL-2.0 - - -k6_path="" -k6_tests_dir="" -bastion_key_file="" -skip_init="" - -Help() -{ - # Display Help - echo "This script bootstraps the k6 / tfe-load-test environment and executes a smoke-test against an active TFE instance deployed with the terraform-azure-terraform-enterprise module." - echo - echo "Syntax: run-tests.sh [-h|k|t|b|s|l]" - echo "options:" - echo "h Print this Help." - echo "k (required) The path to the k6 binary." - echo "t (required) The path to the tfe-load-test repository." - echo "s (optional) Skip the admin user initialization and tfe token retrieval (This is useful for secondary / repeated test runs)." - echo -} - -# Get the options -while getopts ":hk:t:b:sl" option; do - case $option in - h) # display Help - Help - exit;; - k) # Enter a path to the k6 binary - k6_path=$OPTARG;; - - t) # Enter a path to the tfe-load-test repo - k6_tests_dir=$OPTARG;; - s) # Skip the admin user boostrapping process? - skip_init=1;; - \?) # Invalid option - echo "Error: Invalid option" - exit;; - esac -done - -if [[ -z "$k6_path" ]]; then - echo "k6 path missing. Please use the -k option." - Help - exit 1 -fi - -if [[ -z "$k6_tests_dir" ]]; then - echo "The tfe-load-test repository path missing. Please use the -t option." - Help - exit 1 -fi - -echo " -Executing tests with the following configuration: - k6_path=$k6_path - k6_tests_dir=$k6_tests_dir - skip_init=$skip_init -" - -SCRIPT_DIR="$( cd -- "$( dirname -- "${BASH_SOURCE[0]:-$0}"; )" &> /dev/null && pwd 2> /dev/null; )"; - -cd $SCRIPT_DIR - -#Initiate SSH tunnel to proxy server -gcloud compute ssh \ - --quiet \ - --ssh-key-expire-after="1440m" \ - --tunnel-through-iap \ - --zone="$PROXY_ZONE" \ - "$PROXY_INSTANCE" \ - -- \ - -o 'ServerAliveInterval 5' \ - -o 'ServerAliveCountMax 3' \ - -f -N -p 22 -D localhost:5000 - -if [[ -z "$skip_init" ]]; then - while ! curl \ - -sfS --max-time 5 --proxy socks5://localhost:5000 \ - $HEALTHCHECK_URL; \ - do sleep 5; done - echo " : TFE is healthy and listening." - echo "Sleeping for 5 minutes to ensure that both instances are ready." - sleep 300 - - iact_token=$(curl --fail --retry 5 --proxy socks5://localhost:5000 "$IACT_URL") - - TFE_USERNAME="test$(date +%s)" - TFE_PASSWORD=`openssl rand -base64 32` - echo "{\"username\": \"$TFE_USERNAME\", \"email\": \"tf-onprem-team@hashicorp.com\", \"password\": \"$TFE_PASSWORD\"}" \ > ./payload.json - - response=$(\ - curl \ - --retry 5 \ - --header 'Content-Type: application/json' \ - --data @./payload.json \ - --request POST \ - --proxy socks5://localhost:5000 \ - "$IAU_URL"?token="$iact_token") - - tfe_token=$(echo "$response" | jq --raw-output '.token') - rm -f payload.json - - - echo "export K6_PATHNAME=$k6_path - export TFE_URL=$TFE_URL - export TFE_API_TOKEN=$tfe_token - export TFE_EMAIL=tf-onprem-team@hashicorp.com - export http_proxy=socks5://localhost:5000/ - export https_proxy=socks5://localhost:5000/" > .env.sh -fi - -source .env.sh -cd $k6_tests_dir -make smoke-test diff --git a/tests/private-tcp-active-active/variables.tf b/tests/private-tcp-active-active/variables.tf deleted file mode 100644 index 90cc9cbe..00000000 --- a/tests/private-tcp-active-active/variables.tf +++ /dev/null @@ -1,79 +0,0 @@ -# Copyright (c) HashiCorp, Inc. -# SPDX-License-Identifier: MPL-2.0 - -variable "existing_service_account_id" { - default = null - type = string - description = "The id of the logging service account to use for compute resources deployed." -} - -variable "hc_license" { - default = null - type = string - description = "(Not needed if is_replicated_deployment is true) The raw TFE license that is validated on application startup." -} - -variable "is_replicated_deployment" { - type = bool - description = "TFE will be installed using a Replicated license and deployment method." - default = true -} - -variable "license_file" { - default = null - type = string - description = "The local path to the Terraform Enterprise license to be provided by CI." -} - -variable "registry_password" { - default = null - type = string - description = "(Not needed if is_replicated_deployment is true) The password for the docker registry from which to source the terraform_enterprise container images." -} - -variable "registry_username" { - default = null - type = string - description = "(Not needed if is_replicated_deployment is true) The username for the docker registry from which to source the terraform_enterprise container images." -} - -variable "tfe_hostname" { - default = null - description = "Hostname of the Terraform Enterprise instance which manages the base infrastructure." - type = string -} - -variable "tfe_image_tag" { - default = "latest" - type = string - description = "(Not needed if is_replicated_deployment is true) The image version of the terraform-enterprise image (e.g. \"1234567\")" -} - -variable "tfe_organization" { - default = null - description = "Organization of the Terraform Enterprise instance which manages the base infrastructure." - type = string -} - -variable "tfe_token" { - default = null - description = "Token of the Terraform Enterprise instance which manages the base infrastructure." - type = string -} - -variable "tfe_workspace" { - default = null - description = "Workspace of the Terraform Enterprise instance which manages the base infrastructure." - type = string -} - -variable "tfe" { - default = null - description = "Attributes of the Terraform Enterprise instance which manages the base infrastructure." - type = object({ - hostname = string - organization = string - token = string - workspace = string - }) -} diff --git a/tests/private-tcp-active-active/versions.tf b/tests/private-tcp-active-active/versions.tf deleted file mode 100644 index 37b55809..00000000 --- a/tests/private-tcp-active-active/versions.tf +++ /dev/null @@ -1,29 +0,0 @@ -# Copyright (c) HashiCorp, Inc. -# SPDX-License-Identifier: MPL-2.0 - -terraform { - required_version = ">= 0.14" - backend "remote" { - organization = "terraform-enterprise-modules-test" - - workspaces { - name = "google-private-tcp-active-active" - } - } - required_providers { - google = { - source = "hashicorp/google" - version = "~> 5.0" - } - - random = { - source = "hashicorp/random" - version = "~> 3.0" - } - - tfe = { - source = "hashicorp/tfe" - version = "~> 0.26" - } - } -} diff --git a/tests/public-active-active/README.md b/tests/public-active-active/README.md deleted file mode 100644 index 919230fe..00000000 --- a/tests/public-active-active/README.md +++ /dev/null @@ -1,35 +0,0 @@ -# TEST: Public Active/Active Terraform Enterprise - -## About This Test - -This test for Terraform Enterprise creates an -installation with the following traits: - -- Active/Active mode - -- a small VM machine type (n1-standard-4) - -- Ubuntu 20.04 as the VM image - -- a publicly accessible HTTP load balancer with TLS termination - -- no proxy server - -- no Redis authentication - -- no Redis encryption in transit - -## Prerequisites - -This test assumes the following resources exist: - -- a Cloud DNS managed zone -- a Cloud Load Balancing SSL certificate -- a Secret Manager secret that comprises a Base64 encoded Replicated - license file - -## How This Test Is Used - -This test is leveraged by this repository's continuous integration -setup which leverages workspaces in a Terraform Cloud workspaces as a -remote backend so that Terraform state is preserved. diff --git a/tests/public-active-active/data.tf b/tests/public-active-active/data.tf deleted file mode 100644 index 9f00b115..00000000 --- a/tests/public-active-active/data.tf +++ /dev/null @@ -1,16 +0,0 @@ -# Copyright (c) HashiCorp, Inc. -# SPDX-License-Identifier: MPL-2.0 - -data "tfe_outputs" "base" { - organization = try(var.tfe.organization, var.tfe_organization) - workspace = try(var.tfe.workspace, var.tfe_workspace) -} - -data "google_compute_image" "ubuntu" { - name = "ubuntu-2004-focal-v20210211" - project = "ubuntu-os-cloud" -} - -data "google_dns_managed_zone" "main" { - name = data.tfe_outputs.base.values.cloud_dns_name -} diff --git a/tests/public-active-active/locals.tf b/tests/public-active-active/locals.tf deleted file mode 100644 index f670b205..00000000 --- a/tests/public-active-active/locals.tf +++ /dev/null @@ -1,6 +0,0 @@ -# Copyright (c) HashiCorp, Inc. -# SPDX-License-Identifier: MPL-2.0 - -locals { - registry = "quay.io" -} \ No newline at end of file diff --git a/tests/public-active-active/main.tf b/tests/public-active-active/main.tf deleted file mode 100644 index cd24f949..00000000 --- a/tests/public-active-active/main.tf +++ /dev/null @@ -1,69 +0,0 @@ -# Copyright (c) HashiCorp, Inc. -# SPDX-License-Identifier: MPL-2.0 - -resource "random_pet" "main" { - length = 1 - prefix = "paa" - separator = "-" -} - -# Store TFE License as secret -# --------------------------- -module "secrets" { - count = var.license_file == null || !var.is_replicated_deployment ? 0 : 1 - source = "../../fixtures/secrets" - - license = { - id = random_pet.main.id - path = var.license_file - } -} - -module "tfe" { - source = "../.." - - dns_zone_name = data.google_dns_managed_zone.main.name - fqdn = "${random_pet.main.id}.${data.google_dns_managed_zone.main.dns_name}" - namespace = random_pet.main.id - existing_service_account_id = var.existing_service_account_id - node_count = 2 - tfe_license_secret_id = try(module.secrets[0].license_secret, data.tfe_outputs.base.values.license_secret_id) - - distribution = "ubuntu" - iact_subnet_list = var.iact_subnet_list - iact_subnet_time_limit = 1440 - load_balancer = "PUBLIC" - redis_auth_enabled = false - redis_version = "REDIS_7_0" - ssl_certificate_name = data.tfe_outputs.base.values.wildcard_ssl_certificate_name - ssl_certificate_secret = var.is_replicated_deployment ? null : data.tfe_outputs.base.values.wildcard_ssl_certificate_secret_id - ssl_private_key_secret = var.is_replicated_deployment ? null : data.tfe_outputs.base.values.wildcard_ssl_private_key_secret_id - vm_disk_source_image = data.google_compute_image.ubuntu.self_link - vm_machine_type = "n1-standard-4" - vm_mig_check_interval_sec = 300 - vm_mig_healthy_threshold = 1 - vm_mig_initial_delay_sec = 3600 - vm_mig_timeout_sec = 300 - vm_mig_unhealthy_threshold = 10 - - labels = { - oktodelete = "true" - department = "engineering" - product = "terraform-enterprise" - repository = "terraform-google-terraform-enterprise" - description = "public-active-active" - environment = "test" - team = "terraform-enterprise" - } - - # FDO Specific Values - is_replicated_deployment = var.is_replicated_deployment - hc_license = var.hc_license - http_port = 8080 - https_port = 8443 - license_reporting_opt_out = true - registry = local.registry - registry_password = var.registry_password - registry_username = var.registry_username - tfe_image = "${local.registry}/hashicorp/terraform-enterprise:${var.tfe_image_tag}" -} diff --git a/tests/public-active-active/outputs.tf b/tests/public-active-active/outputs.tf deleted file mode 100644 index 8f2a4d53..00000000 --- a/tests/public-active-active/outputs.tf +++ /dev/null @@ -1,32 +0,0 @@ -# Copyright (c) HashiCorp, Inc. -# SPDX-License-Identifier: MPL-2.0 - -output "health_check_url" { - value = module.tfe.health_check_url - - description = "The URL of the Terraform Enterprise health check endpoint." -} - -output "iact_url" { - value = module.tfe.iact_url - - description = "The URL of the Terraform Enterprise IACT." -} - -output "initial_admin_user_url" { - value = module.tfe.initial_admin_user_url - - description = "The URL of the Terraform Enterprise initial admin user." -} - -output "tfe" { - value = module.tfe - sensitive = true - description = "The Terraform Enterprise deployment." -} - -output "tfe_url" { - value = module.tfe.url - - description = "The URL of Terraform Enterprise." -} diff --git a/tests/public-active-active/providers.tf b/tests/public-active-active/providers.tf deleted file mode 100644 index 62c66138..00000000 --- a/tests/public-active-active/providers.tf +++ /dev/null @@ -1,7 +0,0 @@ -# Copyright (c) HashiCorp, Inc. -# SPDX-License-Identifier: MPL-2.0 - -provider "tfe" { - hostname = try(var.tfe.hostname, var.tfe_hostname) - token = try(var.tfe.token, var.tfe_token) -} diff --git a/tests/public-active-active/run-tests.sh b/tests/public-active-active/run-tests.sh deleted file mode 100644 index 77597cbe..00000000 --- a/tests/public-active-active/run-tests.sh +++ /dev/null @@ -1,102 +0,0 @@ -#!/bin/bash -# Copyright (c) HashiCorp, Inc. -# SPDX-License-Identifier: MPL-2.0 - - -k6_path="" -k6_tests_dir="" -bastion_key_file="" -skip_init="" - -Help() -{ - # Display Help - echo "This script bootstraps the k6 / tfe-load-test environment and executes a smoke-test against an active TFE instance deployed with the terraform-azure-terraform-enterprise module." - echo - echo "Syntax: run-tests.sh [-h|k|t|s]" - echo "options:" - echo "h Print this Help." - echo "k (required) The path to the k6 binary." - echo "t (required) The path to the tfe-load-test repository." - echo "s (optional) Skip the admin user initialization and tfe token retrieval (This is useful for secondary / repeated test runs)." - echo -} - -# Get the options -while getopts ":hk:t:b:sl" option; do - case $option in - h) # display Help - Help - exit;; - k) # Enter a path to the k6 binary - k6_path=$OPTARG;; - - t) # Enter a path to the tfe-load-test repo - k6_tests_dir=$OPTARG;; - s) # Skip the admin user boostrapping process? - skip_init=1;; - \?) # Invalid option - echo "Error: Invalid option" - exit;; - esac -done - -if [[ -z "$k6_path" ]]; then - echo "k6 path missing. Please use the -k option." - Help - exit 1 -fi - -if [[ -z "$k6_tests_dir" ]]; then - echo "The tfe-load-test repository path missing. Please use the -t option." - Help - exit 1 -fi - -echo " -Executing tests with the following configuration: - k6_path=$k6_path - k6_tests_dir=$k6_tests_dir - skip_init=$skip_init -" - -SCRIPT_DIR="$( cd -- "$( dirname -- "${BASH_SOURCE[0]:-$0}"; )" &> /dev/null && pwd 2> /dev/null; )"; - -cd $SCRIPT_DIR - -if [[ -z "$skip_init" ]]; then - while ! curl \ - -sfS --max-time 5 \ - $HEALTHCHECK_URL; \ - do sleep 5; done - echo " : TFE is healthy and listening." - echo "Sleeping for 3 minutes to ensure that both instances are ready." - sleep 180 - - echo "Fetching iact token.." - iact_token=$(curl --fail --retry 5 "$IACT_URL") - - TFE_USERNAME="test$(date +%s)" - TFE_PASSWORD=`openssl rand -base64 32` - echo "{\"username\": \"$TFE_USERNAME\", \"email\": \"tf-onprem-team@hashicorp.com\", \"password\": \"$TFE_PASSWORD\"}" \ > ./payload.json - - response=$(\ - curl \ - --retry 5 \ - --header 'Content-Type: application/json' \ - --data @./payload.json \ - --request POST \ - "$IAU_URL"?token="$iact_token") - - tfe_token=$(echo "$response" | jq --raw-output '.token') - rm -f payload.json - - echo "export K6_PATHNAME=$k6_path - export TFE_URL=$TFE_URL - export TFE_API_TOKEN=$tfe_token - export TFE_EMAIL=tf-onprem-team@hashicorp.com" > .env.sh -fi - -source .env.sh -cd $k6_tests_dir -make smoke-test diff --git a/tests/public-active-active/variables.tf b/tests/public-active-active/variables.tf deleted file mode 100644 index 443074e9..00000000 --- a/tests/public-active-active/variables.tf +++ /dev/null @@ -1,87 +0,0 @@ -# Copyright (c) HashiCorp, Inc. -# SPDX-License-Identifier: MPL-2.0 - -variable "existing_service_account_id" { - default = null - type = string - description = "The id of the logging service account to use for compute resources deployed." -} - -variable "hc_license" { - default = null - type = string - description = "(Not needed if is_replicated_deployment is true) The raw TFE license that is validated on application startup." -} - -variable "iact_subnet_list" { - default = [] - description = <<-EOD - A list of IP address ranges which will be authorized to access the IACT. The ranges must be expressed - in CIDR notation. - EOD - type = list(string) -} - -variable "is_replicated_deployment" { - type = bool - description = "TFE will be installed using a Replicated license and deployment method." - default = true -} - -variable "license_file" { - default = null - type = string - description = "The local path to the Terraform Enterprise license to be provided by CI." -} - -variable "registry_password" { - default = null - type = string - description = "(Not needed if is_replicated_deployment is true) The password for the docker registry from which to source the terraform_enterprise container images." -} - -variable "registry_username" { - default = null - type = string - description = "(Not needed if is_replicated_deployment is true) The username for the docker registry from which to source the terraform_enterprise container images." -} - -variable "tfe_hostname" { - default = null - description = "Hostname of the Terraform Enterprise instance which manages the base infrastructure." - type = string -} -variable "tfe_image_tag" { - default = "latest" - type = string - description = "(Not needed if is_replicated_deployment is true) The image version of the terraform-enterprise image (e.g. \"1234567\")" -} - -variable "tfe_organization" { - default = null - description = "Organization of the Terraform Enterprise instance which manages the base infrastructure." - type = string -} - -variable "tfe_token" { - default = null - description = "Token of the Terraform Enterprise instance which manages the base infrastructure." - type = string -} - -variable "tfe_workspace" { - default = null - description = "Workspace of the Terraform Enterprise instance which manages the base infrastructure." - type = string -} - -variable "tfe" { - default = null - description = "Attributes of the Terraform Enterprise instance which manages the base infrastructure." - type = object({ - hostname = string - organization = string - token = string - workspace = string - }) -} diff --git a/tests/public-active-active/versions.tf b/tests/public-active-active/versions.tf deleted file mode 100644 index 1f8bd43a..00000000 --- a/tests/public-active-active/versions.tf +++ /dev/null @@ -1,29 +0,0 @@ -# Copyright (c) HashiCorp, Inc. -# SPDX-License-Identifier: MPL-2.0 - -terraform { - required_version = ">= 0.14" - backend "remote" { - organization = "terraform-enterprise-modules-test" - - workspaces { - name = "google-public-active-active" - } - } - required_providers { - google = { - source = "hashicorp/google" - version = "~> 3.90" - } - - random = { - source = "hashicorp/random" - version = "~> 3.0" - } - - tfe = { - source = "hashicorp/tfe" - version = "~> 0.26" - } - } -} diff --git a/tests/standalone-external-rhel8-worker/README.md b/tests/standalone-external-rhel8-worker/README.md deleted file mode 100644 index 852e4133..00000000 --- a/tests/standalone-external-rhel8-worker/README.md +++ /dev/null @@ -1,27 +0,0 @@ -# TEST: Standalone External Services Mode on RHEL 8 with Custom Worker Image - -## About this test - -This test for Terraform Enterprise creates a TFE -installation with the following traits: - -- Standalone -- External Services mode -- a small VM machine type (n1-standard-4) -- RHEL 8 as the VM image -- a publicly accessible HTTP load balancer with TLS termination -- a custom RHEL 7.9 worker image - -## Pre-requisites - -This test assumes the following resources exist: - -- a Cloud DNS managed zone -- a Cloud Load Balancing SSL certificate -- a TFE license on a filepath accessible by tests -- a RHEL 7.9 worker image in an Artifact Registry repository - -## How this test is used - -This test is leveraged by the integration tests in the -`ptfe-replicated` repository. diff --git a/tests/standalone-external-rhel8-worker/data.tf b/tests/standalone-external-rhel8-worker/data.tf deleted file mode 100644 index c8343274..00000000 --- a/tests/standalone-external-rhel8-worker/data.tf +++ /dev/null @@ -1,41 +0,0 @@ -# Copyright (c) HashiCorp, Inc. -# SPDX-License-Identifier: MPL-2.0 - -data "tfe_outputs" "base" { - organization = try(var.tfe.organization, var.tfe_organization) - workspace = try(var.tfe.workspace, var.tfe_workspace) -} - -data "google_project" "project" {} - -data "google_dns_managed_zone" "main" { - name = data.tfe_outputs.base.values.cloud_dns_name -} - -data "google_compute_image" "rhel" { - name = "rhel-8-v20230306" - project = "rhel-cloud" -} - -data "google_compute_region_instance_group" "tfe" { - count = local.enable_ssh_config - self_link = null_resource.wait_for_instances[0].triggers.self_link -} - -data "google_compute_instance" "tfe" { - count = local.enable_ssh_config - self_link = data.google_compute_region_instance_group.tfe[0].instances[0].instance -} - -# This null_data_source is used to prevent Terraform from trying to render local_file.ssh_config file before data. -# google_compute_instance.tfe is available. -# See https://github.com/hashicorp/terraform-provider-local/issues/57 -data "null_data_source" "instance" { - count = local.enable_ssh_config - inputs = { - name = data.google_compute_instance.tfe[0].name - network_ip = data.google_compute_instance.tfe[0].network_interface[0].network_ip - project = data.google_compute_instance.tfe[0].project - zone = data.google_compute_instance.tfe[0].zone - } -} diff --git a/tests/standalone-external-rhel8-worker/locals.tf b/tests/standalone-external-rhel8-worker/locals.tf deleted file mode 100644 index a04c8fc6..00000000 --- a/tests/standalone-external-rhel8-worker/locals.tf +++ /dev/null @@ -1,16 +0,0 @@ -# Copyright (c) HashiCorp, Inc. -# SPDX-License-Identifier: MPL-2.0 - -locals { - repository_name = "terraform-build-worker" - ssh_user = "ubuntu" - enable_ssh_config = var.license_file == null ? 0 : 1 - - project_regions = { - "hc-50fbe27799384c96925f18084d7" = "us-west1" - "tfe-modules-ci-001" = "us-east4" - } - - registry = "quay.io" - repository_location = local.project_regions[data.google_project.project.project_id] -} \ No newline at end of file diff --git a/tests/standalone-external-rhel8-worker/main.tf b/tests/standalone-external-rhel8-worker/main.tf deleted file mode 100644 index cc8ab2f0..00000000 --- a/tests/standalone-external-rhel8-worker/main.tf +++ /dev/null @@ -1,112 +0,0 @@ -# Copyright (c) HashiCorp, Inc. -# SPDX-License-Identifier: MPL-2.0 - -resource "random_pet" "main" { - length = 1 - prefix = "ses" - separator = "-" -} - -# Store TFE License as secret -# --------------------------- -module "secrets" { - count = var.license_file == null || !var.is_replicated_deployment ? 0 : 1 - source = "../../fixtures/secrets" - - license = { - id = random_pet.main.id - path = var.license_file - } -} - -resource "tls_private_key" "main" { - algorithm = "RSA" -} - -resource "local_file" "private_key_pem" { - filename = "${path.module}/work/private-key.pem" - - content = tls_private_key.main.private_key_pem - file_permission = "0600" -} - -module "tfe" { - source = "../.." - - distribution = "rhel" - dns_zone_name = data.google_dns_managed_zone.main.name - fqdn = "${random_pet.main.id}.${trimsuffix(data.google_dns_managed_zone.main.dns_name, ".")}" - namespace = random_pet.main.id - node_count = 1 - tfe_license_secret_id = try(module.secrets[0].license_secret, data.tfe_outputs.base.values.license_secret_id) - - existing_service_account_id = var.existing_service_account_id - custom_image_tag = "${local.repository_location}-docker.pkg.dev/${data.google_project.project.project_id}/${local.repository_name}/rhel-7.9:latest" - iact_subnet_list = ["0.0.0.0/0"] - iact_subnet_time_limit = 60 - labels = { - department = "engineering" - description = "standalone-external-services-scenario-deployed-from-gha" - environment = random_pet.main.id - oktodelete = "true" - product = "terraform-enterprise" - repository = "hashicorp-terraform-google-terraform-enterprise" - team = "terraform-enterprise" - } - load_balancer = "PUBLIC" - operational_mode = "external" - ssl_certificate_name = data.tfe_outputs.base.values.wildcard_ssl_certificate_name - ssl_certificate_secret = var.is_replicated_deployment ? null : data.tfe_outputs.base.values.wildcard_ssl_certificate_secret_id - ssl_private_key_secret = var.is_replicated_deployment ? null : data.tfe_outputs.base.values.wildcard_ssl_private_key_secret_id - vm_disk_source_image = data.google_compute_image.rhel.self_link - vm_machine_type = "n1-standard-4" - vm_metadata = { - "ssh-keys" = "${local.ssh_user}:${tls_private_key.main.public_key_openssh} ${local.ssh_user}" - } - - # FDO Specific Values - is_replicated_deployment = var.is_replicated_deployment - hc_license = var.hc_license - http_port = 8080 - https_port = 8443 - license_reporting_opt_out = true - registry = local.registry - registry_password = var.registry_password - registry_username = var.registry_username - tfe_image = "${local.registry}/hashicorp/terraform-enterprise:${var.tfe_image_tag}" -} - - -resource "google_artifact_registry_repository_iam_member" "main" { - provider = google-beta - count = var.existing_service_account_id == null ? 1 : 0 - location = local.repository_location - member = "serviceAccount:${module.tfe.service_account.email}" - repository = local.repository_name - role = "roles/artifactregistry.reader" -} - -resource "null_resource" "wait_for_instances" { - count = local.enable_ssh_config - triggers = { - self_link = module.tfe.vm_mig.instance_group - } - - provisioner "local-exec" { - command = "sleep 30" - } -} - -resource "local_file" "ssh_config" { - count = local.enable_ssh_config - filename = "${path.module}/work/ssh-config" - - content = templatefile( - "${path.module}/templates/ssh-config.tpl", - { - instance = data.null_data_source.instance[0].outputs - identity_file = local_file.private_key_pem.filename - user = local.ssh_user - } - ) -} diff --git a/tests/standalone-external-rhel8-worker/outputs.tf b/tests/standalone-external-rhel8-worker/outputs.tf deleted file mode 100644 index cc488d27..00000000 --- a/tests/standalone-external-rhel8-worker/outputs.tf +++ /dev/null @@ -1,58 +0,0 @@ -# Copyright (c) HashiCorp, Inc. -# SPDX-License-Identifier: MPL-2.0 - -output "replicated_console_password" { - value = module.tfe.replicated_console_password - sensitive = true - description = "The password for the TFE console" -} - -output "replicated_console_url" { - value = module.tfe.replicated_console_url - description = "Terraform Enterprise Console URL" -} - -output "ptfe_endpoint" { - value = module.tfe.url - description = "Terraform Enterprise Application URL" -} - -output "health_check_url" { - value = module.tfe.health_check_url - description = "Terraform Enterprise Health Check URL" -} - -output "ssh_config_file" { - value = local.enable_ssh_config != 1 ? "To connect to your instance, use the SSH button in the console" : local_file.ssh_config[0].filename - - description = "The pathname of the SSH configuration file that grants access to the compute instance." -} - -output "ssh_private_key" { - value = local.enable_ssh_config != 1 ? "To connect to your instance, use the SSH button in the console" : local_file.private_key_pem.filename - - description = "The pathname of the private SSH key." -} - -output "iact_url" { - value = module.tfe.iact_url - - description = "The URL of the Terraform Enterprise IACT." -} - -output "initial_admin_user_url" { - value = module.tfe.initial_admin_user_url - - description = "The URL of the Terraform Enterprise initial admin user." -} - -output "ptfe_health_check" { - value = module.tfe.health_check_url - description = "Terraform Enterprise Health Check URL" -} - -output "tfe_url" { - value = module.tfe.url - description = "Terraform Enterprise Application URL" -} - diff --git a/tests/standalone-external-rhel8-worker/providers.tf b/tests/standalone-external-rhel8-worker/providers.tf deleted file mode 100644 index 62c66138..00000000 --- a/tests/standalone-external-rhel8-worker/providers.tf +++ /dev/null @@ -1,7 +0,0 @@ -# Copyright (c) HashiCorp, Inc. -# SPDX-License-Identifier: MPL-2.0 - -provider "tfe" { - hostname = try(var.tfe.hostname, var.tfe_hostname) - token = try(var.tfe.token, var.tfe_token) -} diff --git a/tests/standalone-external-rhel8-worker/run-tests.sh b/tests/standalone-external-rhel8-worker/run-tests.sh deleted file mode 100644 index 97ae51e2..00000000 --- a/tests/standalone-external-rhel8-worker/run-tests.sh +++ /dev/null @@ -1,100 +0,0 @@ -#!/bin/bash -# Copyright (c) HashiCorp, Inc. -# SPDX-License-Identifier: MPL-2.0 - - -k6_path="" -k6_tests_dir="" -bastion_key_file="" -skip_init="" - -Help() -{ - # Display Help - echo "This script bootstraps the k6 / tfe-load-test environment and executes a smoke-test against an active TFE instance deployed with the terraform-azure-terraform-enterprise module." - echo - echo "Syntax: run-tests.sh [-h|k|t|s]" - echo "options:" - echo "h Print this Help." - echo "k (required) The path to the k6 binary." - echo "t (required) The path to the tfe-load-test repository." - echo "s (optional) Skip the admin user initialization and tfe token retrieval (This is useful for secondary / repeated test runs)." - echo -} - -# Get the options -while getopts ":hk:t:b:sl" option; do - case $option in - h) # display Help - Help - exit;; - k) # Enter a path to the k6 binary - k6_path=$OPTARG;; - - t) # Enter a path to the tfe-load-test repo - k6_tests_dir=$OPTARG;; - s) # Skip the admin user boostrapping process? - skip_init=1;; - \?) # Invalid option - echo "Error: Invalid option" - exit;; - esac -done - -if [[ -z "$k6_path" ]]; then - echo "k6 path missing. Please use the -k option." - Help - exit 1 -fi - -if [[ -z "$k6_tests_dir" ]]; then - echo "The tfe-load-test repository path missing. Please use the -t option." - Help - exit 1 -fi - -echo " -Executing tests with the following configuration: - k6_path=$k6_path - k6_tests_dir=$k6_tests_dir - skip_init=$skip_init -" - -SCRIPT_DIR="$( cd -- "$( dirname -- "${BASH_SOURCE[0]:-$0}"; )" &> /dev/null && pwd 2> /dev/null; )"; - -cd $SCRIPT_DIR - -if [[ -z "$skip_init" ]]; then - while ! curl \ - -sfS --max-time 5 \ - $HEALTHCHECK_URL; \ - do sleep 5; done - echo " : TFE is healthy and listening." - - echo "Fetching iact token.." - iact_token=$(curl --fail --retry 5 "$IACT_URL") - - TFE_USERNAME="test$(date +%s)" - TFE_PASSWORD=`openssl rand -base64 32` - echo "{\"username\": \"$TFE_USERNAME\", \"email\": \"tf-onprem-team@hashicorp.com\", \"password\": \"$TFE_PASSWORD\"}" \ > ./payload.json - - response=$(\ - curl \ - --retry 5 \ - --header 'Content-Type: application/json' \ - --data @./payload.json \ - --request POST \ - "$IAU_URL"?token="$iact_token") - - tfe_token=$(echo "$response" | jq --raw-output '.token') - rm -f payload.json - - echo "export K6_PATHNAME=$k6_path - export TFE_URL=$TFE_URL - export TFE_API_TOKEN=$tfe_token - export TFE_EMAIL=tf-onprem-team@hashicorp.com" > .env.sh -fi - -source .env.sh -cd $k6_tests_dir -make smoke-test diff --git a/tests/standalone-external-rhel8-worker/templates/ssh-config.tpl b/tests/standalone-external-rhel8-worker/templates/ssh-config.tpl deleted file mode 100644 index 0b214aec..00000000 --- a/tests/standalone-external-rhel8-worker/templates/ssh-config.tpl +++ /dev/null @@ -1,11 +0,0 @@ -Host default - HostName ${instance.network_ip} - User ${user} - Port 22 - UserKnownHostsFile /dev/null - StrictHostKeyChecking no - PasswordAuthentication no - IdentityFile ${identity_file} - IdentitiesOnly yes - LogLevel FATAL - ProxyCommand gcloud compute start-iap-tunnel ${instance.name} 22 --listen-on-stdin --verbosity=warning --project=${instance.project} --zone=${instance.zone} diff --git a/tests/standalone-external-rhel8-worker/variables.tf b/tests/standalone-external-rhel8-worker/variables.tf deleted file mode 100644 index 9da7981d..00000000 --- a/tests/standalone-external-rhel8-worker/variables.tf +++ /dev/null @@ -1,78 +0,0 @@ -# Copyright (c) HashiCorp, Inc. -# SPDX-License-Identifier: MPL-2.0 - -variable "existing_service_account_id" { - default = null - type = string - description = "The id of the logging service account to use for compute resources deployed." -} - -variable "hc_license" { - default = null - type = string - description = "(Not needed if is_replicated_deployment is true) The raw TFE license that is validated on application startup." -} - -variable "is_replicated_deployment" { - type = bool - description = "TFE will be installed using a Replicated license and deployment method." - default = true -} - -variable "license_file" { - default = null - type = string - description = "The local path to the Terraform Enterprise license to be provided by CI." -} - -variable "registry_password" { - default = null - type = string - description = "(Not needed if is_replicated_deployment is true) The password for the docker registry from which to source the terraform_enterprise container images." -} - -variable "registry_username" { - default = null - type = string - description = "(Not needed if is_replicated_deployment is true) The username for the docker registry from which to source the terraform_enterprise container images." -} - -variable "tfe_hostname" { - default = null - description = "Hostname of the Terraform Enterprise instance which manages the base infrastructure." - type = string -} - -variable "tfe_organization" { - default = null - description = "Organization of the Terraform Enterprise instance which manages the base infrastructure." - type = string -} -variable "tfe_image_tag" { - default = "latest" - type = string - description = "(Not needed if is_replicated_deployment is true) The image version of the terraform-enterprise image (e.g. \"1234567\")" -} - -variable "tfe_token" { - default = null - description = "Token of the Terraform Enterprise instance which manages the base infrastructure." - type = string -} - -variable "tfe_workspace" { - default = null - description = "Workspace of the Terraform Enterprise instance which manages the base infrastructure." - type = string -} - -variable "tfe" { - default = null - description = "Attributes of the Terraform Enterprise instance which manages the base infrastructure." - type = object({ - hostname = string - organization = string - token = string - workspace = string - }) -} diff --git a/tests/standalone-external-rhel8-worker/versions.tf b/tests/standalone-external-rhel8-worker/versions.tf deleted file mode 100644 index 07fca5dd..00000000 --- a/tests/standalone-external-rhel8-worker/versions.tf +++ /dev/null @@ -1,44 +0,0 @@ -# Copyright (c) HashiCorp, Inc. -# SPDX-License-Identifier: MPL-2.0 - -terraform { - required_version = ">= 0.14" - - required_providers { - google = { - source = "hashicorp/google" - version = "~> 5.0" - } - - google-beta = { - source = "hashicorp/google-beta" - version = "~> 5.0" - } - - local = { - source = "hashicorp/local" - version = "~> 2.1" - } - - null = { - source = "hashicorp/null" - version = "~> 3.1" - } - - random = { - source = "hashicorp/random" - version = "~> 3.0" - } - - tfe = { - source = "hashicorp/tfe" - version = "~> 0.26" - } - - tls = { - source = "hashicorp/tls" - version = "~> 3.1" - } - } - -} diff --git a/tests/standalone-mounted-disk/README.md b/tests/standalone-mounted-disk/README.md deleted file mode 100644 index 8e3b5195..00000000 --- a/tests/standalone-mounted-disk/README.md +++ /dev/null @@ -1,24 +0,0 @@ -# TEST: Standalone Mounted Disk Mode Terraform Enterprise - -## About this test - -This test for Terraform Enterprise creates a TFE -installation with the following traits. - -- Standalone -- Mounted Disk mode -- a small VM machine type (n1-standard-4) -- Ubuntu 20.04 as the VM image -- a publicly accessible HTTP load balancer with TLS termination - -## Pre-requisites - -This test assumes the following resources exist: - -- a Cloud DNS managed zone -- a Cloud Load Balancing SSL certificate -- a TFE license on a filepath accessible by tests - -## How this test is used - -This test is leveraged by the integration tests in the `ptfe-replicated` repository. diff --git a/tests/standalone-mounted-disk/data.tf b/tests/standalone-mounted-disk/data.tf deleted file mode 100644 index 976c4717..00000000 --- a/tests/standalone-mounted-disk/data.tf +++ /dev/null @@ -1,39 +0,0 @@ -# Copyright (c) HashiCorp, Inc. -# SPDX-License-Identifier: MPL-2.0 - -data "tfe_outputs" "base" { - organization = try(var.tfe.organization, var.tfe_organization) - workspace = try(var.tfe.workspace, var.tfe_workspace) -} - -data "google_dns_managed_zone" "main" { - name = data.tfe_outputs.base.values.cloud_dns_name -} - -data "google_compute_image" "ubuntu" { - name = "ubuntu-2004-focal-v20210211" - project = "ubuntu-os-cloud" -} - -data "google_compute_region_instance_group" "tfe" { - count = local.enable_ssh_config - self_link = null_resource.wait_for_instances[count.index].triggers.self_link -} - -data "google_compute_instance" "tfe" { - count = local.enable_ssh_config - self_link = data.google_compute_region_instance_group.tfe[count.index].instances[0].instance -} - -# This null_data_source is used to prevent Terraform from trying to render local_file.ssh_config file before data. -# google_compute_instance.tfe is available. -# See https://github.com/hashicorp/terraform-provider-local/issues/57 -data "null_data_source" "instance" { - count = local.enable_ssh_config - inputs = { - name = data.google_compute_instance.tfe[0].name - network_ip = data.google_compute_instance.tfe[0].network_interface[0].network_ip - project = data.google_compute_instance.tfe[0].project - zone = data.google_compute_instance.tfe[0].zone - } -} diff --git a/tests/standalone-mounted-disk/locals.tf b/tests/standalone-mounted-disk/locals.tf deleted file mode 100644 index 5d03a2a5..00000000 --- a/tests/standalone-mounted-disk/locals.tf +++ /dev/null @@ -1,18 +0,0 @@ -# Copyright (c) HashiCorp, Inc. -# SPDX-License-Identifier: MPL-2.0 - -locals { - labels = { - department = "engineering" - description = "standalone-mounted-disk-scenario" - environment = random_pet.main.id - oktodelete = "true" - product = "terraform-enterprise" - repository = "hashicorp-terraform-google-terraform-enterprise" - team = "terraform-enterprise" - } - - enable_ssh_config = var.license_file == null ? 0 : 1 - registry = "quay.io" - ssh_user = "ubuntu" -} diff --git a/tests/standalone-mounted-disk/main.tf b/tests/standalone-mounted-disk/main.tf deleted file mode 100644 index c12b29c1..00000000 --- a/tests/standalone-mounted-disk/main.tf +++ /dev/null @@ -1,94 +0,0 @@ -# Copyright (c) HashiCorp, Inc. -# SPDX-License-Identifier: MPL-2.0 - -resource "random_pet" "main" { - length = 1 - prefix = "smd" - separator = "-" -} - -# Store TFE License as secret -# --------------------------- -module "secrets" { - count = var.license_file == null || !var.is_replicated_deployment ? 0 : 1 - source = "../../fixtures/secrets" - - license = { - id = random_pet.main.id - path = var.license_file - } -} - -resource "tls_private_key" "main" { - algorithm = "RSA" -} - -resource "local_file" "private_key_pem" { - filename = "${path.module}/work/private-key.pem" - - content = tls_private_key.main.private_key_pem - file_permission = "0600" -} - -module "tfe" { - source = "../.." - disk_path = "/opt/hashicorp/data" - distribution = "ubuntu" - dns_zone_name = data.google_dns_managed_zone.main.name - fqdn = "${random_pet.main.id}.${trimsuffix(data.google_dns_managed_zone.main.dns_name, ".")}" - namespace = random_pet.main.id - node_count = 1 - tfe_license_secret_id = try(module.secrets[0].license_secret, data.tfe_outputs.base.values.license_secret_id) - - existing_service_account_id = var.existing_service_account_id - iact_subnet_list = ["0.0.0.0/0"] - iact_subnet_time_limit = 60 - labels = local.labels - load_balancer = "PUBLIC" - operational_mode = "disk" - ssl_certificate_name = data.tfe_outputs.base.values.wildcard_ssl_certificate_name - ssl_certificate_secret = var.is_replicated_deployment ? null : data.tfe_outputs.base.values.wildcard_ssl_certificate_secret_id - ssl_private_key_secret = var.is_replicated_deployment ? null : data.tfe_outputs.base.values.wildcard_ssl_private_key_secret_id - vm_disk_source_image = data.google_compute_image.ubuntu.self_link - vm_machine_type = "n1-standard-4" - vm_metadata = { - "ssh-keys" = "${local.ssh_user}:${tls_private_key.main.public_key_openssh} ${local.ssh_user}" - } - - # FDO Specific Values - is_replicated_deployment = var.is_replicated_deployment - hc_license = var.hc_license - http_port = 8080 - https_port = 8443 - license_reporting_opt_out = true - registry = local.registry - registry_password = var.registry_password - registry_username = var.registry_username - tfe_image = "${local.registry}/hashicorp/terraform-enterprise:${var.tfe_image_tag}" -} - - -resource "null_resource" "wait_for_instances" { - count = local.enable_ssh_config - triggers = { - self_link = module.tfe.vm_mig.instance_group - } - - provisioner "local-exec" { - command = "sleep 30" - } -} - -resource "local_file" "ssh_config" { - count = local.enable_ssh_config - filename = "${path.module}/work/ssh-config" - - content = templatefile( - "${path.module}/templates/ssh-config.tpl", - { - instance = data.null_data_source.instance[0].outputs - identity_file = local_file.private_key_pem.filename - user = local.ssh_user - } - ) -} diff --git a/tests/standalone-mounted-disk/outputs.tf b/tests/standalone-mounted-disk/outputs.tf deleted file mode 100644 index cc488d27..00000000 --- a/tests/standalone-mounted-disk/outputs.tf +++ /dev/null @@ -1,58 +0,0 @@ -# Copyright (c) HashiCorp, Inc. -# SPDX-License-Identifier: MPL-2.0 - -output "replicated_console_password" { - value = module.tfe.replicated_console_password - sensitive = true - description = "The password for the TFE console" -} - -output "replicated_console_url" { - value = module.tfe.replicated_console_url - description = "Terraform Enterprise Console URL" -} - -output "ptfe_endpoint" { - value = module.tfe.url - description = "Terraform Enterprise Application URL" -} - -output "health_check_url" { - value = module.tfe.health_check_url - description = "Terraform Enterprise Health Check URL" -} - -output "ssh_config_file" { - value = local.enable_ssh_config != 1 ? "To connect to your instance, use the SSH button in the console" : local_file.ssh_config[0].filename - - description = "The pathname of the SSH configuration file that grants access to the compute instance." -} - -output "ssh_private_key" { - value = local.enable_ssh_config != 1 ? "To connect to your instance, use the SSH button in the console" : local_file.private_key_pem.filename - - description = "The pathname of the private SSH key." -} - -output "iact_url" { - value = module.tfe.iact_url - - description = "The URL of the Terraform Enterprise IACT." -} - -output "initial_admin_user_url" { - value = module.tfe.initial_admin_user_url - - description = "The URL of the Terraform Enterprise initial admin user." -} - -output "ptfe_health_check" { - value = module.tfe.health_check_url - description = "Terraform Enterprise Health Check URL" -} - -output "tfe_url" { - value = module.tfe.url - description = "Terraform Enterprise Application URL" -} - diff --git a/tests/standalone-mounted-disk/providers.tf b/tests/standalone-mounted-disk/providers.tf deleted file mode 100644 index 62c66138..00000000 --- a/tests/standalone-mounted-disk/providers.tf +++ /dev/null @@ -1,7 +0,0 @@ -# Copyright (c) HashiCorp, Inc. -# SPDX-License-Identifier: MPL-2.0 - -provider "tfe" { - hostname = try(var.tfe.hostname, var.tfe_hostname) - token = try(var.tfe.token, var.tfe_token) -} diff --git a/tests/standalone-mounted-disk/run-tests.sh b/tests/standalone-mounted-disk/run-tests.sh deleted file mode 100644 index 97ae51e2..00000000 --- a/tests/standalone-mounted-disk/run-tests.sh +++ /dev/null @@ -1,100 +0,0 @@ -#!/bin/bash -# Copyright (c) HashiCorp, Inc. -# SPDX-License-Identifier: MPL-2.0 - - -k6_path="" -k6_tests_dir="" -bastion_key_file="" -skip_init="" - -Help() -{ - # Display Help - echo "This script bootstraps the k6 / tfe-load-test environment and executes a smoke-test against an active TFE instance deployed with the terraform-azure-terraform-enterprise module." - echo - echo "Syntax: run-tests.sh [-h|k|t|s]" - echo "options:" - echo "h Print this Help." - echo "k (required) The path to the k6 binary." - echo "t (required) The path to the tfe-load-test repository." - echo "s (optional) Skip the admin user initialization and tfe token retrieval (This is useful for secondary / repeated test runs)." - echo -} - -# Get the options -while getopts ":hk:t:b:sl" option; do - case $option in - h) # display Help - Help - exit;; - k) # Enter a path to the k6 binary - k6_path=$OPTARG;; - - t) # Enter a path to the tfe-load-test repo - k6_tests_dir=$OPTARG;; - s) # Skip the admin user boostrapping process? - skip_init=1;; - \?) # Invalid option - echo "Error: Invalid option" - exit;; - esac -done - -if [[ -z "$k6_path" ]]; then - echo "k6 path missing. Please use the -k option." - Help - exit 1 -fi - -if [[ -z "$k6_tests_dir" ]]; then - echo "The tfe-load-test repository path missing. Please use the -t option." - Help - exit 1 -fi - -echo " -Executing tests with the following configuration: - k6_path=$k6_path - k6_tests_dir=$k6_tests_dir - skip_init=$skip_init -" - -SCRIPT_DIR="$( cd -- "$( dirname -- "${BASH_SOURCE[0]:-$0}"; )" &> /dev/null && pwd 2> /dev/null; )"; - -cd $SCRIPT_DIR - -if [[ -z "$skip_init" ]]; then - while ! curl \ - -sfS --max-time 5 \ - $HEALTHCHECK_URL; \ - do sleep 5; done - echo " : TFE is healthy and listening." - - echo "Fetching iact token.." - iact_token=$(curl --fail --retry 5 "$IACT_URL") - - TFE_USERNAME="test$(date +%s)" - TFE_PASSWORD=`openssl rand -base64 32` - echo "{\"username\": \"$TFE_USERNAME\", \"email\": \"tf-onprem-team@hashicorp.com\", \"password\": \"$TFE_PASSWORD\"}" \ > ./payload.json - - response=$(\ - curl \ - --retry 5 \ - --header 'Content-Type: application/json' \ - --data @./payload.json \ - --request POST \ - "$IAU_URL"?token="$iact_token") - - tfe_token=$(echo "$response" | jq --raw-output '.token') - rm -f payload.json - - echo "export K6_PATHNAME=$k6_path - export TFE_URL=$TFE_URL - export TFE_API_TOKEN=$tfe_token - export TFE_EMAIL=tf-onprem-team@hashicorp.com" > .env.sh -fi - -source .env.sh -cd $k6_tests_dir -make smoke-test diff --git a/tests/standalone-mounted-disk/templates/ssh-config.tpl b/tests/standalone-mounted-disk/templates/ssh-config.tpl deleted file mode 100644 index 0b214aec..00000000 --- a/tests/standalone-mounted-disk/templates/ssh-config.tpl +++ /dev/null @@ -1,11 +0,0 @@ -Host default - HostName ${instance.network_ip} - User ${user} - Port 22 - UserKnownHostsFile /dev/null - StrictHostKeyChecking no - PasswordAuthentication no - IdentityFile ${identity_file} - IdentitiesOnly yes - LogLevel FATAL - ProxyCommand gcloud compute start-iap-tunnel ${instance.name} 22 --listen-on-stdin --verbosity=warning --project=${instance.project} --zone=${instance.zone} diff --git a/tests/standalone-mounted-disk/variables.tf b/tests/standalone-mounted-disk/variables.tf deleted file mode 100644 index 90cc9cbe..00000000 --- a/tests/standalone-mounted-disk/variables.tf +++ /dev/null @@ -1,79 +0,0 @@ -# Copyright (c) HashiCorp, Inc. -# SPDX-License-Identifier: MPL-2.0 - -variable "existing_service_account_id" { - default = null - type = string - description = "The id of the logging service account to use for compute resources deployed." -} - -variable "hc_license" { - default = null - type = string - description = "(Not needed if is_replicated_deployment is true) The raw TFE license that is validated on application startup." -} - -variable "is_replicated_deployment" { - type = bool - description = "TFE will be installed using a Replicated license and deployment method." - default = true -} - -variable "license_file" { - default = null - type = string - description = "The local path to the Terraform Enterprise license to be provided by CI." -} - -variable "registry_password" { - default = null - type = string - description = "(Not needed if is_replicated_deployment is true) The password for the docker registry from which to source the terraform_enterprise container images." -} - -variable "registry_username" { - default = null - type = string - description = "(Not needed if is_replicated_deployment is true) The username for the docker registry from which to source the terraform_enterprise container images." -} - -variable "tfe_hostname" { - default = null - description = "Hostname of the Terraform Enterprise instance which manages the base infrastructure." - type = string -} - -variable "tfe_image_tag" { - default = "latest" - type = string - description = "(Not needed if is_replicated_deployment is true) The image version of the terraform-enterprise image (e.g. \"1234567\")" -} - -variable "tfe_organization" { - default = null - description = "Organization of the Terraform Enterprise instance which manages the base infrastructure." - type = string -} - -variable "tfe_token" { - default = null - description = "Token of the Terraform Enterprise instance which manages the base infrastructure." - type = string -} - -variable "tfe_workspace" { - default = null - description = "Workspace of the Terraform Enterprise instance which manages the base infrastructure." - type = string -} - -variable "tfe" { - default = null - description = "Attributes of the Terraform Enterprise instance which manages the base infrastructure." - type = object({ - hostname = string - organization = string - token = string - workspace = string - }) -} diff --git a/tests/standalone-mounted-disk/versions.tf b/tests/standalone-mounted-disk/versions.tf deleted file mode 100644 index 61bbda43..00000000 --- a/tests/standalone-mounted-disk/versions.tf +++ /dev/null @@ -1,39 +0,0 @@ -# Copyright (c) HashiCorp, Inc. -# SPDX-License-Identifier: MPL-2.0 - -terraform { - required_version = ">= 0.14" - - required_providers { - google = { - source = "hashicorp/google" - version = "~> 5.0" - } - - local = { - source = "hashicorp/local" - version = "~> 2.1" - } - - null = { - source = "hashicorp/null" - version = "~> 3.1" - } - - random = { - source = "hashicorp/random" - version = "~> 3.0" - } - - tfe = { - source = "hashicorp/tfe" - version = "~> 0.26" - } - - tls = { - source = "hashicorp/tls" - version = "~> 3.1" - } - } -} -