Skip to content

Commit e0dd741

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

File tree

1 file changed

+34
-0
lines changed

1 file changed

+34
-0
lines changed
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
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: Install dependencies
14+
run: |
15+
dnf install -y dnf-plugins-core epel-release cpp
16+
dnf copr enable @CESNET/NEMEA
17+
dnf install cesnet-ipfix-elements
18+
- name: Check IPFIX elements
19+
run: |
20+
cd include/ipfixprobe
21+
diff_output=$(comm -23 \
22+
<(echo -e '#include "ipfix-elements.hpp"\n#define F(ENUMBER, EID, LENGTH, SOURCE) \
23+
e ## ENUMBER ## id ## EID\n#define X(FIELD) FIELD(F),\nstart\nIPFIX_ENABLED_TEMPLATES(X)\n \
24+
' | cpp | sed -n '/^start/,$p;' | sed 's/start//; s/, \?/\n/g' | sort | uniq) \
25+
<(/opt/libfds/bin/get-ipfix-elementlist-from-libfds.py /opt/libfds/system/elements/* | sort | uniq))
26+
- name: Check for missing elements
27+
run: |
28+
if [ -n "$diff_output" ]; then
29+
echo "Missing IPFIX elements:"
30+
echo "$diff_output"
31+
exit 1
32+
else
33+
echo "All IPFIX elements are present."
34+
fi

0 commit comments

Comments
 (0)