Skip to content

Commit

Permalink
Merge 73ea7a0 into f61796c
Browse files Browse the repository at this point in the history
  • Loading branch information
teclator committed Dec 13, 2018
2 parents f61796c + 73ea7a0 commit 3a40fd1
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions test/ntp_client_test.rb
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

0 comments on commit 3a40fd1

Please sign in to comment.