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


Python test_p2p_autogo.autogo函数代码示例

本文整理汇总了Python中test_p2p_autogo.autogo函数的典型用法代码示例。如果您正苦于以下问题:Python autogo函数的具体用法?Python autogo怎么用?Python autogo使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


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

示例1: test_p2p_go_move_active

def test_p2p_go_move_active(dev, apdev, params):
    """P2P GO stays in freq although SCM is possible [long]"""
    if dev[0].get_mcc() <= 1:
        raise HwsimSkip("Skip due to MCC not being enabled")

    if not params['long']:
        raise HwsimSkip("Skip test case with long duration due to --long not specified")

    dev[0].request("SET p2p_no_group_iface 0")
    try:
        dev[0].global_request("P2P_SET disallow_freq 2430-6000")
        hapd = hostapd.add_ap(apdev[0]['ifname'], { "ssid" : 'ap-test',
                                                    "channel" : '11' })
        dev[0].connect("ap-test", key_mgmt="NONE",
                       scan_freq="2462")

        res = autogo(dev[0])
        freq = int(res['freq'])
        if freq > 2430:
            raise Exception("Unexpected channel %d MHz" % freq)

        # GO move is not allowed while waiting for initial client connection
        time.sleep(20)
        dev[0].global_request("P2P_SET disallow_freq ")

        ev = dev[0].wait_group_event(["P2P-REMOVE-AND-REFORM-GROUP"],
                                     timeout=10)
        if ev is not None:
            raise Exception("Unexpected P2P-REMOVE-AND-REFORM-GROUP seen")

        dev[0].remove_group()
    finally:
        dev[0].global_request("P2P_SET disallow_freq ")
开发者ID:cococorp,项目名称:hostap,代码行数:33,代码来源:test_p2p_channel.py

示例2: test_p2p_go_move_reg_change

def test_p2p_go_move_reg_change(dev, apdev, params):
    """P2P GO move due to regulatory change [long]"""
    if not params['long']:
        raise HwsimSkip("Skip test case with long duration due to --long not specified")

    try:
        set_country("US")
        dev[0].global_request("P2P_SET disallow_freq 2400-5000")
        res = autogo(dev[0])
        freq1 = int(res['freq'])
        if freq1 < 5000:
            raise Exception("Unexpected channel %d MHz" % freq1)

        dev[0].global_request("P2P_SET disallow_freq ")

        # GO move is not allowed while waiting for initial client connection
        time.sleep(20)
        set_country("00")
        ev = dev[0].wait_group_event(["P2P-REMOVE-AND-REFORM-GROUP"],
                                     timeout=10)
        if ev is None:
            raise Exception("P2P-REMOVE-AND-REFORM-GROUP not seen")

        freq2 = dev[0].get_group_status_field('freq')
        if freq1 == freq2:
            raise Exception("Unexpected freq after group reform=" + freq2)

        dev[0].remove_group()
    finally:
        dev[0].global_request("P2P_SET disallow_freq ")
        set_country("00")
开发者ID:cococorp,项目名称:hostap,代码行数:31,代码来源:test_p2p_channel.py

示例3: test_p2p_go_move_scm_multi

def test_p2p_go_move_scm_multi(dev, apdev, params):
    """P2P GO move due to SCM operation preference multiple times [long]"""
    if dev[0].get_mcc() <= 1:
        raise HwsimSkip("Skip due to MCC not being enabled")

    if not params['long']:
        raise HwsimSkip("Skip test case with long duration due to --long not specified")

    dev[0].request("SET p2p_no_group_iface 0")
    try:
        dev[0].global_request("P2P_SET disallow_freq 2430-6000")
        hapd = hostapd.add_ap(apdev[0]['ifname'], { "ssid" : 'ap-test-1',
                                                    "channel" : '11' })
        dev[0].connect("ap-test-1", key_mgmt="NONE",
                       scan_freq="2462")

        dev[0].global_request("SET p2p_go_freq_change_policy 0")
        res = autogo(dev[0])
        freq = int(res['freq'])
        if freq > 2430:
            raise Exception("Unexpected channel %d MHz" % freq)

        # GO move is not allowed while waiting for initial client connection
        time.sleep(20)
        dev[0].global_request("P2P_SET disallow_freq ")

        ev = dev[0].wait_group_event(["P2P-REMOVE-AND-REFORM-GROUP",
                                      "AP-CSA-FINISHED"], timeout=3)
        if ev is None:
            raise Exception("P2P-REMOVE-AND-REFORM-GROUP or AP-CSA-FINISHED not seen")

        freq = dev[0].get_group_status_field('freq')
        if freq != '2462':
            raise Exception("Unexpected freq after group reform=" + freq)

        hapd = hostapd.add_ap(apdev[0]['ifname'], { "ssid" : 'ap-test-2',
                                                    "channel" : '6' })
        dev[0].connect("ap-test-2", key_mgmt="NONE",
                       scan_freq="2437")

        ev = dev[0].wait_group_event(["P2P-REMOVE-AND-REFORM-GROUP",
                                      "AP-CSA-FINISHED"], timeout=5)
        if ev is None:
            raise Exception("(2) P2P-REMOVE-AND-REFORM-GROUP or AP-CSA-FINISHED not seen")

        freq = dev[0].get_group_status_field('freq')
        if freq != '2437':
            raise Exception("(2) Unexpected freq after group reform=" + freq)

        dev[0].remove_group()
    finally:
        dev[0].global_request("P2P_SET disallow_freq ")
        dev[0].global_request("SET p2p_go_freq_change_policy 2")
