当前位置: 首页>>代码示例>>Python>>正文


Python Wlantest.info_bss方法代码示例

本文整理汇总了Python中wlantest.Wlantest.info_bss方法的典型用法代码示例。如果您正苦于以下问题:Python Wlantest.info_bss方法的具体用法?Python Wlantest.info_bss怎么用?Python Wlantest.info_bss使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在wlantest.Wlantest的用法示例。


在下文中一共展示了Wlantest.info_bss方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: check_group_mgmt_cipher

# 需要导入模块: from wlantest import Wlantest [as 别名]
# 或者: from wlantest.Wlantest import info_bss [as 别名]
def check_group_mgmt_cipher(dev, ap, cipher):
    wt = Wlantest()
    wt.flush()
    wt.add_passphrase("12345678")

    if cipher not in dev.get_capability("group_mgmt"):
        raise HwsimSkip("Cipher %s not supported" % cipher)
    params = { "ssid": "test-wpa2-psk-pmf",
               "wpa_passphrase": "12345678",
               "wpa": "2",
               "ieee80211w": "2",
               "wpa_key_mgmt": "WPA-PSK-SHA256",
               "rsn_pairwise": "CCMP",
               "group_mgmt_cipher": cipher }
    hapd = hostapd.add_ap(ap['ifname'], params)
    dev.connect("test-wpa2-psk-pmf", psk="12345678", ieee80211w="2",
                key_mgmt="WPA-PSK-SHA256",
                pairwise="CCMP", group="CCMP", scan_freq="2412")
    hwsim_utils.test_connectivity(dev, hapd)
    hapd.request("DEAUTHENTICATE ff:ff:ff:ff:ff:ff")
    dev.wait_disconnected()
    if wt.get_bss_counter('valid_bip_mmie', ap['bssid']) < 1:
        raise Exception("No valid BIP MMIE seen")
    if wt.get_bss_counter('bip_deauth', ap['bssid']) < 1:
        raise Exception("No valid BIP deauth seen")

    if cipher == "AES-128-CMAC":
        group_mgmt = "BIP"
    else:
        group_mgmt = cipher
    res =  wt.info_bss('group_mgmt', ap['bssid']).strip()
    if res != group_mgmt:
        raise Exception("Unexpected group mgmt cipher: " + res)
开发者ID:Hansenq,项目名称:wifi-goes-to-town,代码行数:35,代码来源:test_ap_ciphers.py


注:本文中的wlantest.Wlantest.info_bss方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。