@@ -41,12 +41,12 @@ func testAccZoneDelegatedCompare(t *testing.T, resPath string, expectedRec *ibcl
41
41
connector := meta .(ibclient.IBConnector )
42
42
objMgr := ibclient .NewObjectManager (connector , "terraform_test" , "test" )
43
43
44
- lookupHosts , err := net .LookupHost (expectedRec .Nameserver )
44
+ lookupHosts , err := net .LookupHost (* expectedRec .Nameserver )
45
45
if err != nil {
46
46
return fmt .Errorf ("Failed to resolve delegate_to: %s" , err .Error ())
47
47
}
48
48
sort .Strings (lookupHosts )
49
- expectedRec .Addresses = append (expectedRec .Addresses , ibclient.ZoneNameServer {Address : lookupHosts [0 ]})
49
+ expectedRec .Addresses = append (expectedRec .Addresses , & ibclient.ZoneNameServer {Address : lookupHosts [0 ]})
50
50
51
51
rec , _ := objMgr .GetZoneDelegated (res .Primary .ID )
52
52
if rec == nil {
@@ -63,15 +63,19 @@ func testAccZoneDelegatedCompare(t *testing.T, resPath string, expectedRec *ibcl
63
63
"'delegate_to['address']' does not match: got '%s', expected '%s'" ,
64
64
rec .DelegateTo [0 ].Address , expectedRec .Addresses [0 ].Address )
65
65
}
66
- if rec .DelegateTo [0 ].Name != expectedRec .Nameserver {
66
+ if rec .DelegateTo [0 ].Name != * expectedRec .Nameserver {
67
67
return fmt .Errorf (
68
68
"'delegate_to['name']' does not match: got '%s', expected '%s'" ,
69
- rec .DelegateTo [0 ].Name , expectedRec .Nameserver )
69
+ rec .DelegateTo [0 ].Name , * expectedRec .Nameserver )
70
70
}
71
71
return nil
72
72
}
73
73
}
74
74
75
+ func strPtr (s string ) * string {
76
+ return & s
77
+ }
78
+
75
79
func TestAccResourceZoneDelegated (t * testing.T ) {
76
80
resource .Test (t , resource.TestCase {
77
81
PreCheck : func () { testAccPreCheck (t ) },
@@ -89,7 +93,7 @@ func TestAccResourceZoneDelegated(t *testing.T) {
89
93
Check : resource .ComposeTestCheckFunc (
90
94
testAccZoneDelegatedCompare (t , "infoblox_zone_delegated.foo" , & ibclient.RecordNS {
91
95
Name : "subdomain.test.com" ,
92
- Nameserver : "ns2.infoblox.com" ,
96
+ Nameserver : strPtr ( "ns2.infoblox.com" ) ,
93
97
}),
94
98
),
95
99
},
0 commit comments