Added a place for example mac80211_hwsim test cases
authorJouni Malinen <jouni.malinen@atheros.com>
Thu, 28 Aug 2008 15:53:47 +0000 (18:53 +0300)
committerJouni Malinen <j@w1.fi>
Thu, 28 Aug 2008 15:53:47 +0000 (18:53 +0300)
The tests directory and its subdirectories contain a set of configuration
files that can be used to exercise various mac80211, hostapd, and
wpa_supplicant features. The test.txt file in each test directory describes
the particular test and includes the commands needed to run the test.

mac80211_hwsim/tests/0001-wpa2-psk/hostapd.conf [new file with mode: 0644]
mac80211_hwsim/tests/0001-wpa2-psk/test.txt [new file with mode: 0644]
mac80211_hwsim/tests/0001-wpa2-psk/wpa_supplicant.conf [new file with mode: 0644]
mac80211_hwsim/tests/0002-vlan/hostapd.accept [new file with mode: 0644]
mac80211_hwsim/tests/0002-vlan/hostapd.conf [new file with mode: 0644]
mac80211_hwsim/tests/0002-vlan/hostapd.vlan [new file with mode: 0644]
mac80211_hwsim/tests/0002-vlan/test.txt [new file with mode: 0644]

diff --git a/mac80211_hwsim/tests/0001-wpa2-psk/hostapd.conf b/mac80211_hwsim/tests/0001-wpa2-psk/hostapd.conf
new file mode 100644 (file)
index 0000000..08cde7e
--- /dev/null
@@ -0,0 +1,11 @@
+interface=wlan0
+driver=nl80211
+
+hw_mode=g
+channel=1
+ssid=mac80211 test
+
+wpa=2
+wpa_key_mgmt=WPA-PSK
+wpa_pairwise=CCMP
+wpa_passphrase=12345678
diff --git a/mac80211_hwsim/tests/0001-wpa2-psk/test.txt b/mac80211_hwsim/tests/0001-wpa2-psk/test.txt
new file mode 100644 (file)
index 0000000..05d85a0
--- /dev/null
@@ -0,0 +1,7 @@
+# WPA2-Personal (PSK) with CCMP, AP and single client
+
+modprobe mac80211_hwsim
+
+hostapd hostapd.conf
+
+wpa_supplicant -Dwext -iwlan1 -c wpa_supplicant.conf
diff --git a/mac80211_hwsim/tests/0001-wpa2-psk/wpa_supplicant.conf b/mac80211_hwsim/tests/0001-wpa2-psk/wpa_supplicant.conf
new file mode 100644 (file)
index 0000000..299128c
--- /dev/null
@@ -0,0 +1,10 @@
+ctrl_interface=/var/run/wpa_supplicant
+
+network={
+       ssid="mac80211 test"
+       psk="12345678"
+       key_mgmt=WPA-PSK
+       proto=WPA2
+       pairwise=CCMP
+       group=CCMP
+}
diff --git a/mac80211_hwsim/tests/0002-vlan/hostapd.accept b/mac80211_hwsim/tests/0002-vlan/hostapd.accept
new file mode 100644 (file)
index 0000000..e97a175
--- /dev/null
@@ -0,0 +1,2 @@
+02:00:00:00:01:00      1
+02:00:00:00:02:00      2
diff --git a/mac80211_hwsim/tests/0002-vlan/hostapd.conf b/mac80211_hwsim/tests/0002-vlan/hostapd.conf
new file mode 100644 (file)
index 0000000..8698f0e
--- /dev/null
@@ -0,0 +1,12 @@
+interface=wlan0
+driver=nl80211
+
+hw_mode=g
+channel=1
+ssid=mac80211 test
+
+dynamic_vlan=2
+vlan_file=hostapd.vlan
+
+macaddr_acl=0
+accept_mac_file=hostapd.accept
diff --git a/mac80211_hwsim/tests/0002-vlan/hostapd.vlan b/mac80211_hwsim/tests/0002-vlan/hostapd.vlan
new file mode 100644 (file)
index 0000000..b3750b2
--- /dev/null
@@ -0,0 +1 @@
+*      vlan#
diff --git a/mac80211_hwsim/tests/0002-vlan/test.txt b/mac80211_hwsim/tests/0002-vlan/test.txt
new file mode 100644 (file)
index 0000000..8c92f1c
--- /dev/null
@@ -0,0 +1,15 @@
+# Plaintext connection, two clients, different VLANs
+
+modprobe mac80211_hwsim radios=3
+
+hostapd hostapd.conf
+
+ifconfig wlan1 up
+iwconfig wlan1 essid "mac80211 test"
+
+ifconfig wlan2 up
+iwconfig wlan2 essid "mac80211 test"
+
+# Expected results:
+# STA1(wlan1) is bound to vlan1
+# STA2(wlan2) is bound to vlan2