forked from martinhoefling/terraform-provider-hostingde
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #70 from pub-solar/fix-tests
Add missing test for email attribute
- Loading branch information
Showing
1 changed file
with
10 additions
and
16 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 |
---|---|---|
|
@@ -31,6 +31,8 @@ resource "hostingde_record" "test" { | |
// Verify type attribute. | ||
resource.TestCheckResourceAttr("hostingde_record.test", "type", "CNAME"), | ||
// Verify email attribute. | ||
resource.TestCheckResourceAttr("hostingde_zone.test", "email", "[email protected]"), | ||
// Verify content attribute. | ||
resource.TestCheckResourceAttr("hostingde_record.test", "content", "www.example.com"), | ||
// Verify dynamic values have any value set in the state. | ||
resource.TestCheckResourceAttrSet("hostingde_record.test", "id"), | ||
|
@@ -45,12 +47,12 @@ resource "hostingde_zone" "test" { | |
type = "NATIVE" | ||
email = "[email protected]" | ||
} | ||
resource "hostingde_record" "test_mx2" { | ||
resource "hostingde_record" "test_mx" { | ||
zone_id = hostingde_zone.test.id | ||
name = "example2.test" | ||
type = "MX" | ||
content = "mail2.example2.test" | ||
priority = 20 | ||
content = "mail.example2.test" | ||
priority = 10 | ||
} | ||
`, | ||
Check: resource.ComposeAggregateTestCheckFunc( | ||
|
@@ -60,20 +62,12 @@ resource "hostingde_record" "test_mx2" { | |
resource.TestCheckResourceAttr("hostingde_record.test_mx", "type", "MX"), | ||
// Verify priority attribute. | ||
resource.TestCheckResourceAttr("hostingde_record.test_mx", "priority", "10"), | ||
// Verify email attribute. | ||
// Verify content attribute. | ||
resource.TestCheckResourceAttr("hostingde_record.test_mx", "content", "mail.example2.test"), | ||
// Verify dynamic values have any value set in the state. | ||
resource.TestCheckResourceAttrSet("hostingde_record.test_mx", "id"), | ||
// Verify name attribute. | ||
resource.TestCheckResourceAttr("hostingde_record.test_mx2", "name", "example2.test"), | ||
// Verify type attribute. | ||
resource.TestCheckResourceAttr("hostingde_record.test_mx2", "type", "MX"), | ||
// Verify priority attribute. | ||
resource.TestCheckResourceAttr("hostingde_record.test_mx2", "priority", "20"), | ||
// Verify email attribute. | ||
resource.TestCheckResourceAttr("hostingde_record.test_mx2", "content", "mail2.example2.test"), | ||
resource.TestCheckResourceAttr("hostingde_zone.test", "email", "hostmaster@example2.test"), | ||
// Verify dynamic values have any value set in the state. | ||
resource.TestCheckResourceAttrSet("hostingde_record.test_mx2", "id"), | ||
resource.TestCheckResourceAttrSet("hostingde_record.test_mx", "id"), | ||
), | ||
}, | ||
// Create and read TXT testing | ||
|
@@ -97,7 +91,7 @@ resource "hostingde_record" "test_dkim" { | |
resource.TestCheckResourceAttr("hostingde_record.test_dkim", "name", "default._domainkey.example2.test"), | ||
// Verify type attribute. | ||
resource.TestCheckResourceAttr("hostingde_record.test_dkim", "type", "TXT"), | ||
// Verify email attribute. | ||
// Verify content attribute. | ||
resource.TestCheckResourceAttr("hostingde_record.test_dkim", "content", "v=DKIM1;k=rsa;p=MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAyla9hW3TvoXvZQxwzaJ4SZ9ict1HU3E6+FwLWniGe6TiPtcYrjTIsiudQb8tltibOXiS+qqbxzI+quI3aGU6osy2rIv0eWo8+oOOqOD9pERftc/aqe51cXuv4kPqwvpXEBwrXFWVM+VxivEubUJ7eKkFyXJpelv0LslXv/MmYbUyed6dF+reOGZCsvnbiRv74qdxbAL/25j62E8WrnxzJwhUtx/JhdBOjsHBvuw9hy6rZsVJL9eXayWyGRV6qmsLRzsRSBs+mDrgmKk4dugADd11+A03ics3i8hplRoWDkqnNKz1qy4f5TsV6v9283IANrAzRfHwX8EvNiFsBz+ZCQIDAQAB"), | ||
// Verify dynamic values have any value set in the state. | ||
resource.TestCheckResourceAttrSet("hostingde_record.test_dkim", "id"), | ||
|
@@ -148,7 +142,7 @@ resource "hostingde_record" "test_mx" { | |
Check: resource.ComposeAggregateTestCheckFunc( | ||
// Verify content attribute. | ||
resource.TestCheckResourceAttr("hostingde_record.test_mx", "content", "mail2.example2.test"), | ||
// Verify content attribute. | ||
// Verify priority attribute. | ||
resource.TestCheckResourceAttr("hostingde_record.test_mx", "priority", "20"), | ||
), | ||
}, | ||
|