• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Python utils.get_ifnames函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: test_grpform3_c

def test_grpform3_c(dev):
    """P2P group formation using PIN and re-init GO Negotiation (group iface)"""
    dev[0].request("SET p2p_no_group_iface 0")
    dev[1].request("SET p2p_no_group_iface 0")
    [i_res, r_res] = go_neg_pin(i_dev=dev[0], i_intent=15, r_dev=dev[1], r_intent=0)
    remove_group(dev[0], dev[1])
    if i_res['ifname'] in utils.get_ifnames():
        raise Exception("Group interface netdev was not removed")
    if r_res['ifname'] in utils.get_ifnames():
        raise Exception("Group interface netdev was not removed")
开发者ID:hschaa,项目名称:hostapd,代码行数:10,代码来源:test_p2p_grpform.py


示例2: test_grpform2_c

def test_grpform2_c(dev):
    """P2P group formation using PIN and authorized connection (resp -> GO) (group iface)"""
    dev[0].request("SET p2p_no_group_iface 0")
    dev[1].request("SET p2p_no_group_iface 0")
    [i_res, r_res] = go_neg_pin_authorized(i_dev=dev[0], i_intent=0, r_dev=dev[1], r_intent=15)
    remove_group(dev[0], dev[1])
    if i_res['ifname'] in utils.get_ifnames():
        raise Exception("Group interface netdev was not removed")
    if r_res['ifname'] in utils.get_ifnames():
        raise Exception("Group interface netdev was not removed")
开发者ID:hschaa,项目名称:hostapd,代码行数:10,代码来源:test_p2p_grpform.py


示例3: test_autogo2

def test_autogo2(dev):
    """P2P autonomous GO with a separate group interface and client joining group"""
    dev[0].request("SET p2p_no_group_iface 0")
    res = autogo(dev[0])
    if "p2p-wlan" not in res['ifname']:
        raise Exception("Unexpected group interface name on GO")
    if res['ifname'] not in utils.get_ifnames():
        raise Exception("Could not find group interface netdev")
    connect_cli(dev[0], dev[1])
    dev[0].remove_group()
    dev[1].wait_go_ending_session()
    if res['ifname'] in utils.get_ifnames():
        raise Exception("Group interface netdev was not removed")
开发者ID:bartve-enovation,项目名称:hostap,代码行数:13,代码来源:test_p2p_autogo.py


示例4: test_autogo3

def test_autogo3(dev):
    """P2P autonomous GO and client with a separate group interface joining group"""
    dev[1].global_request("SET p2p_no_group_iface 0")
    autogo(dev[0], freq=2462)
    res = connect_cli(dev[0], dev[1], social=True, freq=2462)
    if "p2p-wlan" not in res['ifname']:
        raise Exception("Unexpected group interface name on client")
    if res['ifname'] not in utils.get_ifnames():
        raise Exception("Could not find group interface netdev")
    dev[0].remove_group()
    dev[1].wait_go_ending_session()
    dev[1].ping()
    if res['ifname'] in utils.get_ifnames():
        raise Exception("Group interface netdev was not removed")
开发者ID:gxk,项目名称:hostap,代码行数:14,代码来源:test_p2p_autogo.py


示例5: test_grpform_c

def test_grpform_c(dev):
    """P2P group formation using PIN and authorized connection (init -> GO) (group iface)"""
    dev[0].request("SET p2p_no_group_iface 0")
    dev[1].request("SET p2p_no_group_iface 0")
    [i_res, r_res] = go_neg_pin_authorized(i_dev=dev[0], i_intent=15,
                                           r_dev=dev[1], r_intent=0)
    if "p2p-wlan" not in i_res['ifname']:
        raise Exception("Unexpected group interface name")
    if "p2p-wlan" not in r_res['ifname']:
        raise Exception("Unexpected group interface name")
    check_grpform_results(i_res, r_res)
    remove_group(dev[0], dev[1])
    if i_res['ifname'] in utils.get_ifnames():
        raise Exception("Group interface netdev was not removed")
    if r_res['ifname'] in utils.get_ifnames():
        raise Exception("Group interface netdev was not removed")
开发者ID:hschaa,项目名称:hostapd,代码行数:16,代码来源:test_p2p_grpform.py


示例6: test_autogo4

