diff --git a/enos/enos-scenario-e2e-docker-base-plus.hcl b/enos/enos-scenario-e2e-docker-base-plus.hcl index f430165ad..0ac6a4976 100644 --- a/enos/enos-scenario-e2e-docker-base-plus.hcl +++ b/enos/enos-scenario-e2e-docker-base-plus.hcl @@ -101,6 +101,18 @@ scenario "e2e_docker_base_plus" { } } + step "create_host" { + module = module.docker_openssh_server + depends_on = [ + step.create_docker_network + ] + variables { + image_name = "${var.docker_mirror}/linuxserver/openssh-server:latest" + network_name = [local.network_cluster] + private_key_file_path = local.aws_ssh_private_key_path + } + } + step "run_e2e_test" { module = module.test_e2e_docker depends_on = [ @@ -120,12 +132,14 @@ scenario "e2e_docker_base_plus" { local_boundary_dir = step.build_boundary_docker_image.cli_zip_path local_boundary_src_dir = local.local_boundary_src_dir aws_ssh_private_key_path = local.aws_ssh_private_key_path - target_address = step.create_boundary_database.container_name - target_port = step.create_boundary_database.port + target_address = step.create_host.address + target_port = step.create_host.port target_user = "ubuntu" postgres_user = step.create_boundary_database.user postgres_password = step.create_boundary_database.password postgres_database_name = step.create_boundary_database.database_name + postgres_address = step.create_boundary_database.container_name + postgres_port = step.create_boundary_database.port ldap_address = step.create_ldap_server.address ldap_domain_dn = step.create_ldap_server.domain_dn ldap_admin_dn = step.create_ldap_server.admin_dn diff --git a/enos/modules/test_e2e_docker/main.tf b/enos/modules/test_e2e_docker/main.tf index 6bfb5dc33..33eaa1429 100644 --- a/enos/modules/test_e2e_docker/main.tf +++ b/enos/modules/test_e2e_docker/main.tf @@ -189,6 +189,16 @@ variable "postgres_database_name" { type = string default = "" } +variable "postgres_address" { + description = "Address of the postgres database" + type = string + default = "" +} +variable "postgres_port" { + description = "Port of the postgres database" + type = string + default = "" +} variable "ldap_address" { description = "URL to LDAP server" type = string @@ -336,6 +346,8 @@ resource "enos_local_exec" "run_e2e_test" { E2E_POSTGRES_USER = var.postgres_user E2E_POSTGRES_PASSWORD = var.postgres_password E2E_POSTGRES_DB_NAME = var.postgres_database_name + E2E_POSTGRES_ADDRESS = var.postgres_address + E2E_POSTGRES_PORT = var.postgres_port E2E_WORKER_TAG_INGRESS = var.worker_tag_ingress E2E_WORKER_TAG_EGRESS = var.worker_tag_egress E2E_WORKER_TAG_COLLOCATED = var.worker_tag_collocated diff --git a/enos/modules/test_e2e_docker/test_runner.sh b/enos/modules/test_e2e_docker/test_runner.sh index 1e7727917..32e9c783b 100644 --- a/enos/modules/test_e2e_docker/test_runner.sh +++ b/enos/modules/test_e2e_docker/test_runner.sh @@ -37,6 +37,8 @@ docker run \ -e "E2E_POSTGRES_USER=$E2E_POSTGRES_USER" \ -e "E2E_POSTGRES_PASSWORD=$E2E_POSTGRES_PASSWORD" \ -e "E2E_POSTGRES_DB_NAME=$E2E_POSTGRES_DB_NAME" \ + -e "E2E_POSTGRES_ADDRESS=$E2E_POSTGRES_ADDRESS" \ + -e "E2E_POSTGRES_PORT=$E2E_POSTGRES_PORT" \ -e "E2E_WORKER_TAG_INGRESS=$E2E_WORKER_TAG_INGRESS" \ -e "E2E_WORKER_TAG_EGRESS=$E2E_WORKER_TAG_EGRESS" \ -e "E2E_WORKER_TAG_COLLOCATED=$E2E_WORKER_TAG_COLLOCATED" \ diff --git a/testing/internal/e2e/tests/base_plus/env_test.go b/testing/internal/e2e/tests/base_plus/env_test.go index 6bb9af316..63ce37118 100644 --- a/testing/internal/e2e/tests/base_plus/env_test.go +++ b/testing/internal/e2e/tests/base_plus/env_test.go @@ -13,6 +13,8 @@ type config struct { PostgresDbName string `envconfig:"E2E_POSTGRES_DB_NAME" required:"true"` PostgresUser string `envconfig:"E2E_POSTGRES_USER" required:"true"` PostgresPassword string `envconfig:"E2E_POSTGRES_PASSWORD" required:"true"` + PostgresAddress string `envconfig:"E2E_POSTGRES_ADDRESS" required:"true"` + PostgresPort string `envconfig:"E2E_POSTGRES_PORT" required:"true"` LdapAddress string `envconfig:"E2E_LDAP_ADDR" required:"true"` // e.g. ldap://ldap LdapDomainDn string `envconfig:"E2E_LDAP_DOMAIN_DN" required:"true"` // e.g. dc=example,dc=org LdapAdminDn string `envconfig:"E2E_LDAP_ADMIN_DN" required:"true"` // e.g. cn=admin,dc=example,dc=org diff --git a/testing/internal/e2e/tests/base_plus/target_tcp_connect_postgres_test.go b/testing/internal/e2e/tests/base_plus/target_tcp_connect_postgres_test.go index f89d6b7ba..9c77a9ccc 100644 --- a/testing/internal/e2e/tests/base_plus/target_tcp_connect_postgres_test.go +++ b/testing/internal/e2e/tests/base_plus/target_tcp_connect_postgres_test.go @@ -41,8 +41,8 @@ func TestCliTcpTargetConnectPostgres(t *testing.T) { t, ctx, projectId, - c.TargetPort, - []target.Option{target.WithAddress(c.TargetAddress)}, + c.PostgresPort, + []target.Option{target.WithAddress(c.PostgresAddress)}, ) require.NoError(t, err) storeId, err := boundary.CreateCredentialStoreStaticCli(t, ctx, projectId)