Skip to content

adaraiseh basic compilation and test ⚗️ #474

adaraiseh basic compilation and test ⚗️

adaraiseh basic compilation and test ⚗️ #474

name: Yang iproute2 CI
run-name: ${{ github.actor }} basic compilation and test ⚗️
on:
push:
branches:
- '**'
pull_request:
branches:
- '**'
jobs:
build-iproute2-sysrepo:
name: Build iproute2-sysrepo
runs-on: ubuntu-latest
strategy:
matrix:
compiler: [ gcc, clang ]
steps:
- name: add missing packages
uses: ConorMacBride/install-package@v1
with:
apt: libelf-dev libbpf-dev libbsd-dev libcap-dev libmnl-dev libselinux-dev libjson-c-dev clang-format linux-modules-extra-$(uname -r)
- name: libyang v2.1.148 from upstream
uses: actions/checkout@v4
with:
repository: 'CESNET/libyang.git'
ref: 'v2.1.148'
- name: make libyang v2.1.148 from upstream
run: mkdir build && cd build && cmake -DCMAKE_BUILD_TYPE:String="Release" .. && make -j $(nproc) && sudo make install
- name: sysrepo v2.2.150 from upstream
uses: actions/checkout@v4
with:
repository: 'sysrepo/sysrepo.git'
ref: 'v2.2.150'
- name: make sysrepo v2.2.150 from upstream
run : mkdir build && cd build && cmake -DCMAKE_BUILD_TYPE:String="Release" .. && make -j $(nproc) && sudo make install
- name: run ldconfig
run : sudo ldconfig
- name: check sysrepo running ok
run : sudo ldconfig && sudo sysrepoctl -l
- name: recursive checkout (with iproute2 submodule)
uses: actions/checkout@v4
with:
submodules: true
- name: check code format
run: clang-format --dry-run --Werror src/*.c && clang-format --dry-run --Werror src/lib/*.c
- name: make iproute2-sysrepo
run : CC=${{ matrix.compiler }} make -j $(nproc)
- name: basic compilation check
run : ldd bin/iproute2-sysrepo
- name: install required kernel mod(s)
run : sudo modprobe vrf bonding && sudo modprobe mpls_router mpls_iptunnel mpls_gso
- name: basic test "ip link add/set"
run : |
set -e
sudo bin/iproute2-sysrepo ip link add br-slave type dummy
sudo bin/iproute2-sysrepo ip link add br0 type bridge vlan_filtering 1
if ! sudo bin/iproute2-sysrepo ip link set br-slave master br0; then
exit_code=$?
if [ "$exit_code" -ne 1 ]; then
echo "Failed: Command failed with unexpected exit code $exit_code"
exit $exit_code
fi
fi
- name: basic test "ip link"
run : sudo bin/iproute2-sysrepo ip link
- name: basic test "bridge vlan add"
run : sudo bin/iproute2-sysrepo bridge vlan add vid 10 dev br-slave
- name: basic test "bridge link"
run : sudo bin/iproute2-sysrepo bridge link
- name: basic test "tc qdisc add"
run : sudo bin/iproute2-sysrepo tc qdisc add dev br-slave root netem delay 200ms
- name: basic test "tc qdisc"
run : sudo bin/iproute2-sysrepo tc qdisc
- name: basic test "bad argv0"
run : |
sudo bin/iproute2-sysrepo bad-arg || exit_code=$?
if [ "$exit_code" -eq 1 ]; then
echo "Passed: exited with code 1"
exit 0
else
echo "Failed: did not exit with code 1."
exit 1
fi
- name: yanglint
run: make check
- name: load yang modules to sysrepo
run : chmod +x tests/load_yang_modules.sh && sudo ./tests/load_yang_modules.sh
- name: run iproute2-sysrepo startup tests
run : chmod +x tests/run_startup_tests.sh && sudo ./tests/run_startup_tests.sh
- name: run iproute2-sysrepo configuration tests
run : chmod +x tests/run_config_tests.sh && sudo ./tests/run_config_tests.sh