From b3f240bc0e3fbab466cd819f024451189af4fe9c Mon Sep 17 00:00:00 2001 From: Jouni Malinen Date: Thu, 28 Aug 2008 18:53:47 +0300 Subject: [PATCH] Added a place for example mac80211_hwsim test cases 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 | 11 +++++++++++ mac80211_hwsim/tests/0001-wpa2-psk/test.txt | 7 +++++++ .../tests/0001-wpa2-psk/wpa_supplicant.conf | 10 ++++++++++ mac80211_hwsim/tests/0002-vlan/hostapd.accept | 2 ++ mac80211_hwsim/tests/0002-vlan/hostapd.conf | 12 ++++++++++++ mac80211_hwsim/tests/0002-vlan/hostapd.vlan | 1 + mac80211_hwsim/tests/0002-vlan/test.txt | 15 +++++++++++++++ 7 files changed, 58 insertions(+) create mode 100644 mac80211_hwsim/tests/0001-wpa2-psk/hostapd.conf create mode 100644 mac80211_hwsim/tests/0001-wpa2-psk/test.txt create mode 100644 mac80211_hwsim/tests/0001-wpa2-psk/wpa_supplicant.conf create mode 100644 mac80211_hwsim/tests/0002-vlan/hostapd.accept create mode 100644 mac80211_hwsim/tests/0002-vlan/hostapd.conf create mode 100644 mac80211_hwsim/tests/0002-vlan/hostapd.vlan create mode 100644 mac80211_hwsim/tests/0002-vlan/test.txt diff --git a/mac80211_hwsim/tests/0001-wpa2-psk/hostapd.conf b/mac80211_hwsim/tests/0001-wpa2-psk/hostapd.conf new file mode 100644 index 000000000..08cde7e35 --- /dev/null +++ b/mac80211_hwsim/tests/0001-wpa2-psk/hostapd.conf @@ -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 index 000000000..05d85a004 --- /dev/null +++ b/mac80211_hwsim/tests/0001-wpa2-psk/test.txt @@ -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 index 000000000..299128cff --- /dev/null +++ b/mac80211_hwsim/tests/0001-wpa2-psk/wpa_supplicant.conf @@ -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 index 000000000..e97a17519 --- /dev/null +++ b/mac80211_hwsim/tests/0002-vlan/hostapd.accept @@ -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 index 000000000..8698f0ef9 --- /dev/null +++ b/mac80211_hwsim/tests/0002-vlan/hostapd.conf @@ -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 index 000000000..b3750b23f --- /dev/null +++ b/mac80211_hwsim/tests/0002-vlan/hostapd.vlan @@ -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 index 000000000..8c92f1c97 --- /dev/null +++ b/mac80211_hwsim/tests/0002-vlan/test.txt @@ -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