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>
@@ -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
@@ -67,7 +67,7 @@ for i in /tmp/wpas-wlan0 /tmp/wpas-wlan1 /tmp/wpas-wlan2 /var/run/hostapd-global
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