[PATCH 1/1] Fix current log dir symbolic link

Jouni Malinen j
Mon Feb 24 13:20:49 PST 2014


On Mon, Feb 24, 2014 at 11:46:53AM -0400, Eduardo Abinader wrote:
> This patch aims to fix the update of current symbolic link,
> when LOGDIR is already set. The current symbolic link was only
> set, if LOGDIR has not been previously defined. If the user
> had chosen to cancel the running test and run it again, the current
> symbolic link was not being updated.

What do you mean with canceling a running test? For me, that means
stopping and restarting run-tests.py, so I'm not completely sure I
understood what the problem would be since start.sh would not be even
run again in that case..

> diff --git a/tests/hwsim/start.sh b/tests/hwsim/start.sh
> @@ -7,13 +7,11 @@ HAPD=$DIR/../../hostapd/hostapd
> +DATE="$(date +%s)"
>  
>  if [ -z "$LOGDIR" ] ; then
> -    DATE="$(date +%s)"
>      LOGDIR="$DIR/logs/$DATE"
>      mkdir -p $LOGDIR
> -    rm -rf $DIR/logs/current
> -    ln -sf $DATE $DIR/logs/current
>  else
>      if [ -e $LOGDIR/alt-wpa_supplicant/wpa_supplicant/wpa_supplicant ]; then
>  	WPAS=$LOGDIR/alt-wpa_supplicant/wpa_supplicant/wpa_supplicant
> @@ -29,6 +27,9 @@ else
> +rm -rf $DIR/logs/current
> +ln -sf $DATE $DIR/logs/current

This adds an undesired error message for vm-run.sh cases since $DIR/logs
directory is on a read-only file system within the VM. That's one of the
main reasons why the existing code is within that if branch.

-- 
Jouni Malinen                                            PGP id EFC895FA



More information about the Hostap mailing list