def test_ap_max_num_sta_no_probe_resp(dev, apdev, params):
    'Maximum STA count and limit on Probe Response frames'
    logdir = params['logdir']
    dev[0].flush_scan_cache()
    ssid = 'max'
    params = {}
    params['ssid'] = ssid
    params['beacon_int'] = '2000'
    params['max_num_sta'] = '1'
    params['no_probe_resp_if_max_sta'] = '1'
    hostapd.add_ap(apdev[0], params)
    dev[1].connect(ssid, key_mgmt='NONE', scan_freq='2412')
    dev[0].scan(freq=2412, type='ONLY')
    dev[0].scan(freq=2412, type='ONLY')
    seen = (dev[0].get_bss(apdev[0]['bssid']) != None)
    dev[1].scan(freq=2412, type='ONLY')
    if seen:
        out = run_tshark(os.path.join(logdir, 'hwsim0.pcapng'), 'wlan.fc.type_subtype == 5', ['wlan.da'])
        if out:
            if (dev[0].own_addr() not in out):
                seen = False
            if (dev[1].own_addr() not in out):
                raise Exception('No Probe Response frames to dev[1] seen')
        if seen:
            raise Exception('AP found unexpectedly')
Maximum STA count and limit on Probe Response frames
def test_ap_max_num_sta_no_probe_resp(dev, apdev, params):
    
    logdir = params['logdir']
    dev[0].flush_scan_cache()
    ssid = 'max'
    params = {}
    params['ssid'] = ssid
    params['beacon_int'] = '2000'
    params['max_num_sta'] = '1'
    params['no_probe_resp_if_max_sta'] = '1'
    hostapd.add_ap(apdev[0], params)
    dev[1].connect(ssid, key_mgmt='NONE', scan_freq='2412')
    dev[0].scan(freq=2412, type='ONLY')
    dev[0].scan(freq=2412, type='ONLY')
    seen = (dev[0].get_bss(apdev[0]['bssid']) != None)
    dev[1].scan(freq=2412, type='ONLY')
    if seen:
        out = run_tshark(os.path.join(logdir, 'hwsim0.pcapng'), 'wlan.fc.type_subtype == 5', ['wlan.da'])
        if out:
            if (dev[0].own_addr() not in out):
                seen = False
            if (dev[1].own_addr() not in out):
                raise Exception('No Probe Response frames to dev[1] seen')
        if seen:
            raise Exception('AP found unexpectedly')