diff options
author | Thom May <thom@may.lt> | 2018-04-23 18:03:04 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-04-23 18:03:04 +0100 |
commit | b7aba7c71871564d8bd72929f3ddc008393e1ce3 (patch) | |
tree | fb87328af5ea1ae500d8943e348531aad68f2211 | |
parent | 7247cc3cb62359fcdff6152c8c605cd37e854e75 (diff) | |
parent | 331e7724745f093b6e62b1f0cc16a571e00174ad (diff) | |
download | chef-b7aba7c71871564d8bd72929f3ddc008393e1ce3.tar.gz |
Merge pull request #7174 from chef/tm/ubu_1804
Ubuntu 1804 - passing tests and fixed ifconfig provider
-rw-r--r-- | lib/chef/provider/ifconfig/debian.rb | 2 | ||||
-rw-r--r-- | spec/functional/resource/apt_package_spec.rb | 2 | ||||
-rw-r--r-- | spec/functional/resource/ifconfig_spec.rb | 3 |
3 files changed, 5 insertions, 2 deletions
diff --git a/lib/chef/provider/ifconfig/debian.rb b/lib/chef/provider/ifconfig/debian.rb index e1e978fdde..aee3ca02dc 100644 --- a/lib/chef/provider/ifconfig/debian.rb +++ b/lib/chef/provider/ifconfig/debian.rb @@ -62,6 +62,8 @@ iface <%= new_resource.device %> <%= new_resource.family %> static protected def enforce_interfaces_dot_d_sanity + # on ubuntu 18.04 there's no interfaces file and it uses interfaces.d by default + return if ::File.directory?(INTERFACES_DOT_D_DIR) && !::File.exist?(INTERFACES_FILE) # create /etc/network/interfaces.d via dir resource (to get reporting, etc) dir = Chef::Resource::Directory.new(INTERFACES_DOT_D_DIR, run_context) dir.run_action(:create) diff --git a/spec/functional/resource/apt_package_spec.rb b/spec/functional/resource/apt_package_spec.rb index 7c58937ee2..c032bafc92 100644 --- a/spec/functional/resource/apt_package_spec.rb +++ b/spec/functional/resource/apt_package_spec.rb @@ -23,7 +23,7 @@ require "webrick" module AptServer def enable_testing_apt_source File.open("/etc/apt/sources.list.d/chef-integration-test.list", "w+") do |f| - f.puts "deb http://localhost:9000/ sid main" + f.puts "deb [trusted=yes] http://localhost:9000/ sid main" end # Magic to update apt cache for only our repo shell_out!("apt-get update " + diff --git a/spec/functional/resource/ifconfig_spec.rb b/spec/functional/resource/ifconfig_spec.rb index fbb8995d52..f32ed069b5 100644 --- a/spec/functional/resource/ifconfig_spec.rb +++ b/spec/functional/resource/ifconfig_spec.rb @@ -16,6 +16,7 @@ # limitations under the License. # +require "spec_helper" require "functional/resource/base" require "chef/mixin/shell_out" @@ -52,7 +53,7 @@ describe Chef::Resource::Ifconfig, :requires_root, :skip_travis, :external => in end def fetch_first_interface_name - shell_out("ifconfig | grep Ethernet | head -1 | cut -d' ' -f1").stdout.strip + shell_out("ip link list |grep UP|grep -vi loop|head -1|cut -d':' -f 2").stdout.strip end # **Caution: any updates to core interfaces can be risky. |