Cole Walker db8cf39fad Add support for monitoring OS clock sync state
Adds the OsClockMonitor class to handle determining whether a PHC is
being used to sync the system clock. This is done by determining which
ptp device is assigned to phc2sys and then comparing the time of the ptp
device against the OS clock. If the delta is within an expected
threshold then the OS clock is considered LOCKED. If there is no ptp
device configured then the OS clock is set to FREERUN. A holdover state
will also be implemented in a future change.

Unit test coverage is included for OsClockMonitor.

A follow up review will also be provided to add OsClockMonitor into the
main notificationservice daemon process so that the clock state is
checked and reported periodically.

An additional follow up review will be required to update the
helm charts with the required hostPath mounts in order for the
ptp-notification pods to access the expected files on the host system.

Test plan:

Pass: Unit tests
Pass: Run code standalone in ptp-notification pod and verify that OS
clock sync state can be determined

Story: 2010056
Task: 45658

Signed-off-by: Cole Walker <cole.walker@windriver.com>
Change-Id: I1e7dcabe99d079f4587e293ab5983cd1f5b84978
2022-06-30 10:41:52 -04:00
..