Skip to content

Commit

Permalink
glesys_emailalias acctest cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
norrland committed Sep 28, 2023
1 parent 7f7eb7b commit 42dc6a9
Showing 1 changed file with 5 additions and 16 deletions.
21 changes: 5 additions & 16 deletions glesys/resource_glesys_emailalias_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,16 +19,16 @@ func TestAccEmailAlias_basic(t *testing.T) {
Providers: testGlesysProviders,
Steps: []resource.TestStep{
{
Config: glesysEmailAliasSkeleton(newDomain, "goto = \""+rName+"@"+newDomain+"\""),
Config: glesysEmailAliasSkeleton(newDomain, fmt.Sprintf("goto = \"%s@%s\"", rName, newDomain)),
Check: resource.ComposeTestCheckFunc(
resource.TestCheckResourceAttr(name, "emailalias", "alice@"+newDomain),
resource.TestCheckResourceAttr(name, "goto", rName+"@"+newDomain),
resource.TestCheckResourceAttr(name, "emailalias", fmt.Sprintf("alice@%s", newDomain)),
resource.TestCheckResourceAttr(name, "goto", fmt.Sprintf("%s@%s", rName, newDomain)),
),
},
{
Config: glesysEmailAliasSkeleton(newDomain, "goto = \"kurt@"+newDomain+"\""),
Config: glesysEmailAliasSkeleton(newDomain, fmt.Sprintf("goto = \"kurt@%s\"", newDomain)),
Check: resource.ComposeTestCheckFunc(
resource.TestCheckResourceAttr(name, "goto", "kurt@"+newDomain),
resource.TestCheckResourceAttr(name, "goto", fmt.Sprintf("kurt@%s", newDomain)),
),
},
},
Expand All @@ -46,14 +46,3 @@ func glesysEmailAliasSkeleton(domain string, s string) string {
%s
}`, domain, s)
}
func glesysEmailAliasUpdate(domain string, s string) string {
return fmt.Sprintf(
`resource "glesys_dnsdomain" "test" {
name = "%s"
}
resource "glesys_emailalias" "test" {
emailalias = "alice@${glesys_dnsdomain.test.name}"
%s
}`, domain, s)
}

0 comments on commit 42dc6a9

Please sign in to comment.