7
7
"github.com/hashicorp/terraform/helper/acctest"
8
8
"github.com/hashicorp/terraform/helper/resource"
9
9
"github.com/hashicorp/terraform/terraform"
10
- "github.com/libvirt/libvirt-go"
11
- "github.com/libvirt/libvirt-go-xml"
10
+ libvirt "github.com/libvirt/libvirt-go"
11
+ libvirtxml "github.com/libvirt/libvirt-go-xml"
12
12
)
13
13
14
14
func TestAccLibvirtNetwork_Addresses (t * testing.T ) {
@@ -134,18 +134,16 @@ func TestAccLibvirtNetwork_DNSForwarders(t *testing.T) {
134
134
domain = "k8s.local"
135
135
addresses = ["10.17.3.0/24"]
136
136
dns {
137
- forwarders = [
138
- {
139
- address = "8.8.8.8",
140
- },
141
- {
142
- address = "10.10.0.67",
143
- domain = "my.domain.com",
144
- },
145
- {
146
- domain = "hello.com",
147
- },
148
- ]
137
+ forwarders {
138
+ address = "8.8.8.8"
139
+ }
140
+ forwarders {
141
+ address = "10.10.0.67"
142
+ domain = "my.domain.com"
143
+ }
144
+ forwarders {
145
+ domain = "hello.com"
146
+ }
149
147
}
150
148
}` , randomNetworkResource , randomNetworkName ),
151
149
Check : resource .ComposeTestCheckFunc (
@@ -187,20 +185,18 @@ func TestAccLibvirtNetwork_DNSHosts(t *testing.T) {
187
185
domain = "k8s.local"
188
186
addresses = ["10.17.3.0/24"]
189
187
dns {
190
- hosts = [
191
- {
192
- hostname = "myhost1",
193
- ip = "1.1.1.1",
194
- },
195
- {
196
- hostname = "myhost1",
197
- ip = "1.1.1.2",
198
- },
199
- {
200
- hostname = "myhost2",
201
- ip = "1.1.1.1",
202
- },
203
- ]
188
+ hosts {
189
+ hostname = "myhost1"
190
+ ip = "1.1.1.1"
191
+ }
192
+ hosts {
193
+ hostname = "myhost1"
194
+ ip = "1.1.1.2"
195
+ }
196
+ hosts {
197
+ hostname = "myhost2"
198
+ ip = "1.1.1.1"
199
+ }
204
200
}
205
201
}` , randomNetworkResource , randomNetworkName ),
206
202
Check : resource .ComposeTestCheckFunc (
@@ -234,12 +230,10 @@ func TestAccLibvirtNetwork_DNSHosts(t *testing.T) {
234
230
domain = "k8s.local"
235
231
addresses = ["10.17.3.0/24"]
236
232
dns {
237
- hosts = [
238
- {
239
- hostname = "myhost1",
240
- ip = "1.1.1.1",
241
- },
242
- ]
233
+ hosts {
234
+ hostname = "myhost1"
235
+ ip = "1.1.1.1"
236
+ }
243
237
}
244
238
}` , randomNetworkResource , randomNetworkName ),
245
239
Check : resource .ComposeTestCheckFunc (
@@ -262,23 +256,21 @@ func TestAccLibvirtNetwork_DNSHosts(t *testing.T) {
262
256
domain = "k8s.local"
263
257
addresses = ["10.17.3.0/24"]
264
258
dns {
265
- hosts = [
266
- {
267
- hostname = "myhost1",
268
- ip = "1.1.1.1",
269
- },
259
+ hosts {
260
+ hostname = "myhost1"
261
+ ip = "1.1.1.1"
262
+ }
270
263
# Without https:#www.redhat.com/archives/libvir-list/2018-November/msg00231.html, this raises:
271
264
#
272
265
# update DNS hosts: add {{ } 1.1.1.2 [{myhost1}]}: virError(Code=55, Domain=19, Message='Requested operation is not valid: there is already at least one DNS HOST record with a matching field in network fo64d9y6w9')
273
266
# {
274
- # hostname = "myhost1",
275
- # ip = "1.1.1.2",
267
+ # hostname = "myhost1"
268
+ # ip = "1.1.1.2"
276
269
# },
277
- {
278
- hostname = "myhost2",
279
- ip = "1.1.1.1",
280
- },
281
- ]
270
+ hosts {
271
+ hostname = "myhost2"
272
+ ip = "1.1.1.1"
273
+ }
282
274
}
283
275
}` , randomNetworkResource , randomNetworkName ),
284
276
Check : resource .ComposeTestCheckFunc (
0 commit comments