开发者ID:PavanKulk,项目名称:codebase,代码行数:53,代码来源:test_p2p_channel.py

示例4: test_p2p_channel_5ghz_only

def test_p2p_channel_5ghz_only(dev):
    """P2P GO start with only 5 GHz band allowed"""
    try:
        set_country("US", dev[0])
        dev[0].request("P2P_SET disallow_freq 2400-2500")
        res = autogo(dev[0])
        freq = int(res['freq'])
        if freq < 5000:
            raise Exception("Unexpected channel %d MHz" % freq)
        dev[0].remove_group()
    finally:
        set_country("00")
        dev[0].request("P2P_SET disallow_freq ")
开发者ID:Hansenq,项目名称:wifi-goes-to-town,代码行数:13,代码来源:test_p2p_channel.py

示例5: test_p2p_autogo_pref_chan_disallowed

def test_p2p_autogo_pref_chan_disallowed(dev, apdev):
    """P2P channel selection: GO preferred channels are disallowed"""
    try:
       dev[0].request("SET p2p_pref_chan 81:1,81:3,81:6,81:9,81:11")
       dev[0].request("P2P_SET disallow_freq 2412,2422,2437,2452,2462")
       for i in range(0, 5):
           res = autogo(dev[0])
           if res['freq'] in [ "2412", "2422", "2437", "2452", "2462" ]:
               raise Exception("GO channel is disallowed")
           dev[0].remove_group(res['ifname'])
    finally:
       dev[0].request("P2P_SET disallow_freq ")
       dev[0].request("SET p2p_pref_chan ")
开发者ID:Hansenq,项目名称:wifi-goes-to-town,代码行数:13,代码来源:test_p2p_channel.py

示例6: test_p2p_autogo_pref_chan_not_in_regulatory

def test_p2p_autogo_pref_chan_not_in_regulatory(dev, apdev):
    """P2P channel selection: GO preferred channel not allowed in the regulatory rules"""
    try:
        set_country("US", dev[0])
        dev[0].request("SET p2p_pref_chan 124:149")
        res = autogo(dev[0], persistent=True)
        if res['freq'] != "5745":
            raise Exception("Unexpected channel selected: " + res['freq'])
        dev[0].remove_group(res['ifname'])

        netw = dev[0].list_networks()
        if len(netw) != 1:
            raise Exception("Unexpected number of network blocks: " + str(netw))
        id = netw[0]['id']

        set_country("DE", dev[0])
        res = autogo(dev[0], persistent=id)
        if res['freq'] == "5745":
            raise Exception("Unexpected channel selected(2): " + res['freq'])
        dev[0].remove_group(res['ifname'])
    finally:
        dev[0].request("SET p2p_pref_chan ")
        set_country("00")
开发者ID:Hansenq,项目名称:wifi-goes-to-town,代码行数:23,代码来源:test_p2p_channel.py

示例7: test_autogo_random_channel

def test_autogo_random_channel(dev, apdev):
    """P2P channel selection: GO instantiated on random channel 1, 6, 11"""
    freqs = []
    go_freqs = ["2412", "2437", "2462"]
    for i in range(0, 20):
        result = autogo(dev[0])
        if result['freq'] not in go_freqs:
           raise Exception("Unexpected frequency selected: " + result['freq'])
        if result['freq'] not in freqs:
            freqs.append(result['freq'])
        if len(freqs) == 3:
            break
        dev[0].remove_group(result['ifname'])
    if i == 20:
       raise Exception("GO created 20 times and not all social channels were selected. freqs not selected: " + str(list(set(go_freqs) - set(freqs))))
开发者ID:Hansenq,项目名称:wifi-goes-to-town,代码行数:15,代码来源:test_p2p_channel.py

示例8: test_go_pref_chan_bss_on_diff_chan

