From 0eea4f192632ae53f8766c42b4db412bda01c447 Mon Sep 17 00:00:00 2001 From: Stuart Paterson Date: Thu, 17 May 2018 14:08:22 +0100 Subject: [PATCH] Updating Gemfile to use latest inspec release. Fix for only_if test execution when using environment variables. Signed-off-by: Stuart Paterson --- Gemfile | 4 +--- test/integration/verify/controls/generic_iam_role.rb | 2 +- .../verify/controls/generic_iam_service_account.rb | 2 +- 3 files changed, 3 insertions(+), 5 deletions(-) diff --git a/Gemfile b/Gemfile index 9a4335460..b55115e1d 100644 --- a/Gemfile +++ b/Gemfile @@ -15,7 +15,5 @@ group :development do end group :inspec do - # Below are required until the next inspec release containing the train changes - gem 'train', :git => 'https://github.com/chef/train.git' - gem 'inspec', :git => 'https://github.com/chef/inspec.git' + gem 'inspec', '~> 2.1', '>= 2.1.78' end diff --git a/test/integration/verify/controls/generic_iam_role.rb b/test/integration/verify/controls/generic_iam_role.rb index ced9ab16d..f0d3ef2f2 100644 --- a/test/integration/verify/controls/generic_iam_role.rb +++ b/test/integration/verify/controls/generic_iam_role.rb @@ -5,7 +5,7 @@ gcp_enable_privileged_resources = attribute(:gcp_enable_privileged_resources,default:0,description:'Flag to enable privileged resources requiring elevated privileges in GCP.') control 'gcp-generic-iam-role' do - only_if { gcp_enable_privileged_resources == 1 } + only_if { gcp_enable_privileged_resources.to_i == 1 } impact 1.0 title 'Ensure that the IAM role is correctly set up' diff --git a/test/integration/verify/controls/generic_iam_service_account.rb b/test/integration/verify/controls/generic_iam_service_account.rb index 81c0a2028..c8f90f789 100644 --- a/test/integration/verify/controls/generic_iam_service_account.rb +++ b/test/integration/verify/controls/generic_iam_service_account.rb @@ -6,7 +6,7 @@ control 'gcp-generic-iam-service-account' do - only_if { gcp_enable_privileged_resources == 1 } + only_if { gcp_enable_privileged_resources.to_i == 1 } impact 1.0 title 'Ensure that the Service Account is correctly set up'