cgroup: don't emit BPF firewall warning when manager is in test mode
authorLuca Boccassi <luca.boccassi@microsoft.com>
Tue, 30 Nov 2021 23:49:33 +0000 (23:49 +0000)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Tue, 11 Jan 2022 18:11:02 +0000 (19:11 +0100)
commitf4472e406eaa1087534066d09a4b7f2fd1de2a06
tree24cbedafcaccd604b2698f784f879d72c4753eb2
parent27028ef0f0bc128d14f41e233ad256687fd7e379
cgroup: don't emit BPF firewall warning when manager is in test mode

Support for BPF might not have been checked, since it's not necessary
in test mode (eg: running offline analysis of units). This causes an
assert:

Assertion '(_error) != 0' failed at src/core/bpf-firewall.c:914, function emit_bpf_firewall_warning(). Aborting.

Export SYSTEMD_LOG_LEVEl=debug in TEST-65-ANALYZE is enough to trigger
this assert while doing an offline analysis of a unit that has some
firewall/network restrictions set.

Skip the warning if the manager is in test mode.

(cherry picked from commit a42232a18c5716f69efc67c779dd2ef6c4b9d6c2)
src/core/bpf-firewall.c