Skip to content

Commit

Permalink
Merge pull request #70 from pub-solar/fix-tests
Browse files Browse the repository at this point in the history
Add missing test for email attribute
  • Loading branch information
teutat3s authored Aug 13, 2024
2 parents 4d672e8 + ab3fddd commit 1766410
Showing 1 changed file with 10 additions and 16 deletions.
26 changes: 10 additions & 16 deletions hostingde/record_resource_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"),
Expand All @@ -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(
Expand All @@ -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
Expand All @@ -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"),
Expand Down Expand Up @@ -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"),
),
},
Expand Down

0 comments on commit 1766410

Please sign in to comment.