> ## Documentation Index
> Fetch the complete documentation index at: https://dragonwingdocs-staging.qualcomm.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Test Execution — RTC Testbench

## **Test Execution**

> [!NOTE]
>
> Complete [Build & Setup](https://dragonwingdocs-staging.qualcomm.com/Suites/Industrial-Edge-Suite/rtc-testbench-setup.md) and wait 5 minutes for PTP convergence before proceeding.

***

### 1. Configure Peer MAC Addresses

Each device's YAML config must point `GenericL2Destination` at the **peer's** `end0` MAC address — not its own.

Get each device's MAC:

```bash theme={null}
cat /sys/class/net/end0/address
```

Then update the config on each device:

| Device | Config file | Set `GenericL2Destination` to |
| - | - | - |
| Reference | `/usr/share/rtc-testbench/tests/opcua_qcom_emac/reference.yaml` | Mirror device's `end0` MAC |
| Mirror | `/usr/share/rtc-testbench/tests/opcua_qcom_emac/mirror.yaml` | Reference device's `end0` MAC |

***

### 2. Run the Test

Start **mirror first**, then reference:

**On the mirror device:**

```bash theme={null}
/usr/share/rtc-testbench/tests/opcua_qcom_emac/mirror.sh
```

**On the reference device** (after `mirror.sh` has started):

```bash theme={null}
/usr/share/rtc-testbench/tests/opcua_qcom_emac/ref.sh
```

Each script runs `flow.sh end0` which applies taprio/XDP setup and pins NAPI/IRQ threads to CPU 6, sleeps 30 seconds, then launches the `mirror` or `reference` binary in the background.

***

### 3. Check Results

**Log files:**

| Log | Contents |
| - | - |
| `/usr/share/rtc-testbench/tests/opcua_qcom_emac/ref.log` | stdout of the `reference` binary |
| `/usr/share/rtc-testbench/tests/opcua_qcom_emac/mirror.log` | stdout of the `mirror` binary |
| `/var/log/reference_opcua_vid200.log` | Application statistics (`LogFile` in reference YAML) |
| `/var/log/mirror_opcua_vid200.log` | Application statistics (`LogFile` in mirror YAML) |
| `/var/log/ptp4l_run.log` | PTP daemon log (timestamps are process-uptime seconds, not absolute time) |
| `/var/log/phc2sys_run.log` | PHC-to-system-clock sync log |

***

### 4. Success Criterion

After the initial warm-up period, there must be **zero new outliers**:

* `OpcUaRttOutliers` — must not increase after warm-up
* `OpcUaOnewayOutliers` — must not increase after warm-up

> [!NOTE]
>
> The first **64 RTT outliers** at test start are a known, structural XDP TX-ring warm-up artifact and are **not** a failure. Any outliers after this initial burst indicate a problem.

***

### Known Issue — Exclusivity Flag Error

If you see the following error when running `mirror.sh` or `ref.sh`:

```
Error: Exclusivity flag on, cannot modify.
```

**Resolution:** Reboot the device. This occurs when the scripts are run again without rebooting between runs. Always reboot before re-running the test.

***

> [card] [Build & Setup](https://dragonwingdocs-staging.qualcomm.com/Suites/Industrial-Edge-Suite/rtc-testbench-setup.md)
>
> Build, boot verification, postboot, PTP setup

> [card] [Reference Files](https://dragonwingdocs-staging.qualcomm.com/Suites/Industrial-Edge-Suite/rtc-testbench-reference.md)
>
> postboot.sh, ptp.sh, and gPTP config full source

> [card] [RTC Benchmarks IQ9](https://dragonwingdocs-staging.qualcomm.com/Suites/Industrial-Edge-Suite/rtc-benchmarks-iq9.md)
>
> Platform benchmark results

> [card] [RTC Testbench](https://dragonwingdocs-staging.qualcomm.com/Suites/Industrial-Edge-Suite/rtc-testbench.md)
>
> Back to overview
