spec/unit/daemon_spec.rb in chef-11.4.4 vs spec/unit/daemon_spec.rb in chef-11.6.0.hotfix.1
- old
+ new
@@ -152,34 +152,34 @@
it "should remove the file" do
FileUtils.should_receive(:rm).with("/var/run/chef/chef-client.pid")
Chef::Daemon.remove_pid_file
end
-
+
end
describe "when the pid file exists and the process is forked" do
-
+
before do
File.stub!(:exists?).with("/var/run/chef/chef-client.pid").and_return(true)
Chef::Daemon.stub!(:forked?) { true }
end
-
+
it "should not remove the file" do
FileUtils.should_not_receive(:rm)
Chef::Daemon.remove_pid_file
end
-
+
end
-
+
describe "when the pid file exists and the process is not forked" do
before do
File.stub!(:exists?).with("/var/run/chef/chef-client.pid").and_return(true)
Chef::Daemon.stub!(:forked?) { false }
end
-
+
it "should remove the file" do
FileUtils.should_receive(:rm)
Chef::Daemon.remove_pid_file
end
end
@@ -293,10 +293,10 @@
end
it "should log an appropriate error message and fail miserably" do
Process.stub!(:initgroups).and_raise(Errno::EPERM)
error = "Operation not permitted"
- if RUBY_PLATFORM.match("solaris2")
+ if RUBY_PLATFORM.match("solaris2") || RUBY_PLATFORM.match("aix")
error = "Not owner"
end
Chef::Application.should_receive(:fatal!).with("Permission denied when trying to change 999:999 to 501:20. #{error}")
Chef::Daemon._change_privilege("aj")
end