Skip to content

Commit

Permalink
add test
Browse files Browse the repository at this point in the history
  • Loading branch information
jreidinger committed Oct 18, 2016
1 parent 99e60e3 commit 4fdc244
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions test/ntp_client_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -442,6 +442,17 @@
expect(subject.sntp_test(server)).to eql(false)
end

it "returns false if sntp respong no UCST" do
output["stdout"] = "sntp 4.2.8p8@1.3265-o Fri Sep 30 15:52:10 UTC 2016 (1)\n" \
"195.113.144.2 no UCST response after 5 seconds\n"
expect(Yast::SCR).to receive(:Execute)
.with(path(".target.bash_output"),
"LANG=C /usr/sbin/sntp -#{ip_version} -K /dev/null -t 5 -c #{server}")
.and_return(output)

expect(subject.sntp_test(server)).to eql(false)
end

it "returns true if sntp command's exit code is 0" do
output["stderr"] = ""
expect(Yast::SCR).to receive(:Execute)
Expand Down

0 comments on commit 4fdc244

Please sign in to comment.