ptp-notification-armada-app/notificationservice-base/docker/ptptrackingfunction/trackingfunctionsdk/common/helpers/constants.py
Cole Walker f2542a59f1 Update default ptp4lClockClassLockedList values
In order to better support the default configuration when
ptp-notification is deployed on a BC, the ptp4lClockClassLockedList
values should in include 135 as a locked clockClass.

This change ensures that classes 6, 7 and 135 are considered acceptable
for the ptp-notification locked state by default, with the ability to
override the acceptable clockClasses available to the user.

Test plan:
PASS: Build ptp-notification helm charts
PASS: Deploy ptp-notification
PASS: v1 api - test ptp4lClockClassLockedList with the default list
PASS: v2 api - test ptp4lClockClassLockedList with the default list

Partial-bug: 2033539

Signed-off-by: Cole Walker <cole.walker@windriver.com>
Change-Id: Ic569c373dc2ddf1771e83b12832ef1460266c93a
2023-09-21 09:58:27 -04:00

39 lines
1.1 KiB
Python

#
# Copyright (c) 2021-2023 Wind River Systems, Inc.
#
# SPDX-License-Identifier: Apache-2.0
#
from os import path
# phc states constants
FREERUN_PHC_STATE = "Freerun"
LOCKED_PHC_STATE = "Locked"
HOLDOVER_PHC_STATE = "Holdover"
UNKNOWN_PHC_STATE = "Unknown"
# PMC command constants
PORT_STATE = "portState"
PORT = "port{}"
GM_PRESENT = "gmPresent"
MASTER_OFFSET = "master_offset"
GM_CLOCK_CLASS = "gm.ClockClass"
TIME_TRACEABLE = "timeTraceable"
CLOCK_IDENTITY = "clockIdentity"
GRANDMASTER_IDENTITY = "grandmasterIdentity"
# expected values for valid ptp state
SLAVE_MODE = "slave"
MASTER_MODE = "master"
TIME_IS_TRACEABLE1 = "1"
TIME_IS_TRACEABLE2 = "true"
GM_IS_PRESENT = "true"
CLOCK_CLASS_VALUE6 = "6"
CLOCK_CLASS_VALUE7 = "7"
CLOCK_CLASS_VALUE135 = "135"
CLOCK_CLASS_LOCKED_LIST = [CLOCK_CLASS_VALUE6, CLOCK_CLASS_VALUE7, CLOCK_CLASS_VALUE135]
if path.exists('/ptp/linuxptp/ptpinstance'):
LINUXPTP_CONFIG_PATH = '/ptp/linuxptp/ptpinstance/'
elif path.exists('/ptp/ptpinstance'):
LINUXPTP_CONFIG_PATH = '/ptp/ptpinstance/'
else:
LINUXPTP_CONFIG_PATH = '/ptp/'