]> git.proxmox.com Git - mirror_lxc.git/blame - .github/workflows/sanitizers.sh
use systemd dbus StartTransientUnit for unpriv cgroup2
[mirror_lxc.git] / .github / workflows / sanitizers.sh
CommitLineData
8f1500a9
EV
1#!/bin/bash
2set -eux
3set -o pipefail
4
2a5b9cd6 5export ASAN_OPTIONS=detect_stack_use_after_return=1:check_initialization_order=1:strict_init_order=1:strict_string_checks=1
8f1500a9
EV
6
7# https://github.com/lxc/lxc/issues/3757
8ASAN_OPTIONS="$ASAN_OPTIONS:detect_odr_violation=0"
9
10export UBSAN_OPTIONS=print_stacktrace=1:print_summary=1:halt_on_error=1
11
56878587 12apt-get update -qq
8f1500a9 13apt-get install --yes --no-install-recommends \
b4b1f149 14 apparmor bash-completion bridge-utils build-essential \
8f1500a9 15 busybox-static clang cloud-image-utils curl dbus debhelper debootstrap \
aec7c9c2 16 devscripts dnsmasq-base docbook2x doxygen ed fakeroot file gcc graphviz \
b4b1f149 17 git iptables meson net-tools libapparmor-dev libcap-dev libgnutls28-dev liblua5.2-dev \
8f1500a9
EV
18 libpam0g-dev libseccomp-dev libselinux1-dev libtool linux-libc-dev \
19 llvm lsb-release make openssl pkg-config python3-all-dev \
20 python3-setuptools rsync squashfs-tools uidmap unzip uuid-runtime \
c55353f8 21 wget xz-utils systemd-coredump libsystemd-dev
0fd92707 22apt-get remove --yes lxc-utils liblxc-common liblxc1 liblxc-dev
8f1500a9 23
b4b1f149 24ARGS="-Dprefix=/usr -Dtests=true -Dpam-cgroup=false -Dwerror=true -Dio-uring-event-loop=false -Db_lto_mode=default -Db_lundef=false"
1667e14e 25case "$CC" in clang*)
b4b1f149 26 ARGS="$ARGS -Db_sanitize=address,undefined"
1667e14e 27esac
b4b1f149
CB
28meson setup san_build $ARGS
29ninja -C san_build
30ninja -C san_build install
8f1500a9 31
02c7e7af
EV
32cat <<'EOF' >/usr/bin/lxc-test-share-ns
33#!/bin/bash
34printf "The test is skipped due to https://github.com/lxc/lxc/issues/3798.\n"
35EOF
36
335a1405
EV
37mv /usr/bin/{lxc-test-concurrent,test-concurrent.orig}
38cat <<EOF >/usr/bin/lxc-test-concurrent
39#!/bin/bash
40printf "Memory leaks are ignored due to https://github.com/lxc/lxc/issues/3788.\n"
41ASAN_OPTIONS=$ASAN_OPTIONS:detect_leaks=0 UBSAN_OPTIONS=$UBSAN_OPTIONS /usr/bin/test-concurrent.orig
42EOF
43chmod +x /usr/bin/lxc-test-concurrent
44
8f1500a9
EV
45sed -i 's/USE_LXC_BRIDGE="false"/USE_LXC_BRIDGE="true"/' /etc/default/lxc
46systemctl daemon-reload
47systemctl restart apparmor
48systemctl restart lxc-net
49
4188864e
SG
50# Undo default ACLs from Github
51setfacl -b -R /home
52
8f1500a9 53git clone --depth=1 https://github.com/lxc/lxc-ci
935dc9a0 54timeout 30m bash -x lxc-ci/deps/lxc-exercise