diff options
author | Tim Smith <tsmith84@gmail.com> | 2020-03-27 14:36:15 -0700 |
---|---|---|
committer | Bryan McLellan <btm@loftninjas.org> | 2020-04-03 22:59:44 -0400 |
commit | 5139c4b9666fed981db3ddd3500610a93e7b1467 (patch) | |
tree | 530f215974f44fc238e697435d46e6ccd7ba8720 | |
parent | 82750cb8d85dc58b0e5f76f8e0b20b6e72f2bc9d (diff) | |
download | chef-5139c4b9666fed981db3ddd3500610a93e7b1467.tar.gz |
Skip the ifconfig functional tests if we don't have ifconfig
I'm looking at you Ubuntu 20.04
Signed-off-by: Tim Smith <tsmith@chef.io>
-rw-r--r-- | spec/functional/resource/ifconfig_spec.rb | 4 | ||||
-rw-r--r-- | spec/spec_helper.rb | 4 | ||||
-rw-r--r-- | spec/support/platform_helpers.rb | 4 |
3 files changed, 9 insertions, 3 deletions
diff --git a/spec/functional/resource/ifconfig_spec.rb b/spec/functional/resource/ifconfig_spec.rb index 0a82e59137..6bb54d6276 100644 --- a/spec/functional/resource/ifconfig_spec.rb +++ b/spec/functional/resource/ifconfig_spec.rb @@ -1,6 +1,6 @@ # # Author:: Kaustubh Deorukhkar (<kaustubh@clogeny.com>) -# Copyright:: Copyright 2013-2016, Chef Software Inc. +# Copyright:: Copyright 2013-2020, Chef Software Inc. # License:: Apache License, Version 2.0 # # Licensed under the Apache License, Version 2.0 (the "License"); @@ -23,7 +23,7 @@ require "chef/mixin/shell_out" # run this test only for following platforms. include_flag = !(%w{amazon debian aix}.include?(ohai[:platform_family]) || (ohai[:platform_family] == "rhel" && ohai[:platform_version].to_i < 7)) -describe Chef::Resource::Ifconfig, :requires_root, external: include_flag do +describe Chef::Resource::Ifconfig, :requires_root, :requires_ifconfig, external: include_flag do include Chef::Mixin::ShellOut let(:new_resource) do diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index c7672fe930..0903c96f84 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -1,6 +1,6 @@ # # Author:: Adam Jacob (<adam@chef.io>) -# Copyright:: Copyright 2008-2018, Chef Software Inc. +# Copyright:: Copyright 2008-2020, Chef Software Inc. # License:: Apache License, Version 2.0 # # Licensed under the Apache License, Version 2.0 (the "License"); @@ -202,7 +202,9 @@ RSpec.configure do |config| config.filter_run_excluding chef: DependencyProc.with(Chef::VERSION) config.filter_run_excluding ruby: DependencyProc.with(RUBY_VERSION) + # check for particular binaries we need config.filter_run_excluding choco_installed: true unless choco_installed? + config.filter_run_excluding requires_ifconfig: true unless ifconfig? running_platform_arch = `uname -m`.strip unless windows? diff --git a/spec/support/platform_helpers.rb b/spec/support/platform_helpers.rb index ce9ec77502..815b90cac7 100644 --- a/spec/support/platform_helpers.rb +++ b/spec/support/platform_helpers.rb @@ -275,6 +275,10 @@ rescue SocketError false end +def ifconfig? + which("ifconfig") +end + def choco_installed? result = ShellHelpers.powershell_out("choco --version") result.stderr.empty? ? true : false |