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

Merge SLE-15-GA into master #132

Merged
merged 9 commits into from
Dec 13, 2018
27 changes: 27 additions & 0 deletions test/ntp_client_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -475,6 +475,33 @@
end
end

describe "#sync_once" do
let(:output) { { "stdout" => "", "stderr" => "", "exit" => 0 } }
let(:server) { "sntp.server.de" }

before do
allow(Yast::SCR).to receive(:Execute)
end

it "syncs the system time against the specified server" do
expect(Yast::SCR).to receive(:Execute)
.with(Yast::Path.new(".target.bash_output"),
"/usr/sbin/chronyd -q -t 30 'pool #{server} iburst'")
.and_return(output)

subject.sync_once(server)
end

it "returns the syncronization exit code" do
expect(Yast::SCR).to receive(:Execute)
.with(Yast::Path.new(".target.bash_output"),
"/usr/sbin/chronyd -q -t 30 'pool #{server} iburst'")
.and_return(output)

expect(subject.sync_once(server)).to eql(0)
end
end

describe "#ntp_test" do
let(:ip_version) { 4 }
let(:server) { "sntp.server.de" }
Expand Down