test: when rc.local is busy, delay test until it's free

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
This commit is contained in:
Joachim Wiberg committed 2023-09-10 14:03:43 +02:00
1 parent 443700a88e
commit 3d74e93fa2
2 files changed
+5 -1

No files matched your search

+5
View File
@@ -269,6 +269,7 @@ teardown()
say "Final cleanup ..." say "Final cleanup ..."
rm -f "$SYSROOT"/running_test.pid rm -f "$SYSROOT"/running_test.pid
rm -f "$SYSROOT$FINIT_CONF" rm -f "$SYSROOT$FINIT_CONF"
rm -f "$SYSROOT/etc/rc.local"
say "EXIT: $test_status" say "EXIT: $test_status"
exit $test_status exit $test_status
@@ -305,6 +306,10 @@ if [ -n "$BOOTSTRAP" ]; then
echo "$BOOTSTRAP" >> "$SYSROOT$FINIT_CONF" echo "$BOOTSTRAP" >> "$SYSROOT$FINIT_CONF"
fi fi
if [ -n "$RCLOCAL" ]; then 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 ..." say "Setting up /etc/rc.local ..."
echo "$RCLOCAL" > "$SYSROOT/etc/rc.local" echo "$RCLOCAL" > "$SYSROOT/etc/rc.local"
chmod +x "$SYSROOT/etc/rc.local" chmod +x "$SYSROOT/etc/rc.local"
-1
View File
@@ -18,7 +18,6 @@ test_setup()
test_teardown() test_teardown()
{ {
say "Test done $(date)" say "Test done $(date)"
run "rm -f $SYSROOT/etc/rc.local"
} }
sleep 1 sleep 1