Skip to content

Commit

Permalink
Merge 718cf22 into 67b347d
Browse files Browse the repository at this point in the history
  • Loading branch information
teclator committed May 4, 2021
2 parents 67b347d + 718cf22 commit e1f7b03
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 3 deletions.
6 changes: 6 additions & 0 deletions package/yast2-ntp-client.changes
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
-------------------------------------------------------------------
Tue May 4 10:22:49 UTC 2021 - Knut Anderssen <kanderssen@suse.com>

- Adapted proposal client returning the dhcp ntp servers as strings
- 4.4.1 (bsc#1185545)

-------------------------------------------------------------------
Tue Apr 20 13:51:55 UTC 2021 - Ladislav Slezák <lslezak@suse.cz>

Expand Down
2 changes: 1 addition & 1 deletion package/yast2-ntp-client.spec
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@


Name: yast2-ntp-client
Version: 4.4.0
Version: 4.4.1
Release: 0
Summary: YaST2 - NTP Client Configuration
License: GPL-2.0-or-later
Expand Down
2 changes: 1 addition & 1 deletion src/clients/ntp-client_proposal.rb
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ def main
NtpClient.ntp_selected = Ops.get_boolean(@param, "ntp_used", false)
@ret = true
when "dhcp_ntp_servers"
@ret = NtpClient.dhcp_ntp_servers
@ret = NtpClient.dhcp_ntp_servers.map(&:hostname)
when "MakeProposal"
@ret = MakeProposal()
when "Write"
Expand Down
26 changes: 25 additions & 1 deletion test/ntp_client_proposal_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,32 @@
client
end

let(:dhcp_ntp_servers) { [] }

before do
allow(Yast::Lan).to receive(:dhcp_ntp_servers)
.and_return(dhcp_ntp_servers)
end

describe "#main" do
let(:client) { described_class.new }
let(:func) { "dhcp_ntp_servers" }

before do
allow(Yast::WFM).to receive(:Args).with(no_args).and_return([func])
allow(Yast::WFM).to receive(:Args).with(0).and_return(func)
end

context "when call with 'dhcp_ntp_servers' argument" do
let(:dhcp_ntp_servers) { ["test.example.net", "test2.example.net"] }

it "returns servers found via DHCP" do
expect(client.main).to eql(dhcp_ntp_servers)
end
end
end

describe "#MakeProposal" do
let(:dhcp_ntp_servers) { [] }
let(:config_was_read?) { false }
let(:ntp_was_selected?) { false }

Expand Down

0 comments on commit e1f7b03

Please sign in to comment.