diff options
author | Grant Ridder <shortdudey123@gmail.com> | 2017-05-15 14:06:03 -0700 |
---|---|---|
committer | Grant Ridder <shortdudey123@gmail.com> | 2017-05-15 14:06:03 -0700 |
commit | 1439b676b1221eb9db3ff395d2a8547b1a31e0da (patch) | |
tree | b80396bd67dba0a3638eeba774ffefebb2dbcff3 /spec/unit/provider_resolver_spec.rb | |
parent | 013d559b186e760f1f478180a15a5289f49e4849 (diff) | |
download | chef-1439b676b1221eb9db3ff395d2a8547b1a31e0da.tar.gz |
Prefer Systemd with sysvinit script over Upstart for service provider
On newer Debian based systems that use systemd to have a package install a SysV init and Upstart script. Systemd can use systemd service files or SysV init scripts. However, on the Chef serivce provider side, this is not reflected. So in this case, Upstart will be prefered even if Upstart itself is not installed on the system.
Signed-off-by: Grant Ridder <shortdudey123@gmail.com>
Diffstat (limited to 'spec/unit/provider_resolver_spec.rb')
-rw-r--r-- | spec/unit/provider_resolver_spec.rb | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/spec/unit/provider_resolver_spec.rb b/spec/unit/provider_resolver_spec.rb index 9a66df82b3..0a504fa5fe 100644 --- a/spec/unit/provider_resolver_spec.rb +++ b/spec/unit/provider_resolver_spec.rb @@ -192,34 +192,34 @@ describe Chef::ProviderResolver do stub_service_providers(:debian, :invokercd, :upstart, :systemd) end - it "when only the SysV init script exists, it returns a Service::Debian provider" do + it "when both the SysV init and Systemd script exists, it returns a Service::Debian provider" do stub_service_configs(:initd, :systemd) expect(resolved_provider).to eql(Chef::Provider::Service::Systemd) end - it "when both SysV and Upstart scripts exist, it returns a Service::Upstart provider" do + it "when SysV, Upstart, and Systemd scripts exist, it returns a Service::Systemd provider" do stub_service_configs(:initd, :upstart, :systemd) expect(resolved_provider).to eql(Chef::Provider::Service::Systemd) end - it "when only the Upstart script exists, it returns a Service::Upstart provider" do + it "when both the Upstart and Systemd scripts exists, it returns a Service::Systemd provider" do stub_service_configs(:upstart, :systemd) expect(resolved_provider).to eql(Chef::Provider::Service::Systemd) end - it "when both do not exist, it calls the old style provider resolver and returns a Debian Provider" do + it "when both do not exist, it calls the old style provider resolver and returns a Systemd Provider" do stub_service_configs(:systemd) expect(resolved_provider).to eql(Chef::Provider::Service::Systemd) end - it "when only the SysV init script exists, it returns a Service::Debian provider" do + it "when only the SysV init script exists, it returns a Service::Systemd provider" do stub_service_configs(:initd) - expect(resolved_provider).to eql(Chef::Provider::Service::Debian) + expect(resolved_provider).to eql(Chef::Provider::Service::Systemd) end - it "when both SysV and Upstart scripts exist, it returns a Service::Upstart provider" do + it "when both SysV and Upstart scripts exist, it returns a Service::Systemd provider" do stub_service_configs(:initd, :upstart) - expect(resolved_provider).to eql(Chef::Provider::Service::Upstart) + expect(resolved_provider).to eql(Chef::Provider::Service::Systemd) end it "when only the Upstart script exists, it returns a Service::Upstart provider" do @@ -227,7 +227,7 @@ describe Chef::ProviderResolver do expect(resolved_provider).to eql(Chef::Provider::Service::Upstart) end - it "when both do not exist, it calls the old style provider resolver and returns a Debian Provider" do + it "when both do not exist, it calls the old style provider resolver and returns a Systemd Provider" do stub_service_configs expect(resolved_provider).to eql(Chef::Provider::Service::Systemd) end @@ -410,7 +410,7 @@ describe Chef::ProviderResolver do stub_service_providers(:debian, :invokercd, :upstart, :systemd) stub_service_configs(:initd, :upstart) mock_shellout_command("/bin/systemctl list-unit-files", exitstatus: 1) - expect(resolved_provider).to eql(Chef::Provider::Service::Upstart) + expect(resolved_provider).to eql(Chef::Provider::Service::Systemd) end end |