[PATCH 1/2] hwsim tests: silence modprobe warnings

Johannes Berg johannes at sipsolutions.net
Thu Oct 31 03:48:42 EDT 2013


From: Johannes Berg <johannes.berg at intel.com>

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 at intel.com>
---
 tests/hwsim/start.sh     | 2 +-
 tests/hwsim/stop-wifi.sh | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/tests/hwsim/start.sh b/tests/hwsim/start.sh
index 64b089d..8dff6f7 100755
--- a/tests/hwsim/start.sh
+++ b/tests/hwsim/start.sh
@@ -49,7 +49,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
diff --git a/tests/hwsim/stop-wifi.sh b/tests/hwsim/stop-wifi.sh
index eaa9d4e..d578b5b 100755
--- a/tests/hwsim/stop-wifi.sh
+++ b/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
 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
-- 
1.8.4.rc3



More information about the HostAP mailing list