Skip to content

Commit

Permalink
Ensuring each of the aws assumeRole tests use the current unix time i…
Browse files Browse the repository at this point in the history
…n their usernames
  • Loading branch information
stack72 committed Jan 7, 2021
1 parent 4529da5 commit 71a72d7
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions misc/test/examples_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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),
},
})

Expand Down Expand Up @@ -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),
},
})

Expand Down Expand Up @@ -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),
},
})

Expand Down Expand Up @@ -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),
},
})

Expand Down

0 comments on commit 71a72d7

Please sign in to comment.