Update GCE Instance Template tests now that existing disk must exist prior to template creation.

This commit is contained in:
David Watson 2015-03-18 17:42:03 +00:00
parent 18a83347b5
commit c675c20a48
1 changed files with 10 additions and 2 deletions

View File

@ -65,7 +65,7 @@ func TestAccComputeInstanceTemplate_disks(t *testing.T) {
testAccCheckComputeInstanceTemplateExists( testAccCheckComputeInstanceTemplateExists(
"google_compute_instance_template.foobar", &instanceTemplate), "google_compute_instance_template.foobar", &instanceTemplate),
testAccCheckComputeInstanceTemplateDisk(&instanceTemplate, "debian-7-wheezy-v20140814", true, true), testAccCheckComputeInstanceTemplateDisk(&instanceTemplate, "debian-7-wheezy-v20140814", true, true),
testAccCheckComputeInstanceTemplateDisk(&instanceTemplate, "foo_existing_disk", false, false), testAccCheckComputeInstanceTemplateDisk(&instanceTemplate, "terraform-test-foobar", false, false),
), ),
}, },
}, },
@ -252,6 +252,14 @@ resource "google_compute_instance_template" "foobar" {
}` }`
const testAccComputeInstanceTemplate_disks = ` const testAccComputeInstanceTemplate_disks = `
resource "google_compute_disk" "foobar" {
name = "terraform-test-foobar"
image = "debian-7-wheezy-v20140814"
size = 10
type = "pd-ssd"
zone = "us-central1-a"
}
resource "google_compute_instance_template" "foobar" { resource "google_compute_instance_template" "foobar" {
name = "terraform-test" name = "terraform-test"
machine_type = "n1-standard-1" machine_type = "n1-standard-1"
@ -263,7 +271,7 @@ resource "google_compute_instance_template" "foobar" {
} }
disk { disk {
source = "foo_existing_disk" source = "terraform-test-foobar"
auto_delete = false auto_delete = false
boot = false boot = false
} }