@@ -924,6 +924,95 @@ func TestAccDomainRecord_NameDiffSuppress(t *testing.T) {
924924 })
925925}
926926
927+ func TestAccDomainRecord_TEMIntegration (t * testing.T ) {
928+ tt := acctest .NewTestTools (t )
929+ defer tt .Cleanup ()
930+
931+ testDNSZone := "test-tem-integration." + acctest .TestDomain
932+ logging .L .Debugf ("TestAccDomainRecord_TEMIntegration: test dns zone: %s" , testDNSZone )
933+
934+ resource .ParallelTest (t , resource.TestCase {
935+ PreCheck : func () { acctest .PreCheck (t ) },
936+ ProtoV6ProviderFactories : tt .ProviderFactories ,
937+ CheckDestroy : testAccCheckDomainRecordDestroy (tt ),
938+ Steps : []resource.TestStep {
939+ {
940+
941+ Config : fmt .Sprintf (`
942+ resource "scaleway_domain_record" "dmarc" {
943+ dns_zone = "%s"
944+ name = "_dmarc.%s."
945+ type = "TXT"
946+ data = "v=DMARC1; p=none"
947+ }
948+
949+ resource "scaleway_domain_record" "dkim" {
950+ dns_zone = "%s"
951+ name = "scw1._domainkey.%s."
952+ type = "TXT"
953+ data = "v=DKIM1; k=rsa; p=MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQ"
954+ }
955+ ` , testDNSZone , testDNSZone , testDNSZone , testDNSZone ),
956+ Check : resource .ComposeTestCheckFunc (
957+ testAccCheckDomainRecordExists (tt , "scaleway_domain_record.dmarc" ),
958+ testAccCheckDomainRecordExists (tt , "scaleway_domain_record.dkim" ),
959+ resource .TestCheckResourceAttr ("scaleway_domain_record.dmarc" , "name" , "_dmarc" ),
960+ resource .TestCheckResourceAttr ("scaleway_domain_record.dkim" , "name" , "scw1._domainkey" ),
961+ resource .TestCheckResourceAttr ("scaleway_domain_record.dmarc" , "type" , "TXT" ),
962+ resource .TestCheckResourceAttr ("scaleway_domain_record.dkim" , "type" , "TXT" ),
963+ ),
964+ },
965+ {
966+ Config : fmt .Sprintf (`
967+ resource "scaleway_domain_record" "dmarc" {
968+ dns_zone = "%s"
969+ name = "_dmarc.%s."
970+ type = "TXT"
971+ data = "v=DMARC1; p=none"
972+ }
973+
974+ resource "scaleway_domain_record" "dkim" {
975+ dns_zone = "%s"
976+ name = "scw1._domainkey.%s."
977+ type = "TXT"
978+ data = "v=DKIM1; k=rsa; p=MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQ"
979+ }
980+ ` , testDNSZone , testDNSZone , testDNSZone , testDNSZone ),
981+ Check : resource .ComposeTestCheckFunc (
982+ testAccCheckDomainRecordExists (tt , "scaleway_domain_record.dmarc" ),
983+ testAccCheckDomainRecordExists (tt , "scaleway_domain_record.dkim" ),
984+ resource .TestCheckResourceAttr ("scaleway_domain_record.dmarc" , "name" , "_dmarc" ),
985+ resource .TestCheckResourceAttr ("scaleway_domain_record.dkim" , "name" , "scw1._domainkey" ),
986+ ),
987+ },
988+ {
989+ Config : fmt .Sprintf (`
990+ resource "scaleway_domain_record" "dmarc" {
991+ dns_zone = "%s"
992+ name = "_dmarc"
993+ type = "TXT"
994+ data = "v=DMARC1; p=quarantine"
995+ }
996+
997+ resource "scaleway_domain_record" "dkim" {
998+ dns_zone = "%s"
999+ name = "scw1._domainkey.%s."
1000+ type = "TXT"
1001+ data = "v=DKIM1; k=rsa; p=MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQ"
1002+ }
1003+ ` , testDNSZone , testDNSZone , testDNSZone ),
1004+ Check : resource .ComposeTestCheckFunc (
1005+ testAccCheckDomainRecordExists (tt , "scaleway_domain_record.dmarc" ),
1006+ testAccCheckDomainRecordExists (tt , "scaleway_domain_record.dkim" ),
1007+ resource .TestCheckResourceAttr ("scaleway_domain_record.dmarc" , "name" , "_dmarc" ),
1008+ resource .TestCheckResourceAttr ("scaleway_domain_record.dmarc" , "data" , "v=DMARC1; p=quarantine" ),
1009+ resource .TestCheckResourceAttr ("scaleway_domain_record.dkim" , "name" , "scw1._domainkey" ),
1010+ ),
1011+ },
1012+ },
1013+ })
1014+ }
1015+
9271016func testAccCheckDomainRecordDestroy (tt * acctest.TestTools ) resource.TestCheckFunc {
9281017 return func (state * terraform.State ) error {
9291018 for _ , rs := range state .RootModule ().Resources {
0 commit comments