Skip to content

Commit 506ca8c

Browse files
author
Pavel Siska
committed
CI: add workflow to check IPFIX element consistency with libfds
1 parent a24b8e2 commit 506ca8c

File tree

2 files changed

+36
-0
lines changed

2 files changed

+36
-0
lines changed
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
name: checkIpfixElements
2+
3+
on: [workflow_call]
4+
5+
jobs:
6+
ipfix-elements-checks:
7+
runs-on: ubuntu-latest
8+
container: oraclelinux:9
9+
steps:
10+
- name: Check out repository code
11+
uses: actions/checkout@v4
12+
- name: Install dependencies
13+
run: |
14+
dnf install -y dnf-plugins-core epel-release cpp
15+
dnf copr enable @CESNET/NEMEA
16+
dnf install cesnet-ipfix-elements
17+
- name: Check IPFIX elements
18+
run: |
19+
cd include/ipfixprobe
20+
diff_output=$(comm -23 \
21+
<(echo -e '#include "ipfix-elements.hpp"\n#define F(ENUMBER, EID, LENGTH, SOURCE) \
22+
e ## ENUMBER ## id ## EID\n#define X(FIELD) FIELD(F),\nstart\nIPFIX_ENABLED_TEMPLATES(X)\n \
23+
' | cpp | sed -n '/^start/,$p;' | sed 's/start//; s/, \?/\n/g' | sort | uniq) \
24+
<(/opt/libfds/bin/get-ipfix-elementlist-from-libfds.py /opt/libfds/system/elements/* | sort | uniq))
25+
26+
if [ -n "$diff_output" ]; then
27+
echo "Missing IPFIX elements:"
28+
echo "$diff_output"
29+
exit 1
30+
else
31+
echo "All IPFIX elements are present."
32+
fi

.github/workflows/ciEntryPoint.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,3 +54,7 @@ jobs:
5454
uses: ./.github/workflows/rpm-install.yml
5555
with:
5656
os: ${{ matrix.os }}
57+
58+
ipfix-elements-check:
59+
needs: [rpm-build]
60+
uses: ./.github/workflows/checkIpfixElemets.yml

0 commit comments

Comments
 (0)