Skip to content

Commit

Permalink
Fix lens ntp.aug (tos/minclock) and support ntpsec conf file (Debian1…
Browse files Browse the repository at this point in the history
…2) (#821)

* Fix lens ntp.aug (tos/minclock) and support ntpsec conf file (Debian12)

- fixed lens parser fails on 'tos/minclock' (/etc/ntpsec/ntp.conf on debian12 with that line "tos minclock 4 minsane 3" )
- filter : add /etc/ntpsec/ntp.conf

* Update test_ntp.aug
  • Loading branch information
FrancoisRegisDegott-eaton authored Nov 28, 2023
1 parent f0a0586 commit 6d3ef09
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lenses/ntp.aug
Original file line number Diff line number Diff line change
Expand Up @@ -117,8 +117,7 @@ module Ntp =
orphan stratum | orphanwait delay] *)

let tos =
let arg_names = /beacon|ceiling|cohort|floor|maxclock|maxdist|
minclock|mindist|minsane|orphan|orphanwait/ in
let arg_names = /beacon|ceiling|cohort|floor|maxclock|maxdist|minclock|mindist|minsane|orphan|orphanwait/ in
let arg = [ key arg_names . sep_spc . store Rx.decimal ] in
[ key "tos" . (sep_spc . arg)* . eol ]

Expand All @@ -135,5 +134,6 @@ module Ntp =
| auth_command | tinker | tos | interface)*

let filter = (incl "/etc/ntp.conf")
. (incl "/etc/ntpsec/ntp.conf")

let xfm = transform lns filter
6 changes: 6 additions & 0 deletions lenses/tests/test_ntp.aug
Original file line number Diff line number Diff line change
Expand Up @@ -183,3 +183,9 @@ test Ntp.tinker get "tinker panic 0 huffpuff 3.14\n" =
test Ntp.tos get "tos maxdist 16\n" =
{ "tos"
{ "maxdist" = "16" } }

(* PR #821: tos minclock directive *)
test Ntp.tos get "tos minclock 4 minsane 3\n" =
{ "tos"
{ "minclock" = "4" }
{ "minsane" = "3" } }

0 comments on commit 6d3ef09

Please sign in to comment.