# Real P2P integration test

tc01 uses the production WebSocket device sample and the browser caller. This
keeps the test on the same signaling, SDP, ICE, DTLS, SRTP, and media paths as
the application.

## Run

From the repository root, install and start the local signaling relay:

```bash
cd samples/p2p/signaling
npm install
node signaling-server.js 8080
```

In another terminal, start the device sample from its build directory:

```bash
cd build/samples
./test_p2p_tc01_device device-1 localhost 8080 ../h264SampleFrames ../opusSampleFrames
```

Open `samples/p2p/user-client.html` in a browser, connect as a user, set the
device ID to `device-1`, and place the call. The device accepts the INVITE,
answers the browser's offer, exchanges trickle ICE, reaches `CONNECTED`, and
sends the recorded H264 and Opus frames.

The device process is intentionally long-lived. Stop it with `Ctrl-C` after
the call so its shutdown path is exercised.# P2P Stress Tests

This directory contains a lightweight stress-test scaffold for the WebRTC SDK.

## Build

From the project root:

```bash
cmake -S . -B build -DBUILD_STRESS_TESTS=ON
cmake --build build --target test_p2p_tc01_client test_p2p_tc01_device -j
```

Or build all stress tests:

```bash
cmake --build build --target test_p2p_tc01_client test_p2p_tc01_device \
  test_p2p_tc02_client test_p2p_tc02_device \
  test_p2p_tc03_client test_p2p_tc03_device -j
```

## Run

```bash
ctest --test-dir build --output-on-failure -R test_p2p_
```

## Scope

These tests intentionally focus on:
- peer connection creation/free lifecycle
- repeated connect/disconnect cycles
- multi-peer creation pressure
- basic stability checks before real signaling/media stress scenarios are added

This is a starting point for a fuller P2P stress suite mirroring the pattern in the attached reference project.
