def test_ap_beacon_rate_legacy2(dev, apdev):
    'Open AP with Beacon frame TX rate 12 Mbps in VHT BSS'
    hapd = hostapd.add_ap(apdev[0], {'ssid': 'beacon-rate'})
    res = hapd.get_driver_status_field('capa.flags')
    if ((int(res, 0) & 8796093022208) == 0):
        raise HwsimSkip('Setting Beacon frame TX rate not supported')
    hapd.disable()
    hapd.set('beacon_rate', '120')
    hapd.set('country_code', 'DE')
    hapd.set('hw_mode', 'a')
    hapd.set('channel', '36')
    hapd.set('ieee80211n', '1')
    hapd.set('ieee80211ac', '1')
    hapd.set('ht_capab', '[HT40+]')
    hapd.set('vht_capab', '')
    hapd.set('vht_oper_chwidth', '0')
    hapd.set('vht_oper_centr_freq_seg0_idx', '0')
    try:
        hapd.enable()
        dev[0].scan_for_bss(hapd.own_addr(), freq='5180')
        dev[0].connect('beacon-rate', key_mgmt='NONE', scan_freq='5180')
        time.sleep(0.5)
    finally:
        dev[0].request('DISCONNECT')
        hapd.request('DISABLE')
        subprocess.call(['iw', 'reg', 'set', '00'])
        dev[0].flush_scan_cache()
Open AP with Beacon frame TX rate 12 Mbps in VHT BSS
def test_ap_beacon_rate_legacy2(dev, apdev):
    
    hapd = hostapd.add_ap(apdev[0], {'ssid': 'beacon-rate'})
    res = hapd.get_driver_status_field('capa.flags')
    if ((int(res, 0) & 8796093022208) == 0):
        raise HwsimSkip('Setting Beacon frame TX rate not supported')
    hapd.disable()
    hapd.set('beacon_rate', '120')
    hapd.set('country_code', 'DE')
    hapd.set('hw_mode', 'a')
    hapd.set('channel', '36')
    hapd.set('ieee80211n', '1')
    hapd.set('ieee80211ac', '1')
    hapd.set('ht_capab', '[HT40+]')
    hapd.set('vht_capab', )
    hapd.set('vht_oper_chwidth', '0')
    hapd.set('vht_oper_centr_freq_seg0_idx', '0')
    try:
        hapd.enable()
        dev[0].scan_for_bss(hapd.own_addr(), freq='5180')
        dev[0].connect('beacon-rate', key_mgmt='NONE', scan_freq='5180')
        time.sleep(0.5)
    finally:
        dev[0].request('DISCONNECT')
        hapd.request('DISABLE')
        subprocess.call(['iw', 'reg', 'set', '00'])
        dev[0].flush_scan_cache()