From 26b734353f5ef09ce23183e6e5ec12c0372ec7af Mon Sep 17 00:00:00 2001 From: tpowell-progress <104777878+tpowell-progress@users.noreply.github.com> Date: Fri, 7 Oct 2022 21:43:05 -0400 Subject: Fix term and privilege related broken tests in Solaris build (#13230) INFC-274 Fix Solaris tests * Do not match on OS specific message, only on generic description. * Update omnibus version to fix read_shared_libs * Force `ENV["TERM"]` to `"vt100"` for tests --- spec/functional/shell_spec.rb | 7 ++++++- spec/unit/daemon_spec.rb | 6 +----- 2 files changed, 7 insertions(+), 6 deletions(-) (limited to 'spec') diff --git a/spec/functional/shell_spec.rb b/spec/functional/shell_spec.rb index 203b6346b2..9430970552 100644 --- a/spec/functional/shell_spec.rb +++ b/spec/functional/shell_spec.rb @@ -78,8 +78,13 @@ describe Shell do def run_chef_shell_with(options) # Windows ruby installs don't (always?) have PTY, # so hide the require here - require "pty" + + # FIXME this is temporary... Solaris envs have TERM set to unknown + # and the value isn't propagating from the build environment TERM + # variable + ENV["TERM"] = "vt100" if ["", "unknown"].include?(ENV["TERM"].to_s) + config = File.expand_path("shef-config.rb", CHEF_SPEC_DATA) reader, writer, pid = PTY.spawn("bundle exec #{ChefUtils::Dist::Infra::SHELL} --no-multiline --no-singleline --no-colorize -c #{config} #{options}") read_until(reader, "chef (#{Chef::VERSION})>") diff --git a/spec/unit/daemon_spec.rb b/spec/unit/daemon_spec.rb index f91210277b..05a09a5857 100644 --- a/spec/unit/daemon_spec.rb +++ b/spec/unit/daemon_spec.rb @@ -170,11 +170,7 @@ describe Chef::Daemon do it "should log an appropriate error message and fail miserably" do allow(Process).to receive(:initgroups).and_raise(Errno::EPERM) - error = "Operation not permitted" - if RUBY_PLATFORM.match("solaris2") || RUBY_PLATFORM.match("aix") - error = "Not owner" - end - expect(Chef::Application).to receive(:fatal!).with("Permission denied when trying to change 999:999 to 501:20. #{error}") + expect(Chef::Application).to receive(:fatal!).with(/Permission denied when trying to change 999:999 to 501:20/) Chef::Daemon._change_privilege(testuser) end end -- cgit v1.2.1