Skip to content

Commit

Permalink
Merge pull request #171 from inspec/fix-for-regional-disk
Browse files Browse the repository at this point in the history
Fix for regional compute disk creation and testing.
  • Loading branch information
russellseymour authored Aug 23, 2019
2 parents 1cd9f76 + b976194 commit eed5e2b
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
10 changes: 9 additions & 1 deletion test/integration/build/gcp.tf
Original file line number Diff line number Diff line change
Expand Up @@ -869,4 +869,12 @@ resource "google_compute_firewall" "inspec-gcp-tag-test-fw" {
source_ranges = ["0.0.0.0/0"]
target_tags = ["allow-gcp-inspec-app-mig2","allow-gcp-inspec-app-mig3"]
source_tags = ["allow-gcp-inspec-app-mig1"]
}
}

resource "google_compute_region_disk" "regiondisk" {
project = "${var.gcp_project_id}"
name = "${var.gcp_compute_disk_name}-regional"
type = "${var.gcp_compute_disk_type}"
region = "${var.gcp_location}"
replica_zones = ["${var.gcp_kube_cluster_zone}", "${var.gcp_kube_cluster_zone_extra1}"]
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,11 @@
impact 1.0
title 'google_compute_regional_disk resource test'

describe google_compute_regional_disk(project: gcp_project_id, name: gcp_compute_disk_name, region: gcp_region) do
describe google_compute_regional_disk(project: gcp_project_id, name: "#{gcp_compute_disk_name}-regional", region: gcp_region) do
it { should exist }
its('type') { should match gcp_compute_disk_type }
end

describe.one do
google_compute_regional_disk(project: gcp_project_id, name: gcp_compute_disk_name, region: gcp_region).labels.each_pair do |key, value|
describe key do
it { should cmp "environment" }
end
end
end

describe google_compute_regional_disk(project: gcp_project_id, name: 'nonexistent', region: gcp_region) do
it { should_not exist }
end
Expand Down

0 comments on commit eed5e2b

Please sign in to comment.