Skip to content

Commit f202b96

Browse files
authored
ci: fixed script running tests to match requirements of test_flb_utils_get_machine_id test for flb_utils_get_machine_id function from flb_utils.c (#9630)
Signed-off-by: Marat Abrarov <[email protected]>
1 parent 8994bfc commit f202b96

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

run_code_analysis.sh

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,11 +31,20 @@ elif [[ ! -f "$SOURCE_DIR"/CMakeLists.txt ]]; then
3131
exit 1
3232
fi
3333

34+
machine_id_file="$(mktemp)"
35+
< /dev/urandom tr -dc 'a-zA-Z0-9' | fold -w 32 | head -n 1 > "${machine_id_file}"
36+
37+
exit_code=0
3438
# Run the action we want on it but using an in-container build directory to prevent various permissions errors and files locally
3539
"$CONTAINER_RUNTIME" run --rm -t -w "/tmp/source" -v "${SOURCE_DIR}:/source:ro" \
40+
-v "${machine_id_file}:/etc/machine-id:ro" \
3641
-e INPUT_PRESET="$TEST_PRESET" \
3742
-e INPUT_DEPENDENCIES_DEBIAN="$ADDITIONAL_DEPS" \
3843
-e INPUT_CMAKEFLAGS="$FLB_CMAKE_OPTIONS $SKIP" \
3944
-e INPUT_PRE_COMMAND="cp -R /source /tmp" \
4045
-e INPUT_WORKING-DIRECTORY="/tmp/source" \
41-
lpenz/ghaction-cmake:0.19
46+
lpenz/ghaction-cmake:0.19 \
47+
|| exit_code=$?
48+
49+
rm -f "${machine_id_file}"
50+
exit "${exit_code}"

0 commit comments

Comments
 (0)