mirror of
https://github.com/fluent/fluentd-ui.git
synced 2026-05-05 19:06:12 +02:00
Fix to fluentd restart equals stop && start, not reload
This commit is contained in:
parent
a38fbeb4e5
commit
5d85bff58c
@ -34,6 +34,10 @@ class Fluentd
|
||||
|
||||
# return value is status_after_this_method_called == started
|
||||
def restart
|
||||
stop && start
|
||||
end
|
||||
|
||||
def reload # NOTE: does not used currently, and td-agent has no restart command
|
||||
return false unless running?
|
||||
actual_restart
|
||||
end
|
||||
|
||||
@ -106,31 +106,39 @@ describe Fluentd::Agent do
|
||||
end
|
||||
|
||||
describe "#restart" do
|
||||
before { instance.stub(:running?).and_return { running } }
|
||||
|
||||
before { instance.stub(:stop).and_return { stop_result } }
|
||||
before { instance.stub(:start).and_return { start_result } }
|
||||
subject { instance.restart }
|
||||
|
||||
context "running" do
|
||||
let(:running) { true }
|
||||
describe "return true only if #stop and #start success" do
|
||||
context "#stop success" do
|
||||
let(:stop_result) { true }
|
||||
|
||||
before { instance.stub(:actual_restart).and_return { restart_result } }
|
||||
context" #start success" do
|
||||
let(:start_result) { true }
|
||||
it { should be_true }
|
||||
end
|
||||
|
||||
context "actual restart success" do
|
||||
let(:restart_result) { true }
|
||||
it { should be_true }
|
||||
context" #start fail" do
|
||||
let(:start_result) { false }
|
||||
it { should be_false }
|
||||
end
|
||||
end
|
||||
|
||||
context "actual restart failed" do
|
||||
let(:restart_result) { false }
|
||||
it { should be_false }
|
||||
context "#stop fail" do
|
||||
let(:stop_result) { false }
|
||||
|
||||
context" #start success" do
|
||||
let(:start_result) { true }
|
||||
it { should be_false }
|
||||
end
|
||||
|
||||
context" #start fail" do
|
||||
let(:start_result) { false }
|
||||
it { should be_false }
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
context "not running" do
|
||||
let(:running) { false }
|
||||
|
||||
it { should be_false }
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user