Let releng burn test tolerate vanished udev link and wait for its re-appearance

This commit is contained in:
Thomas Schmitt 2011-09-23 13:59:55 +00:00
parent a92aa1f8a0
commit f7be37a1ef
2 changed files with 31 additions and 1 deletions

View File

@ -28,6 +28,33 @@ Overview:
HLP HLP
} }
wait_for_dev () {
# $1 = device address
timeout=30
counter=0
while test "$counter" -lt "$timeout"
do
if test -e "$1"
then
echo
return 0
fi
if test "$counter" = 0
then
echo
echo "Not existing: $dev"
echo "Will wait up to $timeout seconds for it to appear."
echo "Consider to eject and reload it."
fi
counter=$(expr $counter + 1)
echo -n "$counter "
sleep 1
done
echo
return 1
}
getopts_inc=inc/releng_getopts.inc getopts_inc=inc/releng_getopts.inc
if test -e "$getopts_inc" if test -e "$getopts_inc"
then then
@ -132,6 +159,7 @@ fi
# Inspect media # Inspect media
set +e set +e
wait_for_dev "$dev"
res=$(${priv_cmd} "$RELENG_XORRISO" -outdev "$dev" 2>&1) res=$(${priv_cmd} "$RELENG_XORRISO" -outdev "$dev" 2>&1)
ret=$? ret=$?
set -e set -e
@ -172,6 +200,7 @@ fi
# Perform burn run # Perform burn run
echo ${priv_cmd} "$RELENG_XORRISO" -for_backup -outdev "$dev" -blank as_needed -map "$what" /test echo ${priv_cmd} "$RELENG_XORRISO" -for_backup -outdev "$dev" -blank as_needed -map "$what" /test
set +e set +e
wait_for_dev "$dev"
${priv_cmd} "$RELENG_XORRISO" \ ${priv_cmd} "$RELENG_XORRISO" \
-for_backup \ -for_backup \
-outdev "$dev" \ -outdev "$dev" \
@ -205,6 +234,7 @@ fi
echo ${priv_cmd} "$RELENG_XORRISO" -for_backup -indev "$dev" \ echo ${priv_cmd} "$RELENG_XORRISO" -for_backup -indev "$dev" \
-check_media event=FATAL -- \ -check_md5_r FATAL / -- -check_media event=FATAL -- \ -check_md5_r FATAL / --
set +e set +e
wait_for_dev "$dev"
${priv_cmd} "$RELENG_XORRISO" \ ${priv_cmd} "$RELENG_XORRISO" \
-for_backup \ -for_backup \
-indev "$dev" \ -indev "$dev" \

View File

@ -1 +1 @@
#define Xorriso_timestamP "2011.09.23.131734" #define Xorriso_timestamP "2011.09.23.135519"