Backport of fix(e2e): Worker not available error in RDP tests into release/0.21.x (#6389)

* backport of commit 2e221ca5e5

* backport of commit b5919db7d6

---------

Co-authored-by: Michael Li <michael.li@hashicorp.com>
pull/6397/head
hc-github-team-secure-boundary 3 weeks ago committed by GitHub
parent d659ac9ef2
commit 368f5670f9
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -290,6 +290,7 @@ scenario "e2e_aws_rdp_base" {
step.create_boundary_cluster,
step.create_rdp_domain_controller,
step.create_rdp_member_server,
step.create_windows_worker,
step.create_bucket
]

@ -478,7 +478,7 @@ resource "time_sleep" "wait_for_reboot" {
resource "enos_local_exec" "wait_for_ssh" {
depends_on = [time_sleep.wait_for_reboot]
count = var.server_version != "2016" ? 1 : 0
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.domain_controller.public_ip} \"echo ready\"; do sleep 10; done'"]
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 -o ConnectTimeout=5 Administrator@${aws_instance.domain_controller.public_ip} \"echo ready\"; do sleep 10; done'"]
}
locals {

@ -282,7 +282,7 @@ resource "time_sleep" "wait_5_minutes" {
resource "enos_local_exec" "wait_for_ssh" {
count = var.server_version != "2016" ? 1 : 0
depends_on = [time_sleep.wait_5_minutes]
inline = ["timeout 600s bash -c 'until ssh -i ${local.private_key} -o BatchMode=Yes -o IdentitiesOnly=yes -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no Administrator@${aws_instance.member_server.public_ip} \"echo ready\"; do sleep 10; done'"]
inline = ["timeout 600s bash -c 'until ssh -i ${local.private_key} -o BatchMode=Yes -o IdentitiesOnly=yes -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -o ConnectTimeout=5 Administrator@${aws_instance.member_server.public_ip} \"echo ready\"; do sleep 10; done'"]
}
# Retrieve the domain hostname of the member server, which will be used in

@ -291,7 +291,7 @@ resource "enos_local_exec" "wait_for_ssh" {
depends_on = [
aws_instance.worker,
]
inline = ["timeout 600s bash -c 'until ssh -i ${local.private_key} -o BatchMode=Yes -o IdentitiesOnly=yes -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no Administrator@${aws_instance.worker.public_ip} \"echo ready\"; do sleep 10; done'"]
inline = ["timeout 600s bash -c 'until ssh -i ${local.private_key} -o BatchMode=Yes -o IdentitiesOnly=yes -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -o ConnectTimeout=5 Administrator@${aws_instance.worker.public_ip} \"echo ready\"; do sleep 10; done'"]
}
resource "enos_local_exec" "make_dir" {
@ -373,7 +373,7 @@ resource "enos_local_exec" "run_powershell_script" {
inline = ["ssh -i ${local.private_key} -o IdentitiesOnly=yes -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no Administrator@${aws_instance.worker.public_ip} ${local.test_dir}/${basename(local_file.powershell_script.filename)}"]
}
resource "time_sleep" "wait_2_minutes" {
resource "time_sleep" "wait_for_instance_reboot_in_script" {
depends_on = [enos_local_exec.run_powershell_script]
create_duration = "2m"
}
@ -384,3 +384,14 @@ resource "local_file" "powershell_script_output" {
content = enos_local_exec.run_powershell_script.stdout
filename = "${path.root}/.terraform/tmp/setup_worker.out"
}
resource "enos_local_exec" "wait_for_worker" {
depends_on = [time_sleep.wait_for_instance_reboot_in_script]
inline = ["timeout 600s bash -c 'until ssh -i ${local.private_key} -o BatchMode=Yes -o IdentitiesOnly=yes -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no Administrator@${aws_instance.worker.public_ip} \"if (-not (Test-Path C:/Test/worker.out)) { exit 1 }\"; do sleep 10; done'"]
}
data "aws_instance" "instance_password" {
depends_on = [enos_local_exec.wait_for_worker]
instance_id = aws_instance.worker.id
get_password_data = true
}

@ -311,7 +311,7 @@ resource "local_sensitive_file" "private_key" {
# can just SSH using the private key
resource "enos_local_exec" "wait_for_ssh" {
depends_on = [aws_instance.client]
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'"]
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 -o ConnectTimeout=5 Administrator@${aws_instance.client.public_ip} \"echo ready\"; do sleep 10; done'"]
}
resource "enos_local_exec" "get_go_version" {

Loading…
Cancel
Save