Skip to content

Commit ef496b6

Browse files
authored
build-gnu.sh: Move {ch,run}con tests to SELinux VM to avoid wrong result by false symlinks (#9607)
1 parent c53895a commit ef496b6

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

util/build-gnu.sh

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,8 @@ test -f "${UU_BUILD_DIR}/[" || (cd ${UU_BUILD_DIR} && ln -s "test" "[")
105105

106106
cd "${path_GNU}" && echo "[ pwd:'${PWD}' ]"
107107

108-
# Any binaries that aren't built become `false` so their tests fail
108+
# Any binaries that aren't built become `false` to make tests failure
109+
# Note that some test (e.g. runcon/runcon-compute.sh) incorrectly passes by this
109110
for binary in $(./build-aux/gen-lists-of-programs.sh --list-progs); do
110111
bin_path="${UU_BUILD_DIR}/${binary}"
111112
test -f "${bin_path}" || {
@@ -166,6 +167,11 @@ grep -rl 'path_prepend_' tests/* | xargs -r "${SED}" -i 's| path_prepend_ ./src|
166167
# path_prepend_ sets $abs_path_dir_: set it manually instead.
167168
grep -rl '\$abs_path_dir_' tests/*/*.sh | xargs -r "${SED}" -i "s|\$abs_path_dir_|${UU_BUILD_DIR//\//\\/}|g"
168169

170+
# We can't build runcon and chcon without libselinux. But GNU no longer builds dummies of them. So consider they are SELinux specific.
171+
"${SED}" -i 's/^print_ver_.*/require_selinux_/' tests/runcon/runcon-compute.sh
172+
"${SED}" -i 's/^print_ver_.*/require_selinux_/' tests/runcon/runcon-no-reorder.sh
173+
"${SED}" -i 's/^print_ver_.*/require_selinux_/' tests/chcon/chcon-fail.sh
174+
169175
# We use coreutils yes
170176
"${SED}" -i "s|--coreutils-prog=||g" tests/misc/coreutils.sh
171177
# Different message

0 commit comments

Comments
 (0)