chore(e2e): Enable Vault for RDP e2e tests (#6223)

* chore(e2e): Update vault addresses

* chore(e2e): Install vault CLI on windows client
pull/6226/head
Michael Li 6 months ago committed by GitHub
parent 4e78c68195
commit 272cad00b2
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -115,6 +115,7 @@ scenario "e2e_aws_rdp_base" {
boundary_src_path = local.local_boundary_src_dir
github_token = var.github_token
ip_version = local.ip_version
vault_version = var.vault_version
}
}
@ -321,10 +322,10 @@ scenario "e2e_aws_rdp_base" {
client_password = step.create_windows_client.test_password
client_test_dir = step.create_windows_client.test_dir
client_ssh_key = step.create_windows_client.ssh_private_key
vault_addr_public = step.create_vault_cluster.instance_public_ips_ipv4[0]
vault_addr_private = step.create_vault_cluster.instance_private_ips[0]
vault_root_token = step.create_vault_cluster.vault_root_token
client_version = matrix.client
vault_addr_public = step.create_vault_cluster.instance_addresses[0]
vault_addr_private = step.create_vault_cluster.instance_addresses_private[0]
vault_root_token = step.create_vault_cluster.vault_root_token
}
}

@ -350,6 +350,7 @@ resource "local_file" "powershell_script" {
boundary_src_zip_path = "${local.test_dir}/${basename(archive_file.boundary_src_zip[0].output_path)}"
go_version = "${enos_local_exec.get_go_version.stdout}"
github_token = "${var.github_token}"
vault_version = "${var.vault_version}"
})
filename = "${path.root}/.terraform/tmp/setup_windows_client.ps1"
}

@ -23,6 +23,17 @@ $newPath = $existingPath + ";" + $destination
[EnvironmentVariableTarget]::Machine
)
Write-Host "Checking if Vault needs to be installed..."
if ("${vault_version}" -ne "") {
Write-Host "Installing Vault version ${vault_version}..."
# Download and install Vault
$vaultZipUrl = "https://releases.hashicorp.com/vault/${vault_version}/vault_${vault_version}_windows_amd64.zip"
$vaultZipPath = Join-Path $destination "vault.zip"
curl.exe -L -o $vaultZipPath $vaultZipUrl
Expand-Archive -Path $vaultZipPath -DestinationPath $destination -Force
}
# Install chocolatey (package manager)
powershell -c "irm https://community.chocolatey.org/install.ps1|iex"

@ -59,3 +59,9 @@ variable "github_token" {
type = string
default = ""
}
variable "vault_version" {
description = "Version of Vault to install on client"
type = string
default = ""
}

Loading…
Cancel
Save