Blame SOURCES/0001-Chrony-add-new-directives-and-options-745.patch

eb6406
From 08101c754aafab4d0f79367839bbd0d6012c31cf Mon Sep 17 00:00:00 2001
eb6406
From: Miroslav Lichvar <mlichvar@redhat.com>
eb6406
Date: Wed, 2 Mar 2022 14:54:39 +0100
b506f0
Subject: [PATCH 1/3] Chrony: add new directives and options (#745)
eb6406
MIME-Version: 1.0
eb6406
Content-Type: text/plain; charset=UTF-8
eb6406
Content-Transfer-Encoding: 8bit
eb6406
eb6406
Support new configuration added in chrony 4.1 and 4.2.
eb6406
eb6406
Co-authored-by: Raphaƫl Pinson <github+aem1eeshi1@raphink.net>
eb6406
(cherry picked from commit 5f3a566511626c35f69961598f1f332db01ed7a1)
eb6406
---
eb6406
 lenses/chrony.aug            | 11 ++++++++---
eb6406
 lenses/tests/test_chrony.aug |  9 +++++++--
eb6406
 2 files changed, 15 insertions(+), 5 deletions(-)
eb6406
eb6406
diff --git a/lenses/chrony.aug b/lenses/chrony.aug
eb6406
index 91c8ed51..d1c29531 100644
eb6406
--- a/lenses/chrony.aug
eb6406
+++ b/lenses/chrony.aug
eb6406
@@ -57,8 +57,11 @@ module Chrony =
eb6406
 (************************************************************************
eb6406
  * Group: Create required expressions
eb6406
  ************************************************************************)
eb6406
+    (* Variable: hex *)
eb6406
+    let hex = /[0-9a-fA-F]+/
eb6406
+
eb6406
     (* Variable: number *)
eb6406
-    let number = integer | decimal | decimal . /[eE]/ . integer
eb6406
+    let number = integer | decimal | decimal . /[eE]/ . integer | hex
eb6406
 
eb6406
     (* Variable: address_re *)
eb6406
     let address_re = Rx.ip | Rx.hostname
eb6406
@@ -79,6 +82,8 @@ module Chrony =
eb6406
          Server/Peer/Pool options with values
eb6406
     *)
eb6406
     let cmd_options = "asymmetry"
eb6406
+                    | "certset"
eb6406
+                    | "extfield"
eb6406
                     | "filter"
eb6406
                     | "key"
eb6406
                     | /maxdelay((dev)?ratio)?/
eb6406
@@ -96,7 +101,7 @@ module Chrony =
eb6406
          Server/Peer/Pool options without values
eb6406
     *)
eb6406
     let cmd_flags = "auto_offline"|"iburst"|"noselect"|"offline"|"prefer"
eb6406
-                  |"require"|"trust"|"xleave"|"burst"|"nts"
eb6406
+                  |"copy"|"require"|"trust"|"xleave"|"burst"|"nts"
eb6406
 
eb6406
     (* Variable: ntp_source
eb6406
          Server/Peer/Pool key names
eb6406
@@ -183,7 +188,7 @@ module Chrony =
eb6406
                     | "nocerttimecheck" | "ntsdumpdir" | "ntsntpserver"
eb6406
                     | "ntsport" | "ntsprocesses" | "ntsrefresh" | "ntsrotate"
eb6406
                     | "ntsservercert" | "ntsserverkey" | "ntstrustedcerts"
eb6406
-                    | "ntpsigndsocket" | "pidfile"
eb6406
+                    | "ntpsigndsocket" | "pidfile" | "ptpport"
eb6406
                     | "port" | "reselectdist" | "rtcautotrim" | "rtcdevice"
eb6406
                     | "rtcfile" | "sched_priority" | "stratumweight" | "user"
eb6406
 
eb6406
diff --git a/lenses/tests/test_chrony.aug b/lenses/tests/test_chrony.aug
eb6406
index 0c86cde7..691e63f7 100644
eb6406
--- a/lenses/tests/test_chrony.aug
eb6406
+++ b/lenses/tests/test_chrony.aug
eb6406
@@ -17,8 +17,8 @@ module Test_Chrony =
eb6406
 server ntp1.example.com
eb6406
 server ntp2.example.com iburst
eb6406
 server ntp3.example.com presend 2
eb6406
-server ntp4.example.com offline polltarget 4
eb6406
-server ntp5.example.com maxdelay 2 offline
eb6406
+server ntp4.example.com offline polltarget 4 extfield F323 copy
eb6406
+server ntp5.example.com maxdelay 2 offline certset 1
eb6406
 server ntp6.example.com maxdelay 2 iburst presend 2 xleave offset 1e-4
eb6406
 server ntp7.example.com iburst presend 2 offline prefer trust require
eb6406
 server ntp8.example.com minsamples 8 maxsamples 16 version 3
eb6406
@@ -88,6 +88,7 @@ ntsport 123
eb6406
 ntsprocesses 2
eb6406
 ntsrefresh 86400
eb6406
 ntsrotate 86400
eb6406
+ptpport 319
eb6406
 "
eb6406
 
eb6406
   test Chrony.lns get exampleconf =
eb6406
@@ -110,10 +111,13 @@ ntsrotate 86400
eb6406
   { "server" = "ntp4.example.com"
eb6406
     { "offline" }
eb6406
     { "polltarget" = "4" }
eb6406
+    { "extfield" = "F323" }
eb6406
+    { "copy" }
eb6406
   }
eb6406
   { "server" = "ntp5.example.com"
eb6406
     { "maxdelay" = "2" }
eb6406
     { "offline" }
eb6406
+    { "certset" = "1" }
eb6406
   }
eb6406
   { "server" = "ntp6.example.com"
eb6406
     { "maxdelay" = "2" }
eb6406
@@ -312,6 +316,7 @@ ntsrotate 86400
eb6406
   { "ntsprocesses" = "2" }
eb6406
   { "ntsrefresh" = "86400" }
eb6406
   { "ntsrotate" = "86400" }
eb6406
+  { "ptpport" = "319" }
eb6406
 
eb6406
 
eb6406
 (* Local Variables: *)
eb6406
-- 
eb6406
2.31.1
eb6406