Skip to content

Upgrade trivy scans (#997) #2896

Upgrade trivy scans (#997)

Upgrade trivy scans (#997) #2896

name: gtest
on:
# allow manually trigger
workflow_dispatch:
push:
branches:
- main
- 'maint-**'
pull_request:
branches:
- main
- 'maint-**'
concurrency:
group: ${{ github.head_ref || github.run_id }}
cancel-in-progress: true
env:
# Customize the env if
BUILD_TYPE: Release
DPDK_VERSION: 23.11
TEST_PF_PORT_P: 0000:af:00.0
TEST_PF_PORT_R: 0000:af:00.0
TEST_PORT_P: 0000:af:01.2
TEST_PORT_R: 0000:af:01.3
TEST_DMA_PORT_P: 0000:80:04.0
TEST_DMA_PORT_R: 0000:80:04.1
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@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6
- uses: dorny/paths-filter@de90cc6fb38fc0963ad72b210f1f284cd68cea36 # 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, DPDK]
timeout-minutes: 60
steps:
- name: Harden Runner
uses: step-security/harden-runner@0d381219ddf674d61a7572ddd19d7941e271515c # v2.9.0
with:
egress-policy: audit
- name: Checkout IMTL
uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6
- name: Checkout DPDK
uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6
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-pyelftools pkg-config libnuma-dev libjson-c-dev libpcap-dev libgtest-dev libsdl2-dev libsdl2-ttf-dev libssl-dev
sudo apt-get install -y systemtap-sdt-dev
- name: Apply dpdk patches
run: |
cd dpdk
git am ../patches/dpdk/${{ env.DPDK_VERSION }}/*.patch
- name: Build dpdk
run: |
cd dpdk
meson build
ninja -C build
cd build
sudo ninja install
- name: Build
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, DPDK]
steps:
- name: Harden Runner
uses: step-security/harden-runner@0d381219ddf674d61a7572ddd19d7941e271515c # v2.9.0
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
sudo killall -SIGINT MtlManager || true
- name: Binding network adapter
run: |
sudo ./script/nicctl.sh create_vf ${{ env.TEST_PF_PORT_P }} || true
sudo ./dpdk/usertools/dpdk-devbind.py -b vfio-pci ${{ env.TEST_DMA_PORT_P }} || true
sudo ./dpdk/usertools/dpdk-devbind.py -b vfio-pci ${{ env.TEST_DMA_PORT_R }} || true
- name: Start MtlManager at background
run: |
sudo MtlManager &
- name: Run ufd test case
run: |
sudo ./build/tests/KahawaiUfdTest --p_port ${{ env.TEST_PORT_P }} --r_port ${{ env.TEST_PORT_R }}
- name: Run shared ufd test case
run: |
sudo ./build/tests/KahawaiUfdTest --p_port ${{ env.TEST_PORT_P }} --r_port ${{ env.TEST_PORT_R }} --queue_mode shared
- name: Run shared ufd test case with lcore
run: |
sudo ./build/tests/KahawaiUfdTest --p_port ${{ env.TEST_PORT_P }} --r_port ${{ env.TEST_PORT_R }} --queue_mode shared --udp_lcore
- name: Run ufd test case with rss
run: |
sudo ./build/tests/KahawaiUfdTest --p_port ${{ env.TEST_PORT_P }} --r_port ${{ env.TEST_PORT_R }} --rss_mode l3_l4
- name: Run udp ld preload test case
run: |
sudo MUFD_CFG=.github/workflows/upl_gtest.json LD_PRELOAD=/usr/local/lib/x86_64-linux-gnu/libmtl_udp_preload.so ./build/tests/KahawaiUplTest --p_sip 192.168.89.80 --r_sip 192.168.89.81
- 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 }} --dma_dev ${{ env.TEST_DMA_PORT_P }},${{ env.TEST_DMA_PORT_R }} --gtest_filter=-St22_?x.*
- 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=Main.*:St20p*:-*ext*
- name: Run st2110 st20p test case with kernel loopback
run: |
./build/tests/KahawaiTest --p_port kernel:lo --r_port kernel:lo --auto_start_stop --gtest_filter=St20p*