hwsim tests: Silence modprobe warnings
authorJohannes Berg <johannes.berg@intel.com>
Wed, 30 Oct 2013 22:14:55 +0000 (23:14 +0100)
committerJouni Malinen <j@w1.fi>
Thu, 31 Oct 2013 09:08:16 +0000 (11:08 +0200)
If module loading isn't enabled (e.g., in VM tests) then
don't try to load/unload the modules.

Signed-hostap: Johannes Berg <johannes.berg@intel.com>

tests/hwsim/start.sh
tests/hwsim/stop-wifi.sh

index 1f67002..4b42548 100755 (executable)
@@ -48,7 +48,7 @@ else
 fi
 
 $DIR/stop-wifi.sh
-sudo modprobe mac80211_hwsim radios=5
+test -f /proc/modules && sudo modprobe mac80211_hwsim radios=5
 if [ "$CONCURRENT" = "y" ]; then
     sudo iw wlan0 interface add sta0 type station
     sudo iw wlan1 interface add sta1 type station
index eaa9d4e..d578b5b 100755 (executable)
@@ -67,7 +67,7 @@ for i in /tmp/wpas-wlan0 /tmp/wpas-wlan1 /tmp/wpas-wlan2 /var/run/hostapd-global
     fi
 done
 
-if grep -q mac80211_hwsim /proc/modules ; then
+if grep -q mac80211_hwsim /proc/modules 2>/dev/null ; then
     sudo rmmod mac80211_hwsim 
     sudo rmmod mac80211
     sudo rmmod cfg80211