diff --git a/azure-pipelines.yml b/azure-pipelines.yml new file mode 100644 index 0000000000..961b7920d6 --- /dev/null +++ b/azure-pipelines.yml @@ -0,0 +1,11 @@ +trigger: +- master + +pool: + vmImage: 'ubuntu-latest' + +steps: +- script: | + set -e + sudo ./travis-ci/managers/xenial.sh + displayName: 'This is where it gets darker' diff --git a/test/test-functions b/test/test-functions index bfd6b6662a..30b559097b 100644 --- a/test/test-functions +++ b/test/test-functions @@ -378,7 +378,12 @@ find / -name '*.service' -type f | xargs sed -i 's/^\\(MemoryDeny\\|SystemCall\\ # But, apparently, sometimes it doesn't work: https://github.com/google/sanitizers/issues/886. JOURNALD_CONF_DIR=/etc/systemd/system/systemd-journald.service.d mkdir -p "\$JOURNALD_CONF_DIR" -printf "[Service]\nEnvironment=ASAN_OPTIONS=\$DEFAULT_ASAN_OPTIONS:log_path=/systemd-journald.asan.log\n" >"\$JOURNALD_CONF_DIR/env.conf" +printf "[Service]\nEnvironment=ASAN_OPTIONS=\$DEFAULT_ASAN_OPTIONS:log_path=/systemd-journald.asan.log UBSAN_OPTIONS=\$DEFAULT_UBSAN_OPTIONS:log_path=/systemd-journald.ubsan.log\n" >"\$JOURNALD_CONF_DIR/env.conf" + +# Sometimes UBSan sends its reports to stderr regardless of what is specified in log_path +# Let's try to catch them by redirecting stderr (and stdout just in case) to a file +# See https://github.com/systemd/systemd/pull/12524#issuecomment-491108821 +printf "[Service]\nStandardOutput=file:/systemd-journald.out\n" >"\$JOURNALD_CONF_DIR/out.conf" # 90s isn't enough for some services to finish when literally everything is run # under ASan+UBSan in containers, which, in turn, are run in VMs. @@ -386,6 +391,10 @@ printf "[Service]\nEnvironment=ASAN_OPTIONS=\$DEFAULT_ASAN_OPTIONS:log_path=/sys mkdir -p /etc/systemd/system/systemd-hwdb-update.service.d printf "[Unit]\nConditionVirtualization=container\n\n[Service]\nTimeoutSec=180s\n" >/etc/systemd/system/systemd-hwdb-update.service.d/env-override.conf +# Let's override another hard-coded timeout that kicks in too early +mkdir -p /etc/systemd/system/systemd-journal-flush.service.d +printf "[Service]\nTimeoutSec=180s\n" >/etc/systemd/system/systemd-journal-flush.service.d/timeout.conf + # The 'mount' utility doesn't behave well under libasan, causing unexpected # fails during boot and subsequent test results check: # bash-5.0# mount -o remount,rw -v / @@ -508,9 +517,10 @@ check_asan_reports() { ret=$(($ret+1)) fi - journald_report=$(find "$root" -name "systemd-journald.asan.log*" -exec cat {} \;) + journald_report=$(find "$root" -name "systemd-journald.*san.log*" -exec cat {} \;) if [[ ! -z "$journald_report" ]]; then - printf "%s" "$journald_report" + printf "%s\n" "$journald_report" + cat "$root/systemd-journald.out" || true ret=$(($ret+1)) fi diff --git a/travis-ci/managers/xenial.sh b/travis-ci/managers/xenial.sh index 4822bdd4b7..e1c5d77cbf 100755 --- a/travis-ci/managers/xenial.sh +++ b/travis-ci/managers/xenial.sh @@ -2,13 +2,14 @@ set -e set -x +bash -c "echo 'deb-src http://archive.ubuntu.com/ubuntu/ xenial main restricted universe multiverse' >>/etc/apt/sources.list" apt-get update apt-get build-dep systemd -y apt-get install -y util-linux libmount-dev libblkid-dev liblzma-dev libqrencode-dev libmicrohttpd-dev iptables-dev liblz4-dev libcurl4-gnutls-dev unifont itstool kbd cryptsetup-bin net-tools isc-dhcp-client iputils-ping strace qemu-system-x86 linux-image-virtual mount libgpg-error-dev libxkbcommon-dev python-lxml python3-lxml python3-pip libcap-dev apt-get install -y gettext python3-evdev python3-pyparsing libmount-dev python3-setuptools ninja-build pip3 install meson -cd $REPO_ROOT +cd ${REPO_ROOT:-$(pwd)} sed -i 's/2\.30/2.27/' meson.build