diff --git a/hostingde/record_resource_test.go b/hostingde/record_resource_test.go index fc3c7c8..b32e271 100644 --- a/hostingde/record_resource_test.go +++ b/hostingde/record_resource_test.go @@ -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", "hostmaster@example2.test"), + // 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 = "hostmaster@example2.test" } -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"), ), },