Merge pull request #12813 from hashicorp/jbardin/dns-acc-tests

Convert dns data tests to acceptance tests
This commit is contained in:
James Bardin 2017-03-17 14:18:23 -04:00 committed by GitHub
commit 23bc24bfcc
2 changed files with 17 additions and 14 deletions

View File

@ -4,10 +4,10 @@ import (
"fmt"
"testing"
r "github.com/hashicorp/terraform/helper/resource"
"github.com/hashicorp/terraform/helper/resource"
)
func TestAccDnsARecordSet_Basic(t *testing.T) {
func TestAccDataDnsARecordSet_Basic(t *testing.T) {
tests := []struct {
DataSourceBlock string
DataSourceName string
@ -37,17 +37,20 @@ func TestAccDnsARecordSet_Basic(t *testing.T) {
},
}
var steps []resource.TestStep
for _, test := range tests {
r.UnitTest(t, r.TestCase{
Providers: testAccProviders,
Steps: []r.TestStep{
r.TestStep{
Config: test.DataSourceBlock,
Check: r.ComposeTestCheckFunc(
testCheckAttrStringArray(fmt.Sprintf("data.dns_a_record_set.%s", test.DataSourceName), "addrs", test.Expected),
),
},
},
})
ts := resource.TestStep{
Config: test.DataSourceBlock,
Check: resource.ComposeTestCheckFunc(
testCheckAttrStringArray(fmt.Sprintf("data.dns_a_record_set.%s", test.DataSourceName), "addrs", test.Expected),
),
}
steps = append(steps, ts)
}
resource.Test(t, resource.TestCase{
Providers: testAccProviders,
Steps: steps,
})
}

View File

@ -10,7 +10,7 @@ import (
"github.com/miekg/dns"
)
func TestAccDnsARecordSet_basic(t *testing.T) {
func TestAccDnsARecordSet_Basic(t *testing.T) {
resource.Test(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t) },