From 4878c9d90eb40889c3930ec3ecb14e7a6cc221cc Mon Sep 17 00:00:00 2001 From: Guntaka Umashankar Reddy Date: Wed, 17 Sep 2025 12:19:17 -0400 Subject: [PATCH] Updated alarm message for phc_ctl time change and timeouts. Change-Id: I83890f8484d8a977f727358b46d83feb19e9cccf Signed-off-by: Guntaka Umashankar Reddy --- .../system/ptp/ptp_setup_executor_keywords.py | 12 ------------ keywords/ptp/phc_ctl_keywords.py | 2 +- testcases/cloud_platform/regression/ptp/test_ptp.py | 8 ++++---- 3 files changed, 5 insertions(+), 17 deletions(-) diff --git a/keywords/cloud_platform/system/ptp/ptp_setup_executor_keywords.py b/keywords/cloud_platform/system/ptp/ptp_setup_executor_keywords.py index b967e06e..5068e396 100644 --- a/keywords/cloud_platform/system/ptp/ptp_setup_executor_keywords.py +++ b/keywords/cloud_platform/system/ptp/ptp_setup_executor_keywords.py @@ -229,7 +229,6 @@ class PTPSetupExecutorKeywords(BaseKeyword): validate_equals_with_retry(check_ptp4l_status, True, "systemctl status for ptp4l", 120, 30) # wait for SMA status - check_sma_status = False for clock_instance_obj in self.clock_setup_list: ifaces_to_check = [(host, iface) for host in clock_instance_obj.get_instance_hostnames() for ptp_host_if in clock_instance_obj.get_ptp_interfaces() if "input" in ptp_host_if.get_ptp_interface_parameter() for iface in filter(None, ptp_host_if.get_interfaces_for_hostname(host))] @@ -238,14 +237,8 @@ class PTPSetupExecutorKeywords(BaseKeyword): pci_address = gnss_keywords.get_pci_slot_name(host, interface) cgu_location = f"/sys/kernel/debug/ice/{pci_address}/cgu" gnss_keywords.validate_sma1_and_gnss_1pps_eec_pps_dpll_status_with_retry(host, cgu_location, "SMA1", timeout=180, polling_interval=30) - check_sma_status = True - break - - if check_sma_status: - break # wait for GNSS status - check_gnss_status = False for ts2phc_instance_obj in self.ts2phc_setup_list: expected_gnss_port = gnss_keywords.extract_gnss_port(ts2phc_instance_obj.get_instance_parameters()) if not expected_gnss_port: @@ -264,8 +257,3 @@ class PTPSetupExecutorKeywords(BaseKeyword): pci_address = gnss_keywords.get_pci_slot_name(host, interface) cgu_location = f"/sys/kernel/debug/ice/{pci_address}/cgu" gnss_keywords.validate_sma1_and_gnss_1pps_eec_pps_dpll_status_with_retry(host, cgu_location, timeout=180, polling_interval=30) - check_gnss_status = True - break - - if check_gnss_status: - break diff --git a/keywords/ptp/phc_ctl_keywords.py b/keywords/ptp/phc_ctl_keywords.py index 0e0210d6..c6591503 100644 --- a/keywords/ptp/phc_ctl_keywords.py +++ b/keywords/ptp/phc_ctl_keywords.py @@ -114,7 +114,7 @@ class PhcCtlKeywords(BaseKeyword): else: raise "output_str.split() is expected to be a List with five elements." - def wait_for_phc_ctl_adjustment_alarm(self, interface: str, alarms: List[AlarmListObject], timeout: int = 120, polling_interval: int = 10) -> None: + def wait_for_phc_ctl_adjustment_alarm(self, interface: str, alarms: List[AlarmListObject], timeout: int = 180, polling_interval: int = 10) -> None: """ Run a remote phc_ctl adjustment loop on the controller as root, and stop it once the specified PTP alarm(s) are detected or a timeout occurs. diff --git a/testcases/cloud_platform/regression/ptp/test_ptp.py b/testcases/cloud_platform/regression/ptp/test_ptp.py index a99dbe98..db6d63d2 100644 --- a/testcases/cloud_platform/regression/ptp/test_ptp.py +++ b/testcases/cloud_platform/regression/ptp/test_ptp.py @@ -803,12 +803,12 @@ def test_ptp_operation_phc_ctl_time_change(): ctrl0_ptp1_oot_alarm_obj = AlarmListObject() ctrl0_ptp1_oot_alarm_obj.set_alarm_id("100.119") - ctrl0_ptp1_oot_alarm_obj.set_reason_text(r"controller-0 Precision Time Protocol \(PTP\) clocking is out of tolerance by ((\d+\.\d+) (milli|micro)secs") + ctrl0_ptp1_oot_alarm_obj.set_reason_text(r"controller-0 Precision Time Protocol \(PTP\) clocking is out of tolerance by (\d+\.\d+) (milli|micro)secs") ctrl0_ptp1_oot_alarm_obj.set_entity_id("host=controller-0.instance=ptp1.ptp=out-of-tolerance") ctrl1_ptp1_oot_alarm_obj = AlarmListObject() ctrl1_ptp1_oot_alarm_obj.set_alarm_id("100.119") - ctrl1_ptp1_oot_alarm_obj.set_reason_text(r"controller-1 Precision Time Protocol \(PTP\) clocking is out of tolerance by ((\d+\.\d+) (milli|micro)secs") + ctrl1_ptp1_oot_alarm_obj.set_reason_text(r"controller-1 Precision Time Protocol \(PTP\) clocking is out of tolerance by (\d+\.\d+) (milli|micro)secs") ctrl1_ptp1_oot_alarm_obj.set_entity_id("host=controller-1.instance=ptp1.ptp=out-of-tolerance") phc_ctl_keywords = PhcCtlKeywords(lab_connect_keywords.get_ssh_for_hostname("controller-0")) @@ -825,7 +825,7 @@ def test_ptp_operation_phc_ctl_time_change(): ctrl1_ptp4_oot_alarm_obj = AlarmListObject() ctrl1_ptp4_oot_alarm_obj.set_alarm_id("100.119") - ctrl1_ptp4_oot_alarm_obj.set_reason_text(r"controller-1 Precision Time Protocol \(PTP\) clocking is out of tolerance by ((\d+\.\d+) (milli|micro)secs") + ctrl1_ptp4_oot_alarm_obj.set_reason_text(r"controller-1 Precision Time Protocol \(PTP\) clocking is out of tolerance by (\d+\.\d+) (milli|micro)secs") ctrl1_ptp4_oot_alarm_obj.set_entity_id("host=controller-1.instance=ptp4.ptp=out-of-tolerance") phc_ctl_keywords = PhcCtlKeywords(lab_connect_keywords.get_ssh_for_hostname("controller-1")) @@ -950,7 +950,7 @@ def test_ptp_operation_service_stop_start_restart(): get_logger().log_info("Waiting for alarms 100.119 due to service stop...") ctrl0_alarm = AlarmListObject() ctrl0_alarm.set_alarm_id("100.119") - + ctrl0_alarm.set_reason_text("controller-0 PTP service ptp4l@ptp1.service enabled but not running") ctrl0_alarm.set_entity_id("host=controller-0.instance=ptp1.ptp")