def test_go_pref_chan_bss_on_diff_chan(dev, apdev):
    """P2P channel selection: Station on different channel than GO configured pref channel"""

    dev[0].request("SET p2p_no_group_iface 0")

    try:
        hapd = hostapd.add_ap(apdev[0]['ifname'], { "ssid": 'bss-2.4ghz',
                                                    "channel": '1' })
        dev[0].request("SET p2p_pref_chan 81:2")
        dev[0].connect("bss-2.4ghz", key_mgmt="NONE", scan_freq="2412")
        res = autogo(dev[0])
        if res['freq'] != "2412":
           raise Exception("GO channel did not follow BSS")
        hwsim_utils.test_connectivity(dev[0], hapd)
    finally:
        dev[0].request("SET p2p_pref_chan ")
开发者ID:Hansenq,项目名称:wifi-goes-to-town,代码行数:16,代码来源:test_p2p_channel.py

示例9: test_autogo_force_diff_channel

def test_autogo_force_diff_channel(dev, apdev):
    """P2P autonomous GO and station interface operate on different channels"""
    if dev[0].get_mcc() < 2:
        logger.info("Skiping test because the driver doesn't support MCC")
        return "skip"

    dev[0].request("SET p2p_no_group_iface 0")

    hostapd.add_ap(apdev[0]['ifname'], {"ssid" : 'ap-test', "channel" : '1'})
    dev[0].connect("ap-test", key_mgmt = "NONE", scan_freq = "2412")
    channels = { 2 : 2417, 5 : 2432, 9 : 2452 }
    for key in channels:
        res_go = autogo(dev[0], channels[key])
        hwsim_utils.test_connectivity(dev[0].ifname, apdev[0]['ifname'])
        if int(res_go['freq']) == 2412:
            raise Exception("Group operation channel is: 2412 excepted: " + res_go['freq'])
        dev[0].remove_group(res_go['ifname'])
开发者ID:ivkos,项目名称:hostap-force-ht40,代码行数:17,代码来源:test_p2p_channel.py

示例10: test_autogo_following_bss

def test_autogo_following_bss(dev, apdev):
    """P2P autonomous GO operate on the same channel as station interface"""
    if dev[0].get_mcc() > 1:
        logger.info("test mode: MCC")

    dev[0].request("SET p2p_no_group_iface 0")

    channels = { 3 : "2422", 5 : "2432", 9 : "2452" }
    for key in channels:
        hapd = hostapd.add_ap(apdev[0]['ifname'], { "ssid" : 'ap-test',
                                                    "channel" : str(key) })
        dev[0].connect("ap-test", key_mgmt="NONE",
                       scan_freq=str(channels[key]))
        res_go = autogo(dev[0])
        if res_go['freq'] != channels[key]:
            raise Exception("Group operation channel is not the same as on connected station interface")
        hwsim_utils.test_connectivity(dev[0], hapd)
        dev[0].remove_group(res_go['ifname'])
开发者ID:Hansenq,项目名称:wifi-goes-to-town,代码行数:18,代码来源:test_p2p_channel.py

示例11: test_autogo_with_bss_on_disallowed_chan

def test_autogo_with_bss_on_disallowed_chan(dev, apdev):
    """P2P channel selection: Autonomous GO with BSS on a disallowed channel"""

    dev[0].request("SET p2p_no_group_iface 0")

    if dev[0].get_mcc() < 2:
       logger.info("Skipping test because driver does not support MCC")
       return "skip"
    try:
        hapd = hostapd.add_ap(apdev[0]['ifname'], { "ssid": 'bss-2.4ghz',
                                                    "channel": '1' })
        dev[0].request("P2P_SET disallow_freq 2412")
        dev[0].connect("bss-2.4ghz", key_mgmt="NONE", scan_freq="2412")
        res = autogo(dev[0])
        if res['freq'] == "2412":
           raise Exception("GO set on a disallowed channel")
        hwsim_utils.test_connectivity(dev[0], hapd)
    finally:
        dev[0].request("P2P_SET disallow_freq ")
开发者ID:aelarabawy,项目名称:hostap,代码行数:19,代码来源:test_p2p_channel.py

示例12: test_autogo_force_diff_channel

