Skip to content

Commit 9f87030

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

File tree

1 file changed

+35
-0
lines changed

1 file changed

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

0 commit comments

Comments
 (0)