test(e2e): Add test for LDAP (#4061)

* test(e2e): Add test for LDAP

This adds the infrastructure and a test for an LDAP workflow

* test(e2e): Refactor test packages

This reduces the number of scenarios needed

* CR

* fixup! test(e2e): Add test for LDAP
This commit is contained in:
Michael Li authored and GitHub committed 2023-11-28 16:25:26 -05:00
1 parent a89573b35f
commit 093f889333
13 files changed
+451 -41

No files matched your search

+60 -12
View File
@@ -161,28 +161,69 @@ variable "aws_bucket_name" {
default = ""
}
variable "worker_tag_ingress" {
type = string
default = ""
description = "Worker tag for the ingress worker"
type = string
default = ""
}
variable "worker_tag_egress" {
type = string
default = ""
description = "Worker tag for the egress worker"
type = string
default = ""
}
variable "worker_tag_collocated" {
type = string
default = ""
description = "Worker tag for the collocated worker"
type = string
default = ""
}
variable "postgres_user" {
type = string
default = ""
description = "Username for accessing the postgres database"
type = string
default = ""
}
variable "postgres_password" {
type = string
default = ""
description = "Password for accessing the postgres database"
type = string
default = ""
}
variable "postgres_database_name" {
type = string
default = ""
description = "Name of postgres database"
type = string
default = ""
}
variable "ldap_address" {
description = "URL to LDAP server"
type = string
default = ""
}
variable "ldap_domain_dn" {
description = "Distinguished Name to the LDAP domain"
type = string
default = ""
}
variable "ldap_admin_dn" {
description = "Distinguished Name to the LDAP admin user"
type = string
default = ""
}
variable "ldap_admin_password" {
description = "Password for the LDAP admin user"
type = string
default = ""
}
variable "ldap_user_name" {
description = "Username of an LDAP user"
type = string
default = ""
}
variable "ldap_user_password" {
description = "Password for an LDAP user"
type = string
default = ""
}
variable "ldap_group_name" {
description = "Name of LDAP group"
type = string
default = ""
}
variable "test_timeout" {
type = string
@@ -246,6 +287,13 @@ resource "enos_local_exec" "run_e2e_test" {
E2E_WORKER_TAG_INGRESS = var.worker_tag_ingress
E2E_WORKER_TAG_EGRESS = var.worker_tag_egress
E2E_WORKER_TAG_COLLOCATED = var.worker_tag_collocated
E2E_LDAP_ADDR = var.ldap_address
E2E_LDAP_DOMAIN_DN = var.ldap_domain_dn
E2E_LDAP_ADMIN_DN = var.ldap_admin_dn
E2E_LDAP_ADMIN_PASSWORD = var.ldap_admin_password
E2E_LDAP_USER_NAME = var.ldap_user_name
E2E_LDAP_USER_PASSWORD = var.ldap_user_password
E2E_LDAP_GROUP_NAME = var.ldap_group_name
BOUNDARY_DIR = abspath(var.local_boundary_src_dir)
BOUNDARY_CLI_DIR = abspath(var.local_boundary_dir)
MODULE_DIR = abspath(path.module)
@@ -39,6 +39,13 @@ docker run \
-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" \
-e "E2E_LDAP_ADDR=$E2E_LDAP_ADDR" \
-e "E2E_LDAP_DOMAIN_DN=$E2E_LDAP_DOMAIN_DN" \
-e "E2E_LDAP_ADMIN_DN=$E2E_LDAP_ADMIN_DN" \
-e "E2E_LDAP_ADMIN_PASSWORD=$E2E_LDAP_ADMIN_PASSWORD" \
-e "E2E_LDAP_USER_NAME=$E2E_LDAP_USER_NAME" \
-e "E2E_LDAP_USER_PASSWORD=$E2E_LDAP_USER_PASSWORD" \
-e "E2E_LDAP_GROUP_NAME=$E2E_LDAP_GROUP_NAME" \
--mount type=bind,src=$BOUNDARY_DIR,dst=/src/boundary/ \
--mount type=bind,src=$MODULE_DIR/../..,dst=/testlogs \
--mount type=bind,src=$(go env GOCACHE),dst=/root/.cache/go-build \