summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Keiser <john@johnkeiser.com>2015-12-15 08:49:04 -0800
committerJohn Keiser <john@johnkeiser.com>2015-12-15 09:20:41 -0800
commit44494c91587ff0313d328d9c4ec016e6fcf5f830 (patch)
treeaea3fd67294d24999b44955c75846fce186a958d
parent33aba5c6cc2d028223732bb3802504a95be9b0d8 (diff)
downloadchef-44494c91587ff0313d328d9c4ec016e6fcf5f830.tar.gz
Don't run IPv6 tests on GCEjk/no-ipv6-on-gce
-rw-r--r--spec/integration/client/ipv6_spec.rb2
-rw-r--r--spec/integration/knife/cookbook_api_ipv6_spec.rb2
-rw-r--r--spec/spec_helper.rb1
-rw-r--r--spec/support/platform_helpers.rb12
4 files changed, 14 insertions, 3 deletions
diff --git a/spec/integration/client/ipv6_spec.rb b/spec/integration/client/ipv6_spec.rb
index 8be873edf4..493ad79e7c 100644
--- a/spec/integration/client/ipv6_spec.rb
+++ b/spec/integration/client/ipv6_spec.rb
@@ -84,7 +84,7 @@ END_CLIENT_RB
# Some Solaris test platforms are too old for IPv6. These tests should not
# otherwise be platform dependent, so exclude solaris
- when_the_chef_server "is running on IPv6", :not_supported_on_solaris do
+ when_the_chef_server "is running on IPv6", :not_supported_on_solaris, :not_supported_on_gce do
when_the_repository "has a cookbook with a no-op recipe" do
before do
diff --git a/spec/integration/knife/cookbook_api_ipv6_spec.rb b/spec/integration/knife/cookbook_api_ipv6_spec.rb
index 3d468be7f6..4b44c87fc1 100644
--- a/spec/integration/knife/cookbook_api_ipv6_spec.rb
+++ b/spec/integration/knife/cookbook_api_ipv6_spec.rb
@@ -18,7 +18,7 @@
require 'support/shared/integration/integration_helper'
require 'chef/mixin/shell_out'
-describe "Knife cookbook API integration with IPv6", :workstation do
+describe "Knife cookbook API integration with IPv6", :workstation, :not_supported_on_gce do
include IntegrationSupport
include Chef::Mixin::ShellOut
diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb
index 7691d88ff3..de6bcb1ce7 100644
--- a/spec/spec_helper.rb
+++ b/spec/spec_helper.rb
@@ -131,6 +131,7 @@ RSpec.configure do |config|
config.filter_run_excluding :mac_osx_only=> true if !mac_osx?
config.filter_run_excluding :not_supported_on_win2k3 => true if windows_win2k3?
config.filter_run_excluding :not_supported_on_solaris => true if solaris?
+ config.filter_run_excluding :not_supported_on_gce => true if gce?
config.filter_run_excluding :not_supported_on_nano => true if windows_nano_server?
config.filter_run_excluding :win2k3_only => true unless windows_win2k3?
config.filter_run_excluding :windows_2008r2_or_later => true unless windows_2008r2_or_later?
diff --git a/spec/support/platform_helpers.rb b/spec/support/platform_helpers.rb
index 2fc4a02cf1..3698091e1b 100644
--- a/spec/support/platform_helpers.rb
+++ b/spec/support/platform_helpers.rb
@@ -1,6 +1,6 @@
require 'fcntl'
require 'chef/mixin/shell_out'
-
+require 'ohai/mixin/gce_metadata'
class ShellHelpers
extend Chef::Mixin::ShellOut
@@ -199,3 +199,13 @@ end
def aes_256_gcm?
OpenSSL::Cipher.ciphers.include?("aes-256-gcm")
end
+
+class GCEDetector
+ extend Ohai::Mixin::GCEMetadata
+end
+
+def gce?
+ GCEDetector.can_metadata_connect?(Ohai::Mixin::GCEMetadata::GCE_METADATA_ADDR,80)
+rescue SocketError
+ false
+end