From 67cc72082f791674e4533fdce2ed9fdaa9a71ae3 Mon Sep 17 00:00:00 2001 From: 0xull Date: Fri, 9 Jan 2026 05:57:03 +0100 Subject: [PATCH 1/3] [M3W1] docs: update and include testing instructions to README --- README.md | 29 +++++++++++++++++++++-------- 1 file changed, 21 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index 26b6c0f..37abe02 100644 --- a/README.md +++ b/README.md @@ -149,9 +149,28 @@ sudo ip netns exec netns1 ping 10.0.0.2 ``` +## Testing +This project includes test suite for the client-server protocol and network components. ---- +### Running Tests + +**All tests:** +```bash +# Rust integration tests +cargo test + +# Go CNI plugin tests +cd noop-plugin && go test -v + +# Go XDP forwarder tests +cd xdp-forwarder && go test -v +``` + +**Run all tests at once:** +```bash +cargo test && cd noop-plugin && go test && cd ../xdp-forwarder && go test +``` ## 5. Development Roadmap @@ -166,8 +185,6 @@ The project is currently in **Phase 3: The Data Plane**. Below is the immediate * Performs MAC address rewriting (Source/Dest swapping). * Redirects packets between interfaces using `bpf_redirect` (Egress). - - ### [Upcoming] Month 3, Week 2: The Overlay Network (VXLAN) * **Objective:** Evolve the forwarder into a Virtual Tunnel Endpoint (VTEP). @@ -177,8 +194,6 @@ The project is currently in **Phase 3: The Data Plane**. Below is the immediate * **Decapsulation:** Parse incoming VXLAN packets, validate VNI, and strip headers. * Support for RFC 7348 VXLAN packet structure. - - ### [Upcoming] Month 3, Week 3: Dynamic Forwarding (eBPF Maps) * **Objective:** Remove hardcoded logic and implement a Forwarding Database (FDB). @@ -187,12 +202,10 @@ The project is currently in **Phase 3: The Data Plane**. Below is the immediate * **Lookups:** Logic to distinguish between LOCAL (direct redirect) and REMOTE (VXLAN encap) traffic. * **Control Plane:** Go loader acts as the initial map population tool. - - ### [Upcoming] Month 3, Week 4: The SDN Agent * **Objective:** Create a long-running daemon to manage the data plane lifecycle. * **Technical Implementation:** * **gRPC API:** Define `agent.proto` for adding/removing forwarding entries. * **Lifecycle Management:** Handle loading XDP programs and pinning BPF maps (`/sys/fs/bpf/`). -* **Persistence:** Ensure map state survives process restarts via BPF filesystem pinning. \ No newline at end of file +* **Persistence:** Ensure map state survives process restarts via BPF filesystem pinning. From 0d6cd33498afdeecffffa193ae1c696a248fac4f Mon Sep 17 00:00:00 2001 From: 0xull Date: Fri, 9 Jan 2026 05:59:42 +0100 Subject: [PATCH 2/3] [M3W1] build: add continuous integration for testing --- .github/workflows/tests.yml | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 .github/workflows/tests.yml diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml new file mode 100644 index 0000000..cb525e5 --- /dev/null +++ b/.github/workflows/tests.yml @@ -0,0 +1,31 @@ +name: Tests + +on: + push: + branches: [ main, master ] + pull_request: + branches: [ main, master ] + +jobs: + test: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v3 + + - name: Set up Rust + uses: actions-rs/toolchain@v1 + with: + toolchain: stable + override: true + + - name: Set up Go + uses: actions/setup-go@v4 + with: + go-version: '1.20' + + - name: Run tests + run: | + cargo test + cd noop-plugin && go test + cd ../xdp-forwarder && go test \ No newline at end of file From 0f8d00c695011f638cce3e1d2a4b9c457ee10f35 Mon Sep 17 00:00:00 2001 From: 0xull Date: Fri, 9 Jan 2026 06:10:29 +0100 Subject: [PATCH 3/3] [M3W1] build: bump go version in CI to 1.24.x --- .github/workflows/tests.yml | 2 +- tests/client_integration_test.rs | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index cb525e5..5bd7362 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -22,7 +22,7 @@ jobs: - name: Set up Go uses: actions/setup-go@v4 with: - go-version: '1.20' + go-version: '1.24' - name: Run tests run: | diff --git a/tests/client_integration_test.rs b/tests/client_integration_test.rs index 349548c..d1b7c5e 100644 --- a/tests/client_integration_test.rs +++ b/tests/client_integration_test.rs @@ -1,6 +1,5 @@ use std::io::{BufRead, BufReader, Write}; use std::os::unix::net::{UnixListener, UnixStream}; -use std::path::PathBuf; use std::thread; use std::time::Duration; use tempfile::TempDir;