Skip to content

Commit 6564149

Browse files
authored
Add: CiCd Validation Tests Automation (#1077)
Add: CiCd Validation Tests Automation. This include manual workflow that can be triggered by validation team to run any existing tests. Signed-off-by: Milosz Linkiewicz <[email protected]>
1 parent 467110c commit 6564149

File tree

1 file changed

+111
-0
lines changed

1 file changed

+111
-0
lines changed
Lines changed: 111 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,111 @@
1+
name: validation-bare-metal
2+
3+
on:
4+
# allow manually trigger
5+
workflow_dispatch:
6+
inputs:
7+
branch-to-checkout:
8+
type: string
9+
default: 'main'
10+
required: false
11+
description: 'Branch name to use'
12+
validation-tests:
13+
type: string
14+
default: 'tests/single/video/pacing'
15+
required: true
16+
description: 'Validation tests to run'
17+
18+
env:
19+
# Customize the env if
20+
BUILD_TYPE: 'Release'
21+
DPDK_VERSION: '23.11'
22+
# Bellow ENV variables are required to be defined on runner side:
23+
# TEST_PF_PORT_P: '0000:49:00.0'
24+
# TEST_PF_PORT_R: '0000:49:00.1'
25+
# TEST_PORT_P: '0000:49:01.2'
26+
# TEST_PORT_R: '0000:49:01.3'
27+
# TEST_DMA_PORT_P: '0000:6a:01.0'
28+
# TEST_DMA_PORT_R: '0000:6f:01.0'
29+
30+
permissions:
31+
contents: read
32+
33+
jobs:
34+
validation-build-mtl:
35+
runs-on: [Linux, self-hosted, DPDK]
36+
timeout-minutes: 60
37+
38+
steps:
39+
- name: Harden Runner
40+
uses: step-security/harden-runner@91182cccc01eb5e619899d80e4e971d6181294a7 # v2.10.1
41+
with:
42+
egress-policy: audit
43+
44+
- name: Checkout MTL
45+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
46+
with:
47+
ref: '${{ inputs.branch-to-checkout }}'
48+
49+
- name: Checkout DPDK
50+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
51+
with:
52+
repository: 'DPDK/dpdk'
53+
ref: 'v${{ env.DPDK_VERSION }}'
54+
path: 'dpdk'
55+
56+
- name: Install the build dependency
57+
run: |
58+
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
59+
sudo apt-get install -y systemtap-sdt-dev pipenv
60+
61+
- name: Apply dpdk patches
62+
run: |
63+
patch -d "dpdk" -p1 -i <(cat patches/dpdk/${{ env.DPDK_VERSION }}/*.patch)
64+
65+
- name: Build dpdk
66+
run: |
67+
cd dpdk
68+
meson build
69+
ninja -C build
70+
cd build
71+
sudo ninja install
72+
73+
- name: Build
74+
run: |
75+
./build.sh
76+
sudo ldconfig
77+
78+
- name: Prepare pipenv environment
79+
working-directory: tests/validation
80+
run: |
81+
pipenv install -r requirements.txt
82+
83+
validation-run-tests:
84+
needs: [validation-build-mtl]
85+
runs-on: [Linux, self-hosted, DPDK]
86+
steps:
87+
- name: Harden Runner
88+
uses: step-security/harden-runner@91182cccc01eb5e619899d80e4e971d6181294a7 # v2.10.1
89+
with:
90+
egress-policy: audit
91+
92+
- name: Kill previous pytest routine
93+
run: |
94+
sudo killall -SIGINT pipenv || true
95+
sudo killall -SIGINT pytest || true
96+
sudo killall -SIGINT MtlManager || true
97+
98+
- name: Binding network adapter
99+
run: |
100+
sudo ./script/nicctl.sh create_vf "${TEST_PF_PORT_P}" || true
101+
sudo ./dpdk/usertools/dpdk-devbind.py -b vfio-pci "${TEST_DMA_PORT_P}" || true
102+
sudo ./dpdk/usertools/dpdk-devbind.py -b vfio-pci "${TEST_DMA_PORT_R}" || true
103+
104+
- name: Start MtlManager at background
105+
run: |
106+
sudo MtlManager &
107+
108+
- name: Run tests in pipenv environment
109+
working-directory: tests/validation
110+
run: |
111+
sudo pipenv run pytest '${{ inputs.validation-tests }}' --nic="${TEST_PORT_P},${TEST_PORT_R}" --media=/mnt/media

0 commit comments

Comments
 (0)