Add a new printf-like function to allow printing of all fields at once and rework all commands which print a report to use it. Add functions for printing of headers and information fields, and formatting of IP addresses and reference IDs.
37 lines
1.3 KiB
Bash
Executable file
37 lines
1.3 KiB
Bash
Executable file
#!/bin/bash
|
|
|
|
. ./test.common
|
|
|
|
test_start "chronyc"
|
|
|
|
chronyc_conf="tracking
|
|
sources
|
|
sourcestats"
|
|
|
|
run_test || test_fail
|
|
check_chronyd_exit || test_fail
|
|
|
|
check_chronyc_output "^Reference ID : 192\.168\.123\.1 \(192\.168\.123\.1\)
|
|
Stratum : 2
|
|
Ref time \(UTC\) : Fri Jan 01 00:1.:.. 2010
|
|
System time : 0\.0000..... seconds (slow|fast) of NTP time
|
|
Last offset : [+-]0\.000...... seconds
|
|
RMS offset : 0\.000...... seconds
|
|
Frequency : (99|100)\.... ppm fast
|
|
Residual freq : [+-][0-9]\.... ppm
|
|
Skew : [0-9]\.... ppm
|
|
Root delay : 0\.000... seconds
|
|
Root dispersion : 0\.000... seconds
|
|
Update interval : [0-9]+\.. seconds
|
|
Leap status : Normal
|
|
210 Number of sources = 1
|
|
MS Name/IP address Stratum Poll Reach LastRx Last sample
|
|
===============================================================================
|
|
\^\* 192\.168\.123\.1 1 [67] 377 [0-9]+ [0-9 +-]+[un]s\[[0-9 +-]+[un]s\] \+/-[ 0-9]+[un]s
|
|
210 Number of sources = 1
|
|
Name/IP Address NP NR Span Frequency Freq Skew Offset Std Dev
|
|
==============================================================================
|
|
192\.168\.123\.1 [0-9 ]+ [0-9 ]+ [0-9 ]+ [ +-][01]\.... [0-9 ]+\.... [0-9 +-]+[un]s [0-9 ]+[un]s$" \
|
|
|| test_fail
|
|
|
|
test_pass
|