Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions .ci/install-virtme-ng.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#!/bin/bash
set -e

source="${BASH_SOURCE[0]}"

echo "::notice file=$source,line=$LINENO::Installing dependencies"

Check notice on line 6 in .ci/install-virtme-ng.sh

View workflow job for this annotation

GitHub Actions / xdp-integration

Installing dependencies
sudo apt-get update && sudo apt-get install python3-pip qemu-system-x86

echo "::notice file=$source,line=$LINENO::Installing virtme-ng $VIRTME_VERSION"

Check notice on line 9 in .ci/install-virtme-ng.sh

View workflow job for this annotation

GitHub Actions / xdp-integration

Installing virtme-ng v1.38

# We need to install virtme-ng from source because the version in ubuntu-24.04
# is, naturally, super out of date. And we need to clone it outside the source
# directory, otherwise the quilkin workspace screws it up
pushd $RUNNER_TEMP
git clone https://github.com/arighi/virtme-ng
(cd virtme-ng && git checkout "$VIRTME_VERSION" && BUILD_VIRTME_NG_INIT=1 pip3 install .)
popd
12 changes: 12 additions & 0 deletions .ci/xdp/integ-test-multi-kernel.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#!/bin/bash
set -e

# We _cannot_ test on 6.17 due to a kernel bug
KERNEL_VERSIONS=('6.11' '6.12' '6.13' '6.14' '6.15' '6.16')

for vers in "${KERNEL_VERSIONS[@]}"
do
echo "::group::Testing in kernel $vers"
sudo "$RUNNER_TEMP/virtme-ng/vng" --rw --network user -r "v$vers" --exec .ci/xdp/veth-integ-test.sh
echo "::endgroup::"
done
3 changes: 3 additions & 0 deletions .ci/xdp/veth-integ-test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@

source="${BASH_SOURCE[0]}"

# Print kernel version just for confirmation in CI
echo "$(uname -r)"

cleanup() {
echo "Cleaning up"
ip netns del cs || true
Expand All @@ -17,11 +20,11 @@
ip netns del cs || true
ip netns del proxy || true

echo "::notice file=$source,line=$LINENO::Creating network namespaces"

Check notice on line 23 in .ci/xdp/veth-integ-test.sh

View workflow job for this annotation

GitHub Actions / xdp-integration

Creating network namespaces

Check notice on line 23 in .ci/xdp/veth-integ-test.sh

View workflow job for this annotation

GitHub Actions / xdp-integration

Creating network namespaces
ip netns add cs
ip netns add proxy

echo "::notice file=$source,line=$LINENO::Adding client <-> proxy <-> server links"

Check notice on line 27 in .ci/xdp/veth-integ-test.sh

View workflow job for this annotation

GitHub Actions / xdp-integration

Adding client <-> proxy <-> server links

Check notice on line 27 in .ci/xdp/veth-integ-test.sh

View workflow job for this annotation

GitHub Actions / xdp-integration

Adding client <-> proxy <-> server links
ip link add veth-cs type veth peer name veth-proxy

ip link set veth-cs netns cs
Expand All @@ -30,11 +33,11 @@
PROXY_IP="10.0.0.2"
OUTSIDE_IP="10.0.0.1"

echo "::notice file=$source,line=$LINENO::Adding IPs"

Check notice on line 36 in .ci/xdp/veth-integ-test.sh

View workflow job for this annotation

GitHub Actions / xdp-integration

Adding IPs

Check notice on line 36 in .ci/xdp/veth-integ-test.sh

View workflow job for this annotation

GitHub Actions / xdp-integration

Adding IPs
ip -n cs addr add $OUTSIDE_IP/24 dev veth-cs
ip -n proxy addr add $PROXY_IP/24 dev veth-proxy

echo "::notice file=$source,line=$LINENO::Creating network namespaces"

Check notice on line 40 in .ci/xdp/veth-integ-test.sh

View workflow job for this annotation

GitHub Actions / xdp-integration

Creating network namespaces

Check notice on line 40 in .ci/xdp/veth-integ-test.sh

View workflow job for this annotation

GitHub Actions / xdp-integration

Creating network namespaces
ip -n cs link set veth-cs up
ip -n proxy link set veth-proxy up

Expand All @@ -48,7 +51,7 @@
ip netns exec cs fortio udp-echo&
ip netns exec proxy ./target/debug/quilkin --service.udp --service.qcmp --provider.static.endpoints=$OUTSIDE_IP:8078 --service.udp.xdp --service.udp.xdp.network-interface veth-proxy&

echo "::notice file=$source,line=$LINENO::Launching client"

Check notice on line 54 in .ci/xdp/veth-integ-test.sh

View workflow job for this annotation

GitHub Actions / xdp-integration

Launching client
ip netns exec cs fortio load -n 10 udp://$PROXY_IP:7777 2> ./target/logs.txt
logs=$(cat ./target/logs.txt)

Expand All @@ -60,7 +63,7 @@
# We could be more strict here and require they are exactly equal, but I can't
# even consistently get that on my local machine so I doubt CI will fair better
if [[ $recv -ne "0" ]]; then
echo "::notice file=$source,line=$LINENO::Successfully sent ${send}B and received ${recv}B"

Check notice on line 66 in .ci/xdp/veth-integ-test.sh

View workflow job for this annotation

GitHub Actions / xdp-integration

Successfully sent 240B and received 240B

# Now test QCMP pings which was also enabled in the proxy
ip netns exec cs ./target/debug/quilkin qcmp ping $PROXY_IP:7600
Expand Down
16 changes: 10 additions & 6 deletions .github/workflows/xdp-integration-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,14 +33,18 @@ jobs:
# registry: true
# registry_name: ${{ env.REGISTRY_NAME }}
# registry_port: ${{ env.REGISTRY_PORT }}
- uses: dtolnay/rust-toolchain@stable
- name: Fetch quilkin
run: cargo fetch --target x86_64-unknown-linux-gnu
- name: Build quilkin
run: cargo build -p quilkin --bin quilkin
- uses: dtolnay/rust-toolchain@1.85.0
- name: Install virtme-ng
env:
VIRTME_VERSION: "v1.38"
run: .ci/install-virtme-ng.sh
- name: Install fortio
run: |
curl -L -o fortio.deb https://github.com/fortio/fortio/releases/download/v1.68.0/fortio_1.68.0_amd64.deb
sudo dpkg -i fortio.deb
- name: Fetch quilkin
run: cargo fetch --target x86_64-unknown-linux-gnu
- name: Build quilkin
run: cargo build -p quilkin --bin quilkin
- name: Run XDP integration test
run: sudo .ci/xdp/veth-integ-test.sh
run: .ci/xdp/integ-test-multi-kernel.sh