Browse Source

hwsim tests: Silence modprobe warnings

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>
Johannes Berg 11 years ago
parent
commit
044dd1c267
2 changed files with 2 additions and 2 deletions
  1. 1 1
      tests/hwsim/start.sh
  2. 1 1
      tests/hwsim/stop-wifi.sh

+ 1 - 1
tests/hwsim/start.sh

@@ -48,7 +48,7 @@ else
 fi
 fi
 
 
 $DIR/stop-wifi.sh
 $DIR/stop-wifi.sh
-sudo modprobe mac80211_hwsim radios=5
+test -f /proc/modules && sudo modprobe mac80211_hwsim radios=5
 if [ "$CONCURRENT" = "y" ]; then
 if [ "$CONCURRENT" = "y" ]; then
     sudo iw wlan0 interface add sta0 type station
     sudo iw wlan0 interface add sta0 type station
     sudo iw wlan1 interface add sta1 type station
     sudo iw wlan1 interface add sta1 type station

+ 1 - 1
tests/hwsim/stop-wifi.sh

@@ -67,7 +67,7 @@ for i in /tmp/wpas-wlan0 /tmp/wpas-wlan1 /tmp/wpas-wlan2 /var/run/hostapd-global
     fi
     fi
 done
 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_hwsim 
     sudo rmmod mac80211
     sudo rmmod mac80211
     sudo rmmod cfg80211
     sudo rmmod cfg80211