Skip to content

Commit

Permalink
ci: add gtest for afxdp (#654)
Browse files Browse the repository at this point in the history
Signed-off-by: Ric Li <ming3.li@intel.com>
  • Loading branch information
ricmli authored Jan 22, 2024
1 parent 512772b commit 214477b
Show file tree
Hide file tree
Showing 3 changed files with 138 additions and 4 deletions.
4 changes: 4 additions & 0 deletions .github/linters/actionlint.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
self-hosted-runner:
labels:
- DPDK
- XDP
130 changes: 130 additions & 0 deletions .github/workflows/afxdp_build_with_gtest.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,130 @@
name: afxdp_gtest

on:
# allow manually trigger
workflow_dispatch:
push:
branches:
- main
- 'maint-**'
pull_request:
branches:
- main
- 'maint-**'

concurrency:
group: afxdp-${{ github.head_ref || github.run_id }}
cancel-in-progress: true

env:
# Customize the env if
BUILD_TYPE: Release
DPDK_VERSION: 23.11

permissions:
contents: read

jobs:
changes:
runs-on: ubuntu-latest
permissions:
pull-requests: read
outputs:
changed: ${{ steps.filter.outputs.linux_gtest == 'true' }}
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1

- uses: dorny/paths-filter@4512585405083f25c027a35db413c2b3b9006d50 # v2
id: filter
with:
filters: .github/path_filters.yml

Build:
needs: changes
if: ${{ github.repository == 'OpenVisualCloud/Media-Transport-Library' && needs.changes.outputs.changed == 'true' }}
runs-on: [Linux, self-hosted, XDP]
timeout-minutes: 60

steps:
- name: Harden Runner
uses: step-security/harden-runner@eb238b55efaa70779f274895e782ed17c84f2895 # v2.6.1
with:
egress-policy: audit

- name: Checkout IMTL
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1

- name: Checkout DPDK
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
with:
repository: 'DPDK/dpdk'
ref: v${{ env.DPDK_VERSION }}
path: dpdk

- name: Install the build dependency
run: |
sudo apt-get install -y git gcc meson python3 python3-pip pkg-config libnuma-dev libjson-c-dev libpcap-dev libgtest-dev libssl-dev
- name: Install the python package
run: pip install pyelftools==0.29 ninja==1.11.1

- name: Apply dpdk patches
run: |
cd dpdk
git am ../patches/dpdk/${{ env.DPDK_VERSION }}/*.patch
- name: Build dpdk
run: |
cd dpdk
meson setup build -Ddisable_libs='bpf' -Ddisable_drivers='net/af_xdp'
ninja -C build
cd build
sudo ninja install
- name: Build
env:
PKG_CONFIG_PATH: /usr/local/lib/pkgconfig:/usr/lib64/pkgconfig
run: |
./build.sh
sudo ldconfig
Test:
needs: [changes, Build]
if: ${{ github.repository == 'OpenVisualCloud/Media-Transport-Library' && needs.changes.outputs.changed == 'true' }}
runs-on: [Linux, self-hosted, XDP]
env:
LD_LIBRARY_PATH: /usr/local/lib:/usr/lib64
TEST_PORT_P: native_af_xdp:enp24s0f0
TEST_PORT_R: native_af_xdp:enp24s0f1
INTERFACE_P: enp24s0f0
INTERFACE_R: enp24s0f1
steps:
- name: Harden Runner
uses: step-security/harden-runner@eb238b55efaa70779f274895e782ed17c84f2895 # v2.6.1
with:
egress-policy: audit

- name: Kill previous gtest routine
run: |
sudo killall -SIGINT KahawaiTest || true
sudo killall -SIGINT KahawaiUfdTest || true
sudo killall -SIGINT KahawaiUplTest || true
- name: Setup network interfaces
run: |
sudo nmcli dev set ${{ env.INTERFACE_P }} managed no
sudo ifconfig ${{ env.INTERFACE_P }} 192.168.108.101/24
sudo nmcli dev set ${{ env.INTERFACE_R }} managed no
sudo ifconfig ${{ env.INTERFACE_R }} 192.168.108.102/24
echo 2 | sudo tee /sys/class/net/${{ env.INTERFACE_P }}/napi_defer_hard_irqs
echo 200000 | sudo tee /sys/class/net/${{ env.INTERFACE_P }}/gro_flush_timeout
echo 2 | sudo tee /sys/class/net/${{ env.INTERFACE_R }}/napi_defer_hard_irqs
echo 200000 | sudo tee /sys/class/net/${{ env.INTERFACE_R }}/gro_flush_timeout
- name: Run st2110 test case
run: |
sudo ./build/tests/KahawaiTest --auto_start_stop --p_port ${{ env.TEST_PORT_P }} --r_port ${{ env.TEST_PORT_R }} --pacing_way tsc --gtest_filter=St*:-St22_?x.*:*pacing*:*ext*:*create_free_max*:*detect*:*rtcp*
- name: Run st2110 st20p test case in simulation ENA environment
run: |
sudo ./build/tests/KahawaiTest --auto_start_stop --p_port ${{ env.TEST_PORT_P }} --r_port ${{ env.TEST_PORT_R }} --rss_mode l3_l4 --pacing_way tsc --iova_mode pa --multi_src_port --gtest_filter=St20p*:-*pacing*:*ext*:*create_free_max*:*rtcp*
8 changes: 4 additions & 4 deletions .github/workflows/ubuntu_build_with_gtest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ jobs:
Build:
needs: changes
if: ${{ github.repository == 'OpenVisualCloud/Media-Transport-Library' && needs.changes.outputs.changed == 'true' }}
runs-on: [Linux, self-hosted]
runs-on: [Linux, self-hosted, DPDK]
timeout-minutes: 60

steps:
Expand All @@ -57,10 +57,10 @@ jobs:
with:
egress-policy: audit

- name: checkout kahawai repo
- name: Checkout IMTL
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1

- name: checkout dpdk repo
- name: Checkout DPDK
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
with:
repository: 'DPDK/dpdk'
Expand Down Expand Up @@ -95,7 +95,7 @@ jobs:
Test:
needs: [changes, Build]
if: ${{ github.repository == 'OpenVisualCloud/Media-Transport-Library' && needs.changes.outputs.changed == 'true' }}
runs-on: [Linux, self-hosted]
runs-on: [Linux, self-hosted, DPDK]
steps:
- name: Harden Runner
uses: step-security/harden-runner@eb238b55efaa70779f274895e782ed17c84f2895 # v2.6.1
Expand Down

0 comments on commit 214477b

Please sign in to comment.