Skip to content
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions enos/enos-scenario-e2e-aws-rdp-base.hcl
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,7 @@ scenario "e2e_aws_rdp_base" {
client_version = matrix.client
boundary_cli_zip_path = step.build_boundary_windows.artifact_path
boundary_src_path = local.local_boundary_src_dir
github_token = var.github_token
}
}

Expand Down
6 changes: 6 additions & 0 deletions enos/enos-variables.hcl
Original file line number Diff line number Diff line change
Expand Up @@ -271,3 +271,9 @@ variable "windows_instance_type" {
type = string
default = "m7i-flex.xlarge"
}

variable "github_token" {
description = "github token needed to run automated tests (requires read access to hashicorp repos)"
type = string
default = null
}
7 changes: 6 additions & 1 deletion enos/enos.vars.hcl
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@
// if running GCP scenarios. This should not be used in combination with gcp_private_key_path.
// gcp_private_key = ""

// The GCP private_key_id. Only needed if running GCP scenarios.
// The GCP private_key_id. Only needed if running GCP scenarios.
// gcp_private_key_id = ""

// The GCP client_email used to authenticate with GCP
Expand All @@ -91,3 +91,8 @@
// The directory that contains the source code of boundary-ui. This is used for
// front-end e2e testing (UI scenarios) in CI. Only needed if e2e_debug_no_run = false.
// local_boundary_ui_src_dir = "/Users/<user>/Developer/boundary-ui"

// Github token to load go modules on windows client
// only required for running automation on RDP e2e test cases
// Token requires read access to hashicorp repositories
// github_token = ""
6 changes: 6 additions & 0 deletions enos/modules/aws_windows_client/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -285,6 +285,10 @@ resource "enos_local_exec" "wait_for_ssh" {
inline = ["timeout 600s bash -c 'until ssh -i ${abspath(local_sensitive_file.private_key.filename)} -o BatchMode=Yes -o IdentitiesOnly=yes -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no Administrator@${aws_instance.client.public_ip} \"echo ready\"; do sleep 10; done'"]
}

resource "enos_local_exec" "get_go_version" {
inline = ["cat $(echo $(git rev-parse --show-toplevel))/.go-version | xargs"]
}

resource "enos_local_exec" "make_dir" {
count = var.boundary_cli_zip_path != "" ? 1 : 0
depends_on = [
Expand Down Expand Up @@ -333,6 +337,8 @@ resource "local_file" "powershell_script" {
content = templatefile("${path.module}/scripts/setup.ps1", {
boundary_cli_zip_path = "${local.test_dir}/${basename(local.boundary_cli_zip_path)}"
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}"
})
filename = "${path.root}/.terraform/tmp/setup_windows_client.ps1"
}
Expand Down
23 changes: 22 additions & 1 deletion enos/modules/aws_windows_client/scripts/setup.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@
$destination = Split-Path -Path ${boundary_cli_zip_path}
Expand-Archive -Path ${boundary_cli_zip_path} -DestinationPath $destination -Force

# Unzip boundary src to new directory
$src_destination = "C:/Test/boundary-src"
New-Item -Path $src_destination -ItemType Directory
Expand-Archive -Path C:/Test//boundary-src.zip -DestinationPath $src_destination -Force

# Add Boundary CLI to PATH
$existingPath = [Environment]::GetEnvironmentVariable(
"Path",
Expand All @@ -28,4 +33,20 @@ Import-Module "$env:ChocolateyInstall/helpers/chocolateyInstaller.psm1"
refreshenv

# install mremoteng
choco install mremoteng -y
choco install mremoteng -y

# powershell script
choco install golang -y --version ${go_version}
refreshenv
choco install git -y
refreshenv
choco install mingw -y
refreshenv
# needs cmake >3.7 and <4.0
choco install cmake --version 3.31.8 -y
refreshenv

# Set the github token if provided
if ("${github_token}" -ne "") {
git config --system url."https://oauth2:${github_token}@github.com".insteadOf "https://github.com"
}
6 changes: 6 additions & 0 deletions enos/modules/aws_windows_client/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -47,3 +47,9 @@ variable "boundary_src_path" {
type = string
default = ""
}

variable "github_token" {
description = "Github token needed to run automated tests. Token requires read access to hashicorp repositories"
type = string
default = ""
}
Loading