Skip to content

Commit

Permalink
improve test coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
jreidinger committed Dec 8, 2017
1 parent f16b600 commit 4a2bf34
Show file tree
Hide file tree
Showing 7 changed files with 83 additions and 352 deletions.
4 changes: 2 additions & 2 deletions src/modules/NtpClient.rb
Original file line number Diff line number Diff line change
Expand Up @@ -402,8 +402,8 @@ def Import(settings)
ntp_conf.clear_pools
(settings["ntp_servers"] || []).each do |server|
options = {}
options["iburst"] if server["iburst"]
options["offline"] if server["offline"]
options["iburst"] = nil if server["iburst"]
options["offline"] = nil if server["offline"]
name = server["name"]
log.info "adding server '#{name.inspect}' with options #{options.inspect}"
ntp_conf.add_pool(name, options)
Expand Down
23 changes: 0 additions & 23 deletions test/data/scr_root/etc/ntp.conf.original

This file was deleted.

8 changes: 4 additions & 4 deletions test/fixtures/autoyast/autoinst.xml
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,14 @@
</signature-handling>
</general>
<ntp-client>
<ntp_policy>auto</ntp_policy>
<ntp_policy>eth*</ntp_policy>
<ntp_servers config:type="list">
<ntp_server>
<iburst config:type="boolean">true</iburst>
<iburst config:type="boolean">false</iburst>
<name>cz.pool.ntp.org</name>
<offline config:type="boolean">false</offline>
<offline config:type="boolean">true</offline>
</ntp_server>
</ntp_servers>
<ntp_sync>systemd</ntp_sync>
<ntp_sync>15</ntp_sync>
</ntp-client>
</profile>
38 changes: 38 additions & 0 deletions test/fixtures/cfa/chrony.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# Use public servers from the pool.ntp.org project.
# Please consider joining the pool (http://www.pool.ntp.org/join.html).
pool 2.opensuse.pool.ntp.org iburst

# Record the rate at which the system clock gains/losses time.
driftfile /var/lib/chrony/drift

# Allow the system clock to be stepped in the first three updates
# if its offset is larger than 1 second.
makestep 1.0 3

# Enable kernel synchronization of the real-time clock (RTC).
rtcsync

# Enable hardware timestamping on all interfaces that support it.
#hwtimestamp *

# Increase the minimum number of selectable sources required to adjust
# the system clock.
#minsources 2

# Allow NTP client access from local network.
#allow 192.168.0.0/16

# Serve time even if not synchronized to a time source.
#local stratum 10

# Specify file containing keys for NTP authentication.
#keyfile /etc/chrony.keys

# Get TAI-UTC offset and leap seconds from the system tz database.
#leapsectz right/UTC

# Specify directory for log files.
logdir /var/log/chrony

# Select which information is logged.
#log measurements statistics tracking
24 changes: 0 additions & 24 deletions test/fixtures/cfa/ntp.conf

This file was deleted.

0 comments on commit 4a2bf34

Please sign in to comment.