-
Notifications
You must be signed in to change notification settings - Fork 56
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
DXCDT-414: Custom domains integration tests (#690)
* More reliable tests * Fixing test case * Adding tests, cleanup and get domain ID script * Separating test domain into var * Fix * Removing potentially erroneous verify assertion --------- Co-authored-by: Will Vedder <[email protected]>
- Loading branch information
Showing
4 changed files
with
95 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
config: | ||
inherit-env: true | ||
tests: | ||
001 - list domains: | ||
command: auth0 domains list | ||
exit-code: 0 | ||
002 - create domain with minimal flags: | ||
command: auth0 domains create --domain "integration-test.com" --no-input | ||
exit-code: 0 | ||
stdout: | ||
contains: | ||
- "ID cd_" | ||
- "DOMAIN integration-test.com" | ||
- "STATUS pending_verification" | ||
- "PROVISIONING TYPE auth0_managed_certs" | ||
003 - unsuccessfully create domain with same name: | ||
command: auth0 domains create --domain "integration-test.com" --no-input | ||
exit-code: 1 | ||
stderr: | ||
contains: | ||
- "An unexpected error occurred while attempting to create the custom domain 'integration-test.com': 409 Conflict: The specified custom domain already exists" | ||
004 - show domain: | ||
command: auth0 domains show $(./test/integration/scripts/get-custom-domain-id.sh) --no-input | ||
exit-code: 0 | ||
stdout: | ||
contains: | ||
- "ID cd_" | ||
- "DOMAIN integration-test.com" | ||
- "STATUS pending_verification" | ||
- "PROVISIONING TYPE auth0_managed_certs" | ||
005 - update domain minimal flags: | ||
command: auth0 domains update $(./test/integration/scripts/get-custom-domain-id.sh) --no-input | ||
exit-code: 0 | ||
stdout: | ||
contains: | ||
- "ID cd_" | ||
- "DOMAIN integration-test.com" | ||
- "STATUS pending_verification" | ||
- "PROVISIONING TYPE auth0_managed_certs" | ||
006 - update domain maximal flags: | ||
command: auth0 domains update $(./test/integration/scripts/get-custom-domain-id.sh) --policy recommended --no-input | ||
exit-code: 0 | ||
stdout: | ||
contains: | ||
- "ID cd_" | ||
- "DOMAIN integration-test.com" | ||
- "STATUS pending_verification" | ||
- "PROVISIONING TYPE auth0_managed_certs" | ||
- "TLS POLICY recommended" | ||
007 - verify domain: | ||
command: auth0 domains update $(./test/integration/scripts/get-custom-domain-id.sh) --policy recommended --no-input | ||
exit-code: 0 | ||
stdout: | ||
contains: | ||
- "ID cd_" | ||
- "DOMAIN integration-test.com" | ||
- "PROVISIONING TYPE auth0_managed_certs" | ||
- "TLS POLICY recommended" | ||
008 - delete domain: | ||
command: auth0 domains delete $(./test/integration/scripts/get-custom-domain-id.sh) --no-input | ||
exit-code: 0 | ||
009 - create domain with maximal flags: | ||
command: auth0 domains create --domain "integration-test.com" --verification txt --type auth0 --policy recommended --no-input | ||
exit-code: 0 | ||
stdout: | ||
contains: | ||
- "ID cd_" | ||
- "DOMAIN integration-test.com" | ||
- "STATUS pending_verification" | ||
- "PROVISIONING TYPE auth0_managed_certs" | ||
- "VERIFICATION METHOD txt" | ||
- "TLS POLICY recommended" | ||
- "CUSTOM CLIENT IP HEADER" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
#! /bin/bash | ||
|
||
testing_domain_name="integration-test.com" | ||
|
||
domains=$( auth0 domains list --json --no-input ) | ||
for domain in $( printf "%s" "$domains" | jq -r '.[] | @base64' ); do | ||
_jq() { | ||
echo "${domain}" | base64 --decode | jq -r "${1}" | ||
} | ||
|
||
id=$(_jq '.custom_domain_id') | ||
name=$(_jq '.domain') | ||
|
||
if [[ $name = $testing_domain_name ]] | ||
then | ||
echo $id | ||
exit 0 | ||
fi | ||
exit 1 | ||
done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters