Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix for regional compute disk creation and testing. #171

Merged
merged 2 commits into from
Aug 23, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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