Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Explicitly disable systemd support in podified env #20277

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/miq_environment.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ def self.supports_apache?

def self.supports_systemd?
return @supports_systemd unless @supports_systemd.nil?
@supports_systemd = is_appliance? && supports_command?('systemctl')
@supports_systemd = is_appliance? && !is_container? && supports_command?('systemctl')
end

def self.supports_nohup_and_backgrounding?
Expand Down
13 changes: 13 additions & 0 deletions spec/lib/miq_environment_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,19 @@ def appliance_conditions
assert_same_result_every_time(:is_production_build?, true)
end
end

context ".supports_systemd?" do
it "returns false when container conditions are met" do
container_conditions
assert_same_result_every_time(:supports_systemd?, false)
end

it "returns true when appliance conditions are met" do
appliance_conditions
expect(MiqEnvironment::Command).to receive(:supports_command?).with("systemctl").and_return(true)
assert_same_result_every_time(:supports_systemd?, true)
end
end
end
end
end
Expand Down