tests: Add QoS Map test case
[mech_eap.git] / tests / hwsim / test_ap_qosmap.py
1 #!/usr/bin/python
2 #
3 # QoS Mapping tests
4 # Copyright (c) 2013, Jouni Malinen <j@w1.fi>
5 #
6 # This software may be distributed under the terms of the BSD license.
7 # See README for more details.
8
9 import time
10 import subprocess
11 import logging
12 logger = logging.getLogger()
13
14 import hwsim_utils
15 import hostapd
16
17 def test_ap_qosmap(dev, apdev):
18     """QoS mapping"""
19     drv_flags = dev[0].get_driver_status_field("capa.flags")
20     if int(drv_flags, 0) & 0x40000000 == 0:
21         return "skip"
22     ssid = "test-qosmap"
23     params = { "ssid": ssid }
24     params['qos_map_set'] = '53,2,22,6,8,15,0,7,255,255,16,31,32,39,255,255,40,47,255,255'
25     hostapd.add_ap(apdev[0]['ifname'], params)
26     dev[0].connect(ssid, key_mgmt="NONE", scan_freq="2412")
27     hwsim_utils.test_connectivity(dev[0].ifname, apdev[0]['ifname'])
28     hapd = hostapd.Hostapd(apdev[0]['ifname'])
29     hapd.request("SET_QOS_MAP_SET 22,6,8,15,0,7,255,255,16,31,32,39,255,255,40,47,255,255")
30     hapd.request("SEND_QOS_MAP_CONF " + dev[0].get_status_field("address"))
31     hwsim_utils.test_connectivity(dev[0].ifname, apdev[0]['ifname'])