From: Johannes Berg Date: Sun, 31 May 2020 09:40:32 +0000 (+0200) Subject: tests: Check for mac80211_hwsim module before loading it X-Git-Tag: hostap_2_10~1159 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2f9e2f9044fbb6649eb69defff4fcdf55f4efa71;p=thirdparty%2Fhostap.git tests: Check for mac80211_hwsim module before loading it Instead of checking if the kernel allows modules (via the presence of /proc/modules), check if mac80211_hwsim is already there and load it only if not. This gets rid of some ugly prints from modprobe in case code isn't even a module and cannot be found, etc. Signed-off-by: Johannes Berg --- diff --git a/tests/hwsim/start.sh b/tests/hwsim/start.sh index 7a26d2825..ac43d10af 100755 --- a/tests/hwsim/start.sh +++ b/tests/hwsim/start.sh @@ -110,7 +110,7 @@ else NUM_CH=1 fi -test -f /proc/modules && sudo modprobe mac80211_hwsim radios=7 channels=$NUM_CH support_p2p_device=0 dyndbg=+p +test -d /sys/module/mac80211_hwsim || sudo modprobe mac80211_hwsim radios=7 channels=$NUM_CH support_p2p_device=0 dyndbg=+p sudo ifconfig hwsim0 up sudo $WLANTEST -i hwsim0 -n $LOGDIR/hwsim0.pcapng -c -dtN -L $LOGDIR/hwsim0 &