diff --git a/helm-charts/custom/ptp-notification-helm/ptp-notification-helm/ptp-notification/resources/scripts/init/ptptracking_start_v2.py b/helm-charts/custom/ptp-notification-helm/ptp-notification-helm/ptp-notification/resources/scripts/init/ptptracking_start_v2.py index dc97320..33a0790 100644 --- a/helm-charts/custom/ptp-notification-helm/ptp-notification-helm/ptp-notification/resources/scripts/init/ptptracking_start_v2.py +++ b/helm-charts/custom/ptp-notification-helm/ptp-notification-helm/ptp-notification/resources/scripts/init/ptptracking_start_v2.py @@ -11,6 +11,8 @@ import logging import os import re +from pathlib import Path + from trackingfunctionsdk.common.helpers import log_helper from trackingfunctionsdk.common.helpers import constants from trackingfunctionsdk.services.daemon import DaemonControl @@ -85,8 +87,12 @@ else: GNSS_CONFIGS = [] GNSS_INSTANCES = [] +ice_debugfs = Path("/ice/ice/") if os.environ.get("TS2PHC_SERVICE_NAME").lower() == "false": LOG.info("GNSS instance tracking disabled.") +elif not ice_debugfs.is_dir(): + LOG.info("Ice driver debugfs is not present, GNSS instance tracking disabled.") + os.environ["TS2PHC_SERVICE_NAME"] = "false" else: GNSS_CONFIGS = glob.glob(constants.TS2PHC_CONFIG_PATH + "ts2phc-*") LOG.debug('Looked for ts2phc configuration file(s) in %s, found %d' diff --git a/helm-charts/custom/ptp-notification-helm/ptp-notification-helm/ptp-notification/templates/daemonset.yaml b/helm-charts/custom/ptp-notification-helm/ptp-notification-helm/ptp-notification/templates/daemonset.yaml index ce261dd..e2b1773 100644 --- a/helm-charts/custom/ptp-notification-helm/ptp-notification-helm/ptp-notification/templates/daemonset.yaml +++ b/helm-charts/custom/ptp-notification-helm/ptp-notification-helm/ptp-notification/templates/daemonset.yaml @@ -349,7 +349,7 @@ spec: type: Directory - name: ice hostPath: - path: /sys/kernel/debug/ice/ + path: /sys/kernel/debug/ type: Directory - name: proc hostPath: diff --git a/notificationservice-base-v2/docker/ptptrackingfunction/trackingfunctionsdk/common/helpers/cgu_handler.py b/notificationservice-base-v2/docker/ptptrackingfunction/trackingfunctionsdk/common/helpers/cgu_handler.py index 2e413f6..9287eca 100644 --- a/notificationservice-base-v2/docker/ptptrackingfunction/trackingfunctionsdk/common/helpers/cgu_handler.py +++ b/notificationservice-base-v2/docker/ptptrackingfunction/trackingfunctionsdk/common/helpers/cgu_handler.py @@ -65,7 +65,7 @@ class CguHandler: def get_cgu_path_from_pci_addr(self): # Search for a cgu file using the given pci address - cgu_path = "/ice/" + self.pci_addr + "/cgu" + cgu_path = "/ice/ice/" + self.pci_addr + "/cgu" if os.path.exists(cgu_path): LOG.debug("PCI address %s has cgu path %s" % (self.pci_addr, cgu_path)) diff --git a/notificationservice-base-v2/docker/ptptrackingfunction/trackingfunctionsdk/tests/test_cgu_handler.py b/notificationservice-base-v2/docker/ptptrackingfunction/trackingfunctionsdk/tests/test_cgu_handler.py index 9da9bdc..43c9d16 100644 --- a/notificationservice-base-v2/docker/ptptrackingfunction/trackingfunctionsdk/tests/test_cgu_handler.py +++ b/notificationservice-base-v2/docker/ptptrackingfunction/trackingfunctionsdk/tests/test_cgu_handler.py @@ -55,7 +55,7 @@ class CguHandlerTests(unittest.TestCase): read_data='PCI_SLOT_NAME=0000:18:00.0') as mock_open: self.testCguHandler.convert_nmea_serialport_to_pci_addr() self.testCguHandler.get_cgu_path_from_pci_addr() - self.assertEqual(self.testCguHandler.cgu_path, "/ice/0000:18:00.0/cgu") + self.assertEqual(self.testCguHandler.cgu_path, "/ice/ice/0000:18:00.0/cgu") mock_path.exists.return_value = False with self.assertRaises(FileNotFoundError):