Currently overall sync-state (/sync/sync-status/sync-state) represents
degraded (HOLDOVER/FREERUN) when any state is degraded: os-clock-sync-
state, ptp-status/lock-state, gnss-status/gnss-sync-status.
This commit changes overall sync-state to represent whether the os-clock
is synced or not to the timing source.
Overall sync-state should only be degraded if the timing sources
involved in providing the end-to-end timing is degraded or lost (i.e. it
should represent the overall timing chain status). ptp4l instances that
perform timing distribution only and are not part of the host timing
chain must not impact the overall sync-state. os-clock-state should only
represent the status of the OS clock sync state to the primary clock
source in an HA configuration.
Unit tests has been added and unit test's python interpreter has been
changed to python3.9 to inline with base-image's python version (3.9.2).
TEST PLAN:
PASS: T-GM deployment with two ptp4l instances
trigger different events (stop/start ptp4l/phc2sys/ts2phc
instances, change clockClass, skew clocks, disable GNSS)
overall sync-state is not affected by ptp-inst1 and ptp-inst2
states.
PASS: T-BC deployment with two ptp4l instances
trigger different events (stop/start ptp4l/phc2sys instances,
change clockClass, skew clocks)
overall sync-state is not affected by secondary ptp instance
state.
PASS: Hybrid (T-GM/T-BC) HA deployement: HA with GNSS and PTP source
trigger different events
overall sync-state is result of chained relation to chosen
primary source
Story: 2011370
Task: 51774
Change-Id: Ibfb7fa0f9f8ad09584a5f28b60b0e4649976932c
Signed-off-by: Tara Nath Subedi <tara.subedi@windriver.com>