From 8bf26da385ce1ce358de61bdf0078e9c6db9346c Mon Sep 17 00:00:00 2001 From: Sam Levenick Date: Thu, 13 Dec 2018 17:28:39 +0000 Subject: [PATCH] Move inspec controls from verify-mm dir to verify --- .../controls/google_compute_ssl_policies.rb | 35 +++++++++++++++++++ .../controls/google_compute_ssl_policy.rb | 30 ++++++++++++++++ 2 files changed, 65 insertions(+) create mode 100644 test/integration/verify/controls/google_compute_ssl_policies.rb create mode 100644 test/integration/verify/controls/google_compute_ssl_policy.rb diff --git a/test/integration/verify/controls/google_compute_ssl_policies.rb b/test/integration/verify/controls/google_compute_ssl_policies.rb new file mode 100644 index 000000000..f1c5683b3 --- /dev/null +++ b/test/integration/verify/controls/google_compute_ssl_policies.rb @@ -0,0 +1,35 @@ +# ---------------------------------------------------------------------------- +# +# *** AUTO GENERATED CODE *** AUTO GENERATED CODE *** +# +# ---------------------------------------------------------------------------- +# +# This file is automatically generated by Magic Modules and manual +# changes will be clobbered when the file is regenerated. +# +# Please read more about how to change this file in README.md and +# CONTRIBUTING.md located at the root of this package. +# +# ---------------------------------------------------------------------------- + +title 'Test GCP google_compute_ssl_policies resource.' + +project_name = attribute(:gcp_project_name, default: '') +ssl_policy = attribute('ssl_policy', default: {"name"=>"inspec-gcp-ssl-policy", "min_tls_version"=>"TLS_1_2", "profile"=>"CUSTOM", "custom_feature"=>"TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384", "custom_feature2"=>"TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384"}) +control 'google_compute_ssl_policies-1.0' do + impact 1.0 + title 'google_compute_ssl_policies resource test' + + describe google_compute_ssl_policies({project: project_name}) do + it { should exist } + its('names') { should include ssl_policy['name'] } + its('profiles') { should include ssl_policy['profile'] } + its('count') { should eq 1 } + end + + google_compute_ssl_policies({project: project_name}).names.each do |policy_name| + describe google_compute_ssl_policy({project: project_name, name: policy_name}) do + its('min_tls_version') { should cmp ssl_policy['min_tls_version'] } + end + end +end diff --git a/test/integration/verify/controls/google_compute_ssl_policy.rb b/test/integration/verify/controls/google_compute_ssl_policy.rb new file mode 100644 index 000000000..d261bfae7 --- /dev/null +++ b/test/integration/verify/controls/google_compute_ssl_policy.rb @@ -0,0 +1,30 @@ +# ---------------------------------------------------------------------------- +# +# *** AUTO GENERATED CODE *** AUTO GENERATED CODE *** +# +# ---------------------------------------------------------------------------- +# +# This file is automatically generated by Magic Modules and manual +# changes will be clobbered when the file is regenerated. +# +# Please read more about how to change this file in README.md and +# CONTRIBUTING.md located at the root of this package. +# +# ---------------------------------------------------------------------------- + +title 'Test GCP google_compute_ssl_policy resource.' + +project_name = attribute(:gcp_project_name, default: '') +ssl_policy = attribute('ssl_policy', default: {"name"=>"inspec-gcp-ssl-policy", "min_tls_version"=>"TLS_1_2", "profile"=>"CUSTOM", "custom_feature"=>"TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384", "custom_feature2"=>"TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384"}) +control 'google_compute_ssl_policy-1.0' do + impact 1.0 + title 'google_compute_ssl_policy resource test' + + describe google_compute_ssl_policy({project: project_name, name: ssl_policy['name']}) do + it { should exist } + its('min_tls_version') { should cmp ssl_policy['min_tls_version'] } + its('profile') { should cmp ssl_policy['profile'] } + its('custom_features') { should include ssl_policy['custom_feature'] } + its('custom_features') { should include ssl_policy['custom_feature2'] } + end +end