From 3d74e93fa20274bb105a0d6efa60a3fecede8ed9 Mon Sep 17 00:00:00 2001 From: Joachim Wiberg Date: Sun, 10 Sep 2023 14:03:43 +0200 Subject: [PATCH] test: when rc.local is busy, delay test until it's free Signed-off-by: Joachim Wiberg --- test/lib/setup.sh | 5 +++++ test/rclocal.sh | 1 - 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/test/lib/setup.sh b/test/lib/setup.sh index f8ea668a..85be8756 100755 --- a/test/lib/setup.sh +++ b/test/lib/setup.sh @@ -269,6 +269,7 @@ teardown() say "Final cleanup ..." rm -f "$SYSROOT"/running_test.pid rm -f "$SYSROOT$FINIT_CONF" + rm -f "$SYSROOT/etc/rc.local" say "EXIT: $test_status" exit $test_status @@ -305,6 +306,10 @@ if [ -n "$BOOTSTRAP" ]; then echo "$BOOTSTRAP" >> "$SYSROOT$FINIT_CONF" fi if [ -n "$RCLOCAL" ]; then + while [ -f "$SYSROOT/etc/rc.local" ]; do + echo "$SYSROOT/etc/rc.local busy ... waiting ..." + sleep 1 + done say "Setting up /etc/rc.local ..." echo "$RCLOCAL" > "$SYSROOT/etc/rc.local" chmod +x "$SYSROOT/etc/rc.local" diff --git a/test/rclocal.sh b/test/rclocal.sh index 79993459..eecd386d 100755 --- a/test/rclocal.sh +++ b/test/rclocal.sh @@ -18,7 +18,6 @@ test_setup() test_teardown() { say "Test done $(date)" - run "rm -f $SYSROOT/etc/rc.local" } sleep 1