test: set ACLs for the build dir when built with coverage

Otherwise unprivileged processes (like systemd-resolved) can't write
coverage data.
This commit is contained in:
Frantisek Sumsal 2022-02-14 11:58:54 +01:00
parent 74b781de25
commit e4c822e9ac

View file

@ -1070,6 +1070,9 @@ install_compiled_systemd() {
if get_bool "$IS_BUILT_WITH_COVERAGE"; then
mkdir -p "${initdir}/${BUILD_DIR:?}/"
rsync -am --include='*/' --include='*.gcno' --exclude='*' "${BUILD_DIR:?}/" "${initdir}/${BUILD_DIR:?}/"
# Set effective & default ACLs for the build dir so unprivileged
# processes can write gcda files with coverage stats
setfacl -R -m 'd:o:rwX' -m 'o:rwX' "${initdir}/${BUILD_DIR:?}/"
fi
}