Skip to content

Commit 618b338

Browse files
committed
update test
1 parent d829ada commit 618b338

File tree

1 file changed

+100
-5
lines changed

1 file changed

+100
-5
lines changed

cloudstack/resource_cloudstack_snapshot_policy_test.go

Lines changed: 100 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -200,6 +200,24 @@ data "cloudstack_zone" "zone" {
200200
}
201201
}
202202
203+
resource "cloudstack_network" "foo" {
204+
name = "terraform-network"
205+
display_text = "terraform-network"
206+
cidr = "10.1.1.0/24"
207+
network_offering = "DefaultIsolatedNetworkOfferingWithSourceNatService"
208+
zone = data.cloudstack_zone.zone.name
209+
}
210+
211+
resource "cloudstack_instance" "foobar" {
212+
name = "terraform-test"
213+
display_name = "terraform"
214+
service_offering = "Small Instance"
215+
network_id = cloudstack_network.foo.id
216+
template = "CentOS 5.6 (64-bit) no GUI (Simulator)"
217+
zone = data.cloudstack_zone.zone.name
218+
expunge = true
219+
}
220+
203221
resource "cloudstack_disk_offering" "foo" {
204222
name = "terraform-disk-offering"
205223
display_text = "terraform-disk-offering"
@@ -208,8 +226,9 @@ resource "cloudstack_disk_offering" "foo" {
208226
209227
resource "cloudstack_disk" "foo" {
210228
name = "terraform-disk"
211-
attach = false
229+
attach = true
212230
disk_offering = cloudstack_disk_offering.foo.name
231+
virtual_machine_id = cloudstack_instance.foobar.id
213232
zone = data.cloudstack_zone.zone.name
214233
}
215234
@@ -236,6 +255,24 @@ data "cloudstack_zone" "zone" {
236255
}
237256
}
238257
258+
resource "cloudstack_network" "foo" {
259+
name = "terraform-network"
260+
display_text = "terraform-network"
261+
cidr = "10.1.1.0/24"
262+
network_offering = "DefaultIsolatedNetworkOfferingWithSourceNatService"
263+
zone = data.cloudstack_zone.zone.name
264+
}
265+
266+
resource "cloudstack_instance" "foobar" {
267+
name = "terraform-test"
268+
display_name = "terraform"
269+
service_offering = "Small Instance"
270+
network_id = cloudstack_network.foo.id
271+
template = "CentOS 5.6 (64-bit) no GUI (Simulator)"
272+
zone = data.cloudstack_zone.zone.name
273+
expunge = true
274+
}
275+
239276
resource "cloudstack_disk_offering" "foo" {
240277
name = "terraform-disk-offering"
241278
display_text = "terraform-disk-offering"
@@ -244,8 +281,9 @@ resource "cloudstack_disk_offering" "foo" {
244281
245282
resource "cloudstack_disk" "foo" {
246283
name = "terraform-disk"
247-
attach = false
284+
attach = true
248285
disk_offering = cloudstack_disk_offering.foo.name
286+
virtual_machine_id = cloudstack_instance.foobar.id
249287
zone = data.cloudstack_zone.zone.name
250288
}
251289
@@ -273,6 +311,24 @@ data "cloudstack_zone" "zone" {
273311
}
274312
}
275313
314+
resource "cloudstack_network" "foo" {
315+
name = "terraform-network-hourly"
316+
display_text = "terraform-network-hourly"
317+
cidr = "10.1.1.0/24"
318+
network_offering = "DefaultIsolatedNetworkOfferingWithSourceNatService"
319+
zone = data.cloudstack_zone.zone.name
320+
}
321+
322+
resource "cloudstack_instance" "foobar" {
323+
name = "terraform-test-hourly"
324+
display_name = "terraform-hourly"
325+
service_offering = "Small Instance"
326+
network_id = cloudstack_network.foo.id
327+
template = "CentOS 5.6 (64-bit) no GUI (Simulator)"
328+
zone = data.cloudstack_zone.zone.name
329+
expunge = true
330+
}
331+
276332
resource "cloudstack_disk_offering" "foo" {
277333
name = "terraform-disk-offering-hourly"
278334
display_text = "terraform-disk-offering-hourly"
@@ -281,8 +337,9 @@ resource "cloudstack_disk_offering" "foo" {
281337
282338
resource "cloudstack_disk" "foo" {
283339
name = "terraform-disk-hourly"
284-
attach = false
340+
attach = true
285341
disk_offering = cloudstack_disk_offering.foo.name
342+
virtual_machine_id = cloudstack_instance.foobar.id
286343
zone = data.cloudstack_zone.zone.name
287344
}
288345
@@ -305,6 +362,24 @@ data "cloudstack_zone" "zone" {
305362
}
306363
}
307364
365+
resource "cloudstack_network" "foo" {
366+
name = "terraform-network-weekly"
367+
display_text = "terraform-network-weekly"
368+
cidr = "10.1.1.0/24"
369+
network_offering = "DefaultIsolatedNetworkOfferingWithSourceNatService"
370+
zone = data.cloudstack_zone.zone.name
371+
}
372+
373+
resource "cloudstack_instance" "foobar" {
374+
name = "terraform-test-weekly"
375+
display_name = "terraform-weekly"
376+
service_offering = "Small Instance"
377+
network_id = cloudstack_network.foo.id
378+
template = "CentOS 5.6 (64-bit) no GUI (Simulator)"
379+
zone = data.cloudstack_zone.zone.name
380+
expunge = true
381+
}
382+
308383
resource "cloudstack_disk_offering" "foo" {
309384
name = "terraform-disk-offering-weekly"
310385
display_text = "terraform-disk-offering-weekly"
@@ -313,8 +388,9 @@ resource "cloudstack_disk_offering" "foo" {
313388
314389
resource "cloudstack_disk" "foo" {
315390
name = "terraform-disk-weekly"
316-
attach = false
391+
attach = true
317392
disk_offering = cloudstack_disk_offering.foo.name
393+
virtual_machine_id = cloudstack_instance.foobar.id
318394
zone = data.cloudstack_zone.zone.name
319395
}
320396
@@ -336,6 +412,24 @@ data "cloudstack_zone" "zone" {
336412
}
337413
}
338414
415+
resource "cloudstack_network" "foo" {
416+
name = "terraform-network-monthly"
417+
display_text = "terraform-network-monthly"
418+
cidr = "10.1.1.0/24"
419+
network_offering = "DefaultIsolatedNetworkOfferingWithSourceNatService"
420+
zone = data.cloudstack_zone.zone.name
421+
}
422+
423+
resource "cloudstack_instance" "foobar" {
424+
name = "terraform-test-monthly"
425+
display_name = "terraform-monthly"
426+
service_offering = "Small Instance"
427+
network_id = cloudstack_network.foo.id
428+
template = "CentOS 5.6 (64-bit) no GUI (Simulator)"
429+
zone = data.cloudstack_zone.zone.name
430+
expunge = true
431+
}
432+
339433
resource "cloudstack_disk_offering" "foo" {
340434
name = "terraform-disk-offering-monthly"
341435
display_text = "terraform-disk-offering-monthly"
@@ -344,8 +438,9 @@ resource "cloudstack_disk_offering" "foo" {
344438
345439
resource "cloudstack_disk" "foo" {
346440
name = "terraform-disk-monthly"
347-
attach = false
441+
attach = true
348442
disk_offering = cloudstack_disk_offering.foo.name
443+
virtual_machine_id = cloudstack_instance.foobar.id
349444
zone = data.cloudstack_zone.zone.name
350445
}
351446

0 commit comments

Comments
 (0)