Skip to content

Commit ed556f9

Browse files
oech3oech3
authored andcommitted
build-gnu.sh: Move {ch,run}con tests to SELinux VM to avoid wrong result by false symlinks
1 parent aaa0610 commit ed556f9

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
@@ -111,7 +111,8 @@ test -f "${UU_BUILD_DIR}/[" || (cd ${UU_BUILD_DIR} && ln -s "test" "[")
111111

112112
cd "${path_GNU}" && echo "[ pwd:'${PWD}' ]"
113113

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

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

0 commit comments

Comments
 (0)