def test_autogo_force_diff_channel(dev, apdev):
    """P2P autonomous GO and station interface operate on different channels"""
    with HWSimRadio(n_channels=2) as (radio, iface):
        wpas = WpaSupplicant(global_iface='/tmp/wpas-wlan5')
        wpas.interface_add(iface)

        if wpas.get_mcc() < 2:
           raise Exception("New radio does not support MCC")

        wpas.request("SET p2p_no_group_iface 0")

        hapd = hostapd.add_ap(apdev[0]['ifname'],
                              {"ssid" : 'ap-test', "channel" : '1'})
        wpas.connect("ap-test", key_mgmt = "NONE", scan_freq = "2412")
        channels = { 2 : 2417, 5 : 2432, 9 : 2452 }
        for key in channels:
            res_go = autogo(wpas, channels[key])
            hwsim_utils.test_connectivity(wpas, hapd)
            if int(res_go['freq']) == 2412:
                raise Exception("Group operation channel is: 2412 excepted: " + res_go['freq'])
            wpas.remove_group(res_go['ifname'])
开发者ID:Hansenq,项目名称:wifi-goes-to-town,代码行数:21,代码来源:test_p2p_channel.py

示例13: test_go_pref_chan_bss_on_disallowed_chan

def test_go_pref_chan_bss_on_disallowed_chan(dev, apdev):
    """P2P channel selection: Station interface on different channel than GO configured pref channel, and station channel is disallowed"""
    if dev[0].get_mcc() < 2:
       logger.info("Skipping test because driver does not support MCC")
       return "skip"

    dev[0].request("SET p2p_no_group_iface 0")

    try:
        hapd = hostapd.add_ap(apdev[0]['ifname'], { "ssid": 'bss-2.4ghz',
                                                    "channel": '1' })
        dev[0].request("P2P_SET disallow_freq 2412")
        dev[0].request("SET p2p_pref_chan 81:2")
        dev[0].connect("bss-2.4ghz", key_mgmt="NONE", scan_freq="2412")
        res2 = autogo(dev[0])
        if res2['freq'] != "2417":
           raise Exception("GO channel did not follow pref_chan configuration")
        hwsim_utils.test_connectivity(dev[0], hapd)
    finally:
        dev[0].request("P2P_SET disallow_freq ")
        dev[0].request("SET p2p_pref_chan ")
开发者ID:aelarabawy,项目名称:hostap,代码行数:21,代码来源:test_p2p_channel.py

示例14: test_autogo_with_bss_on_disallowed_chan

def test_autogo_with_bss_on_disallowed_chan(dev, apdev):
    """P2P channel selection: Autonomous GO with BSS on a disallowed channel"""

    with HWSimRadio(n_channels=2) as (radio, iface):
        wpas = WpaSupplicant(global_iface='/tmp/wpas-wlan5')
        wpas.interface_add(iface)

        wpas.request("SET p2p_no_group_iface 0")

        if wpas.get_mcc() < 2:
           raise Exception("New radio does not support MCC")

        try:
            hapd = hostapd.add_ap(apdev[0]['ifname'], { "ssid": 'bss-2.4ghz',
                                                        "channel": '1' })
            wpas.request("P2P_SET disallow_freq 2412")
            wpas.connect("bss-2.4ghz", key_mgmt="NONE", scan_freq="2412")
            res = autogo(wpas)
            if res['freq'] == "2412":
               raise Exception("GO set on a disallowed channel")
            hwsim_utils.test_connectivity(wpas, hapd)
        finally:
            wpas.request("P2P_SET disallow_freq ")
开发者ID:Hansenq,项目名称:wifi-goes-to-town,代码行数:23,代码来源:test_p2p_channel.py

示例15: test_go_pref_chan_bss_on_disallowed_chan

def test_go_pref_chan_bss_on_disallowed_chan(dev, apdev):
    """P2P channel selection: Station interface on different channel than GO configured pref channel, and station channel is disallowed"""
    with HWSimRadio(n_channels=2) as (radio, iface):
        wpas = WpaSupplicant(global_iface='/tmp/wpas-wlan5')
        wpas.interface_add(iface)

        if wpas.get_mcc() < 2:
           raise Exception("New radio does not support MCC")

        wpas.request("SET p2p_no_group_iface 0")

        try:
            hapd = hostapd.add_ap(apdev[0]['ifname'], { "ssid": 'bss-2.4ghz',
                                                        "channel": '1' })
            wpas.request("P2P_SET disallow_freq 2412")
            wpas.request("SET p2p_pref_chan 81:2")
            wpas.connect("bss-2.4ghz", key_mgmt="NONE", scan_freq="2412")
            res2 = autogo(wpas)
            if res2['freq'] != "2417":
               raise Exception("GO channel did not follow pref_chan configuration")
            hwsim_utils.test_connectivity(wpas, hapd)
        finally:
            wpas.request("P2P_SET disallow_freq ")
            wpas.request("SET p2p_pref_chan ")
开发者ID:Hansenq,项目名称:wifi-goes-to-town,代码行数:24,代码来源:test_p2p_channel.py


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