From 8d1a29ce9afc10351534f2c2bcac025bc617ae94 Mon Sep 17 00:00:00 2001 From: Pavel Siska Date: Tue, 22 Jul 2025 10:59:13 +0200 Subject: [PATCH] CI: add workflow to check IPFIX element consistency with libfds --- .github/workflows/checkIpfixElemets.yml | 32 +++++++++++++++++++++++++ .github/workflows/ciEntryPoint.yml | 4 ++++ 2 files changed, 36 insertions(+) create mode 100644 .github/workflows/checkIpfixElemets.yml diff --git a/.github/workflows/checkIpfixElemets.yml b/.github/workflows/checkIpfixElemets.yml new file mode 100644 index 000000000..1fdb44113 --- /dev/null +++ b/.github/workflows/checkIpfixElemets.yml @@ -0,0 +1,32 @@ +name: checkIpfixElements + +on: [workflow_call] + +jobs: + ipfix-elements-checks: + runs-on: ubuntu-latest + container: oraclelinux:9 + steps: + - name: Check out repository code + uses: actions/checkout@v4 + - name: Install dependencies + run: | + dnf install -y dnf-plugins-core epel-release cpp + dnf copr enable @CESNET/NEMEA + dnf install cesnet-ipfix-elements + - name: Check IPFIX elements + run: | + cd include/ipfixprobe + diff_output=$(comm -23 \ + <(echo -e '#include "ipfix-elements.hpp"\n#define F(ENUMBER, EID, LENGTH, SOURCE) \ + e ## ENUMBER ## id ## EID\n#define X(FIELD) FIELD(F),\nstart\nIPFIX_ENABLED_TEMPLATES(X)\n \ + ' | cpp | sed -n '/^start/,$p;' | sed 's/start//; s/, \?/\n/g' | sort | uniq) \ + <(/opt/libfds/bin/get-ipfix-elementlist-from-libfds.py /opt/libfds/system/elements/* | sort | uniq)) + + if [ -n "$diff_output" ]; then + echo "Missing IPFIX elements:" + echo "$diff_output" + exit 1 + else + echo "All IPFIX elements are present." + fi diff --git a/.github/workflows/ciEntryPoint.yml b/.github/workflows/ciEntryPoint.yml index ba4f9065e..2e47c9d32 100644 --- a/.github/workflows/ciEntryPoint.yml +++ b/.github/workflows/ciEntryPoint.yml @@ -54,3 +54,7 @@ jobs: uses: ./.github/workflows/rpm-install.yml with: os: ${{ matrix.os }} + + ipfix-elements-check: + needs: [rpm-build] + uses: ./.github/workflows/checkIpfixElemets.yml