Fixing the acc tests
I do wonder when these tests where last run successfully… Must be quite
some time ago considering what I needed to fix in here 😉
This commit is contained in:
parent
bed36cc86a
commit
36ed95c86d
|
@ -52,9 +52,6 @@ func TestAccComputeInstance_IP(t *testing.T) {
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
//!NB requires that disk with name terraform-test-disk is present in gce,
|
|
||||||
//if created as dependency then it tries to remove it while it is still attached
|
|
||||||
//to instance and that fails with an error
|
|
||||||
func TestAccComputeInstance_disks(t *testing.T) {
|
func TestAccComputeInstance_disks(t *testing.T) {
|
||||||
var instance compute.Instance
|
var instance compute.Instance
|
||||||
|
|
||||||
|
@ -66,6 +63,8 @@ func TestAccComputeInstance_disks(t *testing.T) {
|
||||||
resource.TestStep{
|
resource.TestStep{
|
||||||
Config: testAccComputeInstance_disks,
|
Config: testAccComputeInstance_disks,
|
||||||
Check: resource.ComposeTestCheckFunc(
|
Check: resource.ComposeTestCheckFunc(
|
||||||
|
testAccCheckComputeInstanceExists(
|
||||||
|
"google_compute_instance.foobar", &instance),
|
||||||
testAccCheckComputeInstanceDisk(&instance, "terraform-test", true, true),
|
testAccCheckComputeInstanceDisk(&instance, "terraform-test", true, true),
|
||||||
testAccCheckComputeInstanceDisk(&instance, "terraform-test-disk", false, false),
|
testAccCheckComputeInstanceDisk(&instance, "terraform-test-disk", false, false),
|
||||||
),
|
),
|
||||||
|
@ -287,6 +286,13 @@ resource "google_compute_instance" "foobar" {
|
||||||
}`
|
}`
|
||||||
|
|
||||||
const testAccComputeInstance_disks = `
|
const testAccComputeInstance_disks = `
|
||||||
|
resource "google_compute_disk" "foobar" {
|
||||||
|
name = "terraform-test-disk"
|
||||||
|
size = 10
|
||||||
|
type = "pd-ssd"
|
||||||
|
zone = "us-central1-a"
|
||||||
|
}
|
||||||
|
|
||||||
resource "google_compute_instance" "foobar" {
|
resource "google_compute_instance" "foobar" {
|
||||||
name = "terraform-test"
|
name = "terraform-test"
|
||||||
machine_type = "n1-standard-1"
|
machine_type = "n1-standard-1"
|
||||||
|
@ -297,9 +303,8 @@ resource "google_compute_instance" "foobar" {
|
||||||
}
|
}
|
||||||
|
|
||||||
disk {
|
disk {
|
||||||
disk = "terraform-test-disk"
|
disk = "${google_compute_disk.foobar.name}"
|
||||||
auto_delete = false
|
auto_delete = false
|
||||||
type = "pd-ssd"
|
|
||||||
}
|
}
|
||||||
|
|
||||||
network {
|
network {
|
||||||
|
|
Loading…
Reference in New Issue