summaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
authortpowell-progress <104777878+tpowell-progress@users.noreply.github.com>2022-10-07 21:43:05 -0400
committerGitHub <noreply@github.com>2022-10-07 21:43:05 -0400
commit26b734353f5ef09ce23183e6e5ec12c0372ec7af (patch)
tree4ef7547368ceab4544e28cb0e103f171677d7dc1 /spec
parent9684743bd5aa3a60cbe0e51e4d4de0c7d3ed9d13 (diff)
downloadchef-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
Diffstat (limited to 'spec')
-rw-r--r--spec/functional/shell_spec.rb7
-rw-r--r--spec/unit/daemon_spec.rb6
2 files changed, 7 insertions, 6 deletions
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