// Module included in the following assemblies:
//
// * networking/advanced_networking/ptp/configuring-ptp.adoc

:_mod-docs-content-type: PROCEDURE
[id="ptp-verifying-dual-port-bc-failover_{context}"]
= Verifying the dual-port PTP boundary clock failover configuration

[role="_abstract"]
After configuring a dual time receiver port Precision Time Protocol (PTP) boundary clock, you can verify that automatic failover works correctly by checking port states and simulating a failure on the active upstream path.

.Prerequisites

* You have configured a dual time receiver port boundary clock as described in "Configuring PTP boundary clock high availability with dual time receiver ports".
* The PTP boundary clock is running and synchronized to an upstream timing source.

.Procedure

. Identify the `linuxptp-daemon` pod on the target node by running the following command:
+
[source,terminal]
----
$ oc get pods -n openshift-ptp -o wide
----
+
.Example output
[source,terminal]
----
NAME                            READY   STATUS    RESTARTS   AGE   IP               NODE
linuxptp-daemon-4xkbb           1/1     Running   0          43m   10.1.196.24      compute-0.example.com
ptp-operator-657bbb64c8-2f8sj   1/1     Running   0          43m   10.129.0.61      control-plane-1.example.com
----

. Check the PTP Operator logs to identify which port is active and which is in standby by running the following command:
+
[source,terminal]
----
$ oc logs <linuxptp_daemon_pod> -n openshift-ptp -c linuxptp-daemon-container | grep -E "port.*SLAVE|MASTER_CLOCK_SELECTED|LOCKED"
----
+
.Example output
[source,terminal]
----
ptp4l[1000.100]: port 1 (ens2f1): UNCALIBRATED to SLAVE on MASTER_CLOCK_SELECTED
ptp4l[1000.200]: BC FSM: HOLDOVER to LOCKED
----
+
In this example, `ens2f1` is the active time receiver port in the `SLAVE` state and the boundary clock finite state machine (FSM) has reached the `LOCKED` state.

. Simulate a failure on the active path by shutting down the active time receiver port. Run the following command on the target node:
+
[source,terminal]
----
$ oc debug node/<node_name> -- chroot /host ip link set <active_interface> down
----

. Monitor the PTP Operator logs to verify that the standby port transitions to active by running the following command:
+
[source,terminal]
----
$ oc logs -f <linuxptp_daemon_pod> -n openshift-ptp -c linuxptp-daemon-container | grep -E "SLAVE|FAULTY|HOLDOVER|LOCKED|UNCALIBRATED"
----
+
.Example output
[source,terminal]
----
ptp4l[1500.300]: port 1 (ens2f1): SLAVE to FAULTY on FAULT_DETECTED
ptp4l[1500.400]: BC FSM: T-BC MOVE TO HOLDOVER
ptp4l[1500.500]: port 2 (ens2f3): UNCALIBRATED to SLAVE on MASTER_CLOCK_SELECTED
ptp4l[1515.600]: BC FSM: HOLDOVER to LOCKED
----
+
The output confirms that the active port (`ens2f1`) enters the `FAULTY` state, the boundary clock briefly enters `HOLDOVER`, and the standby port (`ens2f3`) transitions to `SLAVE`. After approximately 15 seconds, the boundary clock FSM returns to the `LOCKED` state.

. Restore the original active port by running the following command:
+
[source,terminal]
----
$ oc debug node/<node_name> -- chroot /host ip link set <active_interface> up
----

. Verify that the boundary clock reselects the restored port and returns to the `LOCKED` state by running the following command:
+
[source,terminal]
----
$ oc logs <linuxptp_daemon_pod> -n openshift-ptp -c linuxptp-daemon-container | tail -20 | grep -E "SLAVE|HOLDOVER|LOCKED"
----
+
.Example output
[source,terminal]
----
ptp4l[1570.100]: BC FSM: T-BC MOVE TO HOLDOVER
ptp4l[1570.200]: port 1 (ens2f1): UNCALIBRATED to SLAVE on MASTER_CLOCK_SELECTED
ptp4l[1585.300]: BC FSM: HOLDOVER to LOCKED
----
+
The output confirms that the boundary clock briefly enters `HOLDOVER` during reselection, the original port returns to `SLAVE`, and the FSM reaches `LOCKED` again after approximately 15 seconds.
