From 71a72d70d43a48c77c63fc570013e040f8ae9923 Mon Sep 17 00:00:00 2001 From: stack72 Date: Thu, 7 Jan 2021 15:18:36 +0000 Subject: [PATCH] Ensuring each of the aws assumeRole tests use the current unix time in their usernames --- misc/test/examples_test.go | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/misc/test/examples_test.go b/misc/test/examples_test.go index e8f5ddcf6..7f3e570a1 100644 --- a/misc/test/examples_test.go +++ b/misc/test/examples_test.go @@ -24,11 +24,12 @@ import ( ) func TestAccAwsGoAssumeRole(t *testing.T) { + nanos := time.Now().UnixNano() test := getAWSBase(t). With(integration.ProgramTestOptions{ Dir: path.Join(getCwd(t), "..", "..", "aws-go-assume-role", "create-role"), Config: map[string]string{ - "create-role:unprivilegedUsername": "unpriv-go", + "create-role:unprivilegedUsername": fmt.Sprintf("unpriv-go-%d", nanos), }, }) @@ -116,11 +117,12 @@ func TestAccAwsGoWebserver(t *testing.T) { } func TestAccAwsCsAssumeRole(t *testing.T) { + nanos := time.Now().UnixNano() test := getAWSBase(t). With(integration.ProgramTestOptions{ Dir: path.Join(getCwd(t), "..", "..", "aws-cs-assume-role", "create-role"), Config: map[string]string{ - "create-role:unprivilegedUsername": "unpriv-cs", + "create-role:unprivilegedUsername": fmt.Sprintf("unpriv-cs-%d", nanos), }, }) @@ -277,11 +279,12 @@ func TestAccAwsGoAppSync(t *testing.T) { } func TestAccAwsPyAssumeRole(t *testing.T) { + nanos := time.Now().UnixNano() test := getAWSBase(t). With(integration.ProgramTestOptions{ Dir: path.Join(getCwd(t), "..", "..", "aws-py-assume-role", "create-role"), Config: map[string]string{ - "create-role:unprivilegedUsername": "unpriv-py", + "create-role:unprivilegedUsername": fmt.Sprintf("unpriv-py-%d", nanos), }, }) @@ -382,11 +385,12 @@ func TestAccAwsTsAppSync(t *testing.T) { } func TestAccAwsTsAssumeRole(t *testing.T) { + nanos := time.Now().UnixNano() test := getAWSBase(t). With(integration.ProgramTestOptions{ Dir: path.Join(getCwd(t), "..", "..", "aws-ts-assume-role", "create-role"), Config: map[string]string{ - "create-role:unprivilegedUsername": "unpriv", + "create-role:unprivilegedUsername": fmt.Sprintf("unpriv-%d", nanos), }, })