From dfa94c79903a043a5eda7576861179b9958785e0 Mon Sep 17 00:00:00 2001 From: Jeff Malnick Date: Tue, 13 Oct 2020 07:41:32 -0700 Subject: [PATCH] tests: allow overriding auth variables in CLI tests (#647) * tests: ensure default user can connect to default target and ensure created target has intended host sets * docs: update readme for CLI tests with how to run against arbitrary clusters * feat: override auth variables in CLI tests --- internal/tests/cli/README.md | 15 +++++++++++++++ internal/tests/cli/boundary/_helpers.bash | 6 +++--- 2 files changed, 18 insertions(+), 3 deletions(-) diff --git a/internal/tests/cli/README.md b/internal/tests/cli/README.md index c0e140d6c..804872273 100644 --- a/internal/tests/cli/README.md +++ b/internal/tests/cli/README.md @@ -34,3 +34,18 @@ export BOUNDARY_ADDR= ```bash bats -p boundary/ ``` + +## Running Tests Against Other Deployments + +You can run this suite against an arbitrary cluster by overriding the following env vars: + +```bash +DEFAULT_LOGIN= \ +DEFAULT_PASSWORD= \ +BOUNDARY_ADDR=http://boundary-test-controller-salmon-b70f2710539143b4.elb.us-east-1.amazonaws.com:9200 \ +bats boundary/ +``` + +~> Note that these tests currently expect generated resources to exist. Failure to run against a Boundary deployment that does +not have generated resources will result in a lot of test failures. Future work includes breaking thses tests out in a way +that makes them not dependant on generated resources. diff --git a/internal/tests/cli/boundary/_helpers.bash b/internal/tests/cli/boundary/_helpers.bash index a970164d1..a79886a74 100644 --- a/internal/tests/cli/boundary/_helpers.bash +++ b/internal/tests/cli/boundary/_helpers.bash @@ -1,7 +1,7 @@ export BOUNDARY_ADDR="${BOUNDARY_ADDR:-http://127.0.0.1:9200}" -export DEFAULT_PASSWORD='password' -export DEFAULT_LOGIN='admin' -export DEFAULT_AMPW='ampw_1234567890' +export DEFAULT_PASSWORD="${DEFAULT_PASSWORD:-password}" +export DEFAULT_LOGIN="${DEFAULT_LOGIN:-admin}" +export DEFAULT_AMPW="${DEFAULT_AMPW:-ampw_1234567890}" export DEFAULT_P_ID='p_1234567890' export DEFAULT_O_ID='o_1234567890' export DEFAULT_GLOBAL='global'