diff options
author | tpowell-progress <104777878+tpowell-progress@users.noreply.github.com> | 2022-10-07 21:43:05 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-10-07 21:43:05 -0400 |
commit | 26b734353f5ef09ce23183e6e5ec12c0372ec7af (patch) | |
tree | 4ef7547368ceab4544e28cb0e103f171677d7dc1 | |
parent | 9684743bd5aa3a60cbe0e51e4d4de0c7d3ed9d13 (diff) | |
download | chef-26b734353f5ef09ce23183e6e5ec12c0372ec7af.tar.gz |
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
-rw-r--r-- | omnibus/Gemfile.lock | 4 | ||||
-rw-r--r-- | spec/functional/shell_spec.rb | 7 | ||||
-rw-r--r-- | spec/unit/daemon_spec.rb | 6 |
3 files changed, 9 insertions, 8 deletions
diff --git a/omnibus/Gemfile.lock b/omnibus/Gemfile.lock index b203af8050..698421a942 100644 --- a/omnibus/Gemfile.lock +++ b/omnibus/Gemfile.lock @@ -8,10 +8,10 @@ GIT GIT remote: https://github.com/chef/omnibus.git - revision: 4b6901cf891474291368468b73301057ce9fadde + revision: 5bc091ab3ed4ab002ef85dad3923914c25bb3dcd branch: main specs: - omnibus (9.0.7) + omnibus (9.0.8) aws-sdk-s3 (~> 1) chef-cleanroom (~> 1.0) chef-utils (>= 15.4) 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 |