From 6d3ef097f3720b8a4a1b9f64a05a1b1f7c577b97 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois-R=C3=A9gis=20Degott?= Date: Tue, 28 Nov 2023 10:43:47 +0100 Subject: [PATCH] Fix lens ntp.aug (tos/minclock) and support ntpsec conf file (Debian12) (#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 --- lenses/ntp.aug | 4 ++-- lenses/tests/test_ntp.aug | 6 ++++++ 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/lenses/ntp.aug b/lenses/ntp.aug index 5a52119b7..462ef0f69 100644 --- a/lenses/ntp.aug +++ b/lenses/ntp.aug @@ -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 ] @@ -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 diff --git a/lenses/tests/test_ntp.aug b/lenses/tests/test_ntp.aug index 2eea1d8a7..9dde7b2e8 100644 --- a/lenses/tests/test_ntp.aug +++ b/lenses/tests/test_ntp.aug @@ -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" } }