def test_autogo4(dev):
    """P2P autonomous GO and client joining group (both with a separate group interface)"""
    dev[0].request("SET p2p_no_group_iface 0")
    dev[1].request("SET p2p_no_group_iface 0")
    res1 = autogo(dev[0])
    res2 = connect_cli(dev[0], dev[1])
    if "p2p-wlan" not in res1['ifname']:
        raise Exception("Unexpected group interface name on GO")
    if "p2p-wlan" not in res2['ifname']:
        raise Exception("Unexpected group interface name on client")
    ifnames = utils.get_ifnames()
    if res1['ifname'] not in ifnames:
        raise Exception("Could not find GO group interface netdev")
    if res2['ifname'] not in ifnames:
        raise Exception("Could not find client group interface netdev")
    dev[0].remove_group()
    dev[1].wait_go_ending_session()
    dev[1].ping()
    ifnames = utils.get_ifnames()
    if res1['ifname'] in ifnames:
        raise Exception("GO group interface netdev was not removed")
    if res2['ifname'] in ifnames:
        raise Exception("Client group interface netdev was not removed")
开发者ID:bartve-enovation,项目名称:hostap,代码行数:23,代码来源:test_p2p_autogo.py


示例7: test_grpform_b

def test_grpform_b(dev):
    """P2P group formation using PIN and authorized connection (init -> GO) (resp: group iface)"""
    dev[1].global_request("SET p2p_no_group_iface 0")
    [i_res, r_res] = go_neg_pin_authorized(i_dev=dev[0], i_intent=15,
                                           r_dev=dev[1], r_intent=0)
    if "p2p-wlan" not in r_res['ifname']:
        raise Exception("Unexpected group interface name")
    check_grpform_results(i_res, r_res)
    addr = dev[0].group_request("P2P_GROUP_MEMBER " + dev[1].p2p_dev_addr())
    if "FAIL" in addr:
        raise Exception("P2P_GROUP_MEMBER failed")
    if addr != dev[1].p2p_interface_addr():
        raise Exception("Unexpected P2P_GROUP_MEMBER result: " + addr)
    if "FAIL" not in dev[0].group_request("P2P_GROUP_MEMBER a"):
        raise Exception("Invalid P2P_GROUP_MEMBER command accepted")
    if "FAIL" not in dev[0].group_request("P2P_GROUP_MEMBER 00:11:22:33:44:55"):
        raise Exception("P2P_GROUP_MEMBER for non-member accepted")
    remove_group(dev[0], dev[1])
    if r_res['ifname'] in utils.get_ifnames():
        raise Exception("Group interface netdev was not removed")
开发者ID:AstroProfundis,项目名称:hostap,代码行数:20,代码来源:test_p2p_grpform.py


示例8: test_grpform_random_addr

def test_grpform_random_addr(dev):
    """P2P group formation with random interface addresses"""
    dev[0].global_request("SET p2p_no_group_iface 0")
    dev[1].global_request("SET p2p_no_group_iface 0")
    try:
        if "OK" not in dev[0].global_request("SET p2p_interface_random_mac_addr 1"):
            raise Exception("Failed to set p2p_interface_random_mac_addr")
        if "OK" not in dev[1].global_request("SET p2p_interface_random_mac_addr 1"):
            raise Exception("Failed to set p2p_interface_random_mac_addr")
        [i_res, r_res] = go_neg_pin_authorized(i_dev=dev[0], i_intent=15,
                                               r_dev=dev[1], r_intent=0)
        if "p2p-wlan" not in i_res['ifname']:
            raise Exception("Unexpected group interface name")
        check_grpform_results(i_res, r_res)
        hwsim_utils.test_connectivity_p2p(dev[0], dev[1])
        remove_group(dev[0], dev[1])
        if i_res['ifname'] in utils.get_ifnames():
            raise Exception("Group interface netdev was not removed")
    finally:
        dev[0].global_request("SET p2p_interface_random_mac_addr 0")
        dev[1].global_request("SET p2p_interface_random_mac_addr 0")
开发者ID:greearb,项目名称:hostap-ct,代码行数:21,代码来源:test_p2p_grpform.py



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Python utils.get_install_dir函数代码示例发布时间:2022-05-26
下一篇:
Python utils.get_hidden_user_dir_path函数代码示例发布时间:2022-05-26
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap