diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml new file mode 100644 index 0000000..5bd7362 --- /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.24' + + - name: Run tests + run: | + cargo test + cd noop-plugin && go test + cd ../xdp-forwarder && go test \ No newline at end of file diff --git a/README.md b/README.md index e151247..ffe6fa2 100644 --- a/README.md +++ b/README.md @@ -142,6 +142,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 @@ -156,8 +178,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). @@ -167,8 +187,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). @@ -177,8 +195,6 @@ 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. 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;