本文整理汇总了Python中TestLib.TestLib.netperf_udp方法的典型用法代码示例。如果您正苦于以下问题:Python TestLib.netperf_udp方法的具体用法?Python TestLib.netperf_udp怎么用?Python TestLib.netperf_udp使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TestLib.TestLib
的用法示例。
在下文中一共展示了TestLib.netperf_udp方法的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: do_task
# 需要导入模块: from TestLib import TestLib [as 别名]
# 或者: from TestLib.TestLib import netperf_udp [as 别名]
def do_task(ctl, hosts, ifaces, aliases):
m1, m2, sw = hosts
m1_if1, m1_if2, m2_if1, m2_if2, sw_if1, sw_if2, sw_if3, sw_if4 = ifaces
team_config = '{"runner" : {"name" : "lacp"}}'
m1_lag1 = m1.create_team(slaves=[m1_if1, m1_if2], config=team_config,
ip=test_ip(1,1))
m2_lag1 = m2.create_team(slaves=[m2_if1, m2_if2], config=team_config,
ip=test_ip(2,1))
m1_lag1.add_nhs_route(ipv4(test_ip(2,0)), [ipv4(test_ip(1,2,[]))]);
m2_lag1.add_nhs_route(ipv4(test_ip(1,0)), [ipv4(test_ip(2,2,[]))]);
m1_if1.add_nhs_route(ipv6(test_ip(2,0)), [ipv6(test_ip(1,2,[]))], ipv6=True);
m2_if1.add_nhs_route(ipv6(test_ip(1,0)), [ipv6(test_ip(2,2,[]))], ipv6=True);
sw_lag1 = sw.create_team(slaves=[sw_if1, sw_if2], config=team_config,
ip=test_ip(1,2))
sw_lag2 = sw.create_team(slaves=[sw_if3, sw_if4], config=team_config,
ip=test_ip(2,2))
sleep(30)
tl = TestLib(ctl, aliases)
tl.ping_simple(m1_lag1, m2_lag1)
tl.netperf_tcp(m1_lag1, m2_lag1)
tl.netperf_udp(m1_lag1, m2_lag1)
示例2: do_task
# 需要导入模块: from TestLib import TestLib [as 别名]
# 或者: from TestLib.TestLib import netperf_udp [as 别名]
def do_task(ctl, hosts, ifaces, aliases):
m1, m2, sw = hosts
m1_if1, m1_if2, m2_if1, m2_if2, sw_if1, sw_if2, sw_if3, sw_if4 = ifaces
bond_options = {"mode": "802.3ad", "miimon": "100"}
m1_lag1 = m1.create_bond(slaves=[m1_if1, m1_if2], options=bond_options,
ip=test_ip(1,1))
m2_lag1 = m2.create_bond(slaves=[m2_if1, m2_if2], options=bond_options,
ip=test_ip(2,1))
m1_lag1.add_nhs_route(ipv4(test_ip(2,0)), [ipv4(test_ip(1,2,[]))]);
m2_lag1.add_nhs_route(ipv4(test_ip(1,0)), [ipv4(test_ip(2,2,[]))]);
m1_if1.add_nhs_route(ipv6(test_ip(2,0)), [ipv6(test_ip(1,2,[]))], ipv6=True);
m2_if1.add_nhs_route(ipv6(test_ip(1,0)), [ipv6(test_ip(2,2,[]))], ipv6=True);
sw_lag1 = sw.create_bond(slaves=[sw_if1, sw_if2], options=bond_options,
ip=test_ip(1,2))
sw_lag2 = sw.create_bond(slaves=[sw_if3, sw_if4], options=bond_options,
ip=test_ip(2,2))
sleep(30)
tl = TestLib(ctl, aliases)
tl.ping_simple(m1_lag1, m2_lag1)
tl.netperf_tcp(m1_lag1, m2_lag1)
tl.netperf_udp(m1_lag1, m2_lag1)
示例3: do_task
# 需要导入模块: from TestLib import TestLib [as 别名]
# 或者: from TestLib.TestLib import netperf_udp [as 别名]
def do_task(ctl, hosts, ifaces, aliases):
m1, m2, sw = hosts
m1_if1, m1_if2, m2_if1, m2_if2, sw_if1, sw_if2, sw_if3, sw_if4 = ifaces
team_config = '{"runner" : {"name" : "lacp"}}'
m1_lag1 = m1.create_team(slaves=[m1_if1, m1_if2],
config=team_config,
ip=["192.168.101.10/24", "2002::1/64"])
m2_lag1 = m2.create_team(slaves=[m2_if1, m2_if2],
config=team_config,
ip=["192.168.101.11/24", "2002::2/64"])
sw_lag1 = sw.create_team(slaves=[sw_if1, sw_if2],
config=team_config)
sw_lag2 = sw.create_team(slaves=[sw_if3, sw_if4],
config=team_config)
sw_br = sw.create_bridge(slaves=[sw_lag1, sw_lag2],
options={"vlan_filtering": 1,
"multicast_querier": 1})
sleep(30)
tl = TestLib(ctl, aliases)
tl.ping_simple(m1_lag1, m2_lag1)
tl.netperf_tcp(m1_lag1, m2_lag1)
tl.netperf_udp(m1_lag1, m2_lag1)
sw_lag1.slave_del(sw_if1.get_id())
sw_lag1.slave_del(sw_if2.get_id())
m1_lag1.slave_del(m1_if1.get_id())
# Make sure slowpath is working.
sw_if1.reset(ip=["192.168.102.10/24", "2003::1/64"])
m1_if1.reset(ip=["192.168.102.11/24", "2003::2/64"])
sleep(30)
tl.ping_simple(sw_if1, m1_if1)
# Repopulate the LAGs and make sure fastpath is OK.
sw_if1.set_addresses([]) # LAG port can't have IP address.
sw_lag3 = sw.create_team(slaves=[sw_if1, sw_if2],
config=team_config)
sw_br.slave_add(sw_lag3.get_id())
m1_lag1.slave_add(m1_if1.get_id())
sleep(30)
tl.ping_simple(m1_lag1, m2_lag1)
tl.netperf_tcp(m1_lag1, m2_lag1)
tl.netperf_udp(m1_lag1, m2_lag1)
示例4: do_task
# 需要导入模块: from TestLib import TestLib [as 别名]
# 或者: from TestLib.TestLib import netperf_udp [as 别名]
def do_task(ctl, hosts, ifaces, aliases):
m1, sw = hosts
m1_if1, sw_if1 = ifaces
m1_if1.reset(ip=["192.168.101.10/24", "2002::1/64"])
sw_if1.reset(ip=["192.168.101.11/24", "2002::2/64"])
sleep(15)
tl = TestLib(ctl, aliases)
tl.ping_simple(m1_if1, sw_if1)
tl.netperf_tcp(m1_if1, sw_if1)
tl.netperf_udp(m1_if1, sw_if1)
示例5: do_task
# 需要导入模块: from TestLib import TestLib [as 别名]
# 或者: from TestLib.TestLib import netperf_udp [as 别名]
def do_task(ctl, hosts, ifaces, aliases):
m1, sw = hosts
m1_if1, sw_if1 = ifaces
m1_if1_10 = m1.create_vlan(m1_if1, 10, ip=["192.168.101.10/24",
"2002::1/64"])
sw_if1_10 = sw.create_vlan(sw_if1, 10, ip=["192.168.101.11/24",
"2002::2/64"])
sleep(15)
tl = TestLib(ctl, aliases)
tl.ping_simple(m1_if1_10, sw_if1_10)
tl.netperf_tcp(m1_if1_10, sw_if1_10)
tl.netperf_udp(m1_if1_10, sw_if1_10)
示例6: do_task
# 需要导入模块: from TestLib import TestLib [as 别名]
# 或者: from TestLib.TestLib import netperf_udp [as 别名]
def do_task(ctl, hosts, ifaces, aliases):
m1, m2, sw = hosts
m1_if1, m2_if1, sw_if1, sw_if2 = ifaces
m1_if1.reset(ip=["192.168.101.10/24", "2002::1/64"])
m2_if1.reset(ip=["192.168.101.11/24", "2002::2/64"])
sw.create_bridge(slaves=[sw_if1, sw_if2], options={"vlan_filtering": 1})
sleep(15)
tl = TestLib(ctl, aliases)
tl.ping_simple(m1_if1, m2_if1)
tl.netperf_tcp(m1_if1, m2_if1)
tl.netperf_udp(m1_if1, m2_if1)
示例7: do_task
# 需要导入模块: from TestLib import TestLib [as 别名]
# 或者: from TestLib.TestLib import netperf_udp [as 别名]
def do_task(ctl, hosts, ifaces, aliases):
m1, sw, m2 = hosts
m1_if1, sw_if1, sw_if2, sw_if3, m2_if1, m2_if2, m2_if3, m3_if1 = ifaces
ecmp_sw_ifaces = [sw_if2, sw_if3]
ecmp_m_ifaces = [m2_if1, m2_if2]
m2.config("/proc/sys/net/ipv4/ip_forward", "1")
m2.config("/proc/sys/net/ipv6/conf/all/forwarding", "1")
ecmp_common.create_topology(m1_if1, sw_if1, ecmp_sw_ifaces, ecmp_m_ifaces,
m2_if3, m3_if1)
sleep(30)
tl = TestLib(ctl, aliases)
tl.ping_simple(m1_if1, m3_if1)
tl.netperf_udp(m1_if1, m3_if1)
ecmp_common.test_traffic(tl, m1_if1, m3_if1, sw_if1, ecmp_sw_ifaces)
示例8: do_task
# 需要导入模块: from TestLib import TestLib [as 别名]
# 或者: from TestLib.TestLib import netperf_udp [as 别名]
def do_task(ctl, hosts, ifaces, aliases):
m1, m2, sw = hosts
m1_if1, m1_if2, m2_if1, m2_if2, sw_if1, sw_if2, sw_if3, sw_if4 = ifaces
bond_options = {"mode": "802.3ad", "miimon": "100"}
m1_lag1 = m1.create_bond(slaves=[m1_if1, m1_if2], options=bond_options,
ip=["192.168.101.10/24", "2002::1/64"])
m2_lag1 = m2.create_bond(slaves=[m2_if1, m2_if2], options=bond_options,
ip=["192.168.101.11/24", "2002::2/64"])
sw_lag1 = sw.create_bond(slaves=[sw_if1, sw_if2], options=bond_options)
sw_lag2 = sw.create_bond(slaves=[sw_if3, sw_if4], options=bond_options)
sw.create_bridge(slaves=[sw_lag1, sw_lag2], options={"vlan_filtering": 1})
sleep(15)
tl = TestLib(ctl, aliases)
tl.ping_simple(m1_lag1, m2_lag1)
tl.netperf_tcp(m1_lag1, m2_lag1)
tl.netperf_udp(m1_lag1, m2_lag1)
示例9: do_task
# 需要导入模块: from TestLib import TestLib [as 别名]
# 或者: from TestLib.TestLib import netperf_udp [as 别名]
def do_task(ctl, hosts, ifaces, aliases):
m1, m2, sw = hosts
m1_if1, m2_if1, sw_if1, sw_if2 = ifaces
m1_if1.reset()
m2_if1.reset()
m1_if1_10 = m1.create_vlan(m1_if1, 10, ip=test_ip(1, 1))
m2_if1_10 = m2.create_vlan(m2_if1, 10, ip=test_ip(2, 1))
sw_if1_10 = sw.create_vlan(sw_if1, 10, ip=test_ip(1, 2))
sw_if2_10 = sw.create_vlan(sw_if2, 10, ip=test_ip(2, 2))
m1_if1_10.add_nhs_route(ipv4(test_ip(2, 0)), [ipv4(test_ip(1, 2, []))])
m2_if1_10.add_nhs_route(ipv4(test_ip(1, 0)), [ipv4(test_ip(2, 2, []))])
sleep(30)
tl = TestLib(ctl, aliases)
tl.ping_simple(m1_if1_10, m2_if1_10)
tl.netperf_tcp(m1_if1_10, m2_if1_10)
tl.netperf_udp(m1_if1_10, m2_if1_10)
示例10: do_task
# 需要导入模块: from TestLib import TestLib [as 别名]
# 或者: from TestLib.TestLib import netperf_udp [as 别名]
def do_task(ctl, hosts, ifaces, aliases):
m1, m2, sw = hosts
m1_if1, m2_if1, sw_if1, sw_if2 = ifaces
m1_if1.reset(ip=test_ip(1, 1))
m1_if1_10 = m1.create_vlan(m1_if1, 10, ip=test_ip(2, 1))
m1_if1_20 = m1.create_vlan(m1_if1, 20, ip=test_ip(3, 1))
m2_if1.reset(ip=test_ip(1, 2))
m2_if1_10 = m2.create_vlan(m2_if1, 10, ip=test_ip(2, 2))
m2_if1_20 = m2.create_vlan(m2_if1, 20, ip=test_ip(3, 2))
br_options = {"vlan_filtering": 1, "multicast_snooping": 0}
sw.create_bridge(slaves=[sw_if1, sw_if2], options=br_options)
sw_if1.add_br_vlan(10)
sw_if2.add_br_vlan(10)
sw_if1.add_br_vlan(20)
sw_if2.add_br_vlan(20)
sleep(30)
tl = TestLib(ctl, aliases)
tl.ping_simple(m1_if1, m2_if1)
tl.netperf_tcp(m1_if1, m2_if1)
tl.netperf_udp(m1_if1, m2_if1)
tl.ping_simple(m1_if1_10, m2_if1_10)
tl.netperf_tcp(m1_if1_10, m2_if1_10)
tl.netperf_udp(m1_if1_10, m2_if1_10)
tl.ping_simple(m1_if1_20, m2_if1_20)
tl.netperf_tcp(m1_if1_20, m2_if1_20)
tl.netperf_udp(m1_if1_20, m2_if1_20)
sw_if1.add_br_vlan(500, pvid=True, untagged=True)
sw_if2.add_br_vlan(500, pvid=True, untagged=True)
sleep(1)
tl.ping_simple(m1_if1, m2_if1)
tl.netperf_tcp(m1_if1, m2_if1)
tl.netperf_udp(m1_if1, m2_if1)
示例11: do_task
# 需要导入模块: from TestLib import TestLib [as 别名]
# 或者: from TestLib.TestLib import netperf_udp [as 别名]
def do_task(ctl, hosts, ifaces, aliases):
m1, m2, sw = hosts
m1_if1, m1_if2, m2_if1, m2_if2, sw_if1, sw_if2, sw_if3, sw_if4 = ifaces
bond_options = {"mode": "802.3ad", "miimon": "100"}
m1_lag1 = m1.create_bond(slaves=[m1_if1, m1_if2],
options=bond_options, ip=test_ip(1, 1))
m1_lag1_10 = m1.create_vlan(m1_lag1, 10, ip=test_ip(2, 1))
m1_lag1_20 = m1.create_vlan(m1_lag1, 20, ip=test_ip(3, 1))
m2_lag1 = m2.create_bond(slaves=[m2_if1, m2_if2],
options=bond_options, ip=test_ip(1, 2))
m2_lag1_10 = m2.create_vlan(m2_lag1, 10, ip=test_ip(2, 2))
m2_lag1_21 = m2.create_vlan(m2_lag1, 21, ip=test_ip(3, 2))
sw_lag1 = sw.create_bond(slaves=[sw_if1, sw_if2], options=bond_options)
sw_lag2 = sw.create_bond(slaves=[sw_if3, sw_if4], options=bond_options)
br_options = {"vlan_filtering": 1, "multicast_querier": 1}
sw.create_bridge(slaves=[sw_lag1, sw_lag2], options=br_options)
sw_lag1_10 = sw.create_vlan(sw_lag1, 10)
sw_lag2_10 = sw.create_vlan(sw_lag2, 10)
sw.create_bridge(slaves=[sw_lag1_10, sw_lag2_10],
options={"multicast_querier": 1})
sw_lag1_20 = sw.create_vlan(sw_lag1, 20)
sw_lag2_21 = sw.create_vlan(sw_lag2, 21)
sw.create_bridge(slaves=[sw_lag1_20, sw_lag2_21],
options={"multicast_querier": 1})
sleep(30)
tl = TestLib(ctl, aliases)
tl.ping_simple(m1_lag1, m2_lag1)
tl.netperf_tcp(m1_lag1, m2_lag1)
tl.netperf_udp(m1_lag1, m2_lag1)
tl.ping_simple(m1_lag1_10, m2_lag1_10)
tl.netperf_tcp(m1_lag1_10, m2_lag1_10)
tl.netperf_udp(m1_lag1_10, m2_lag1_10)
tl.ping_simple(m1_lag1_20, m2_lag1_21)
tl.netperf_tcp(m1_lag1_20, m2_lag1_21)
tl.netperf_udp(m1_lag1_20, m2_lag1_21)
示例12: do_task
# 需要导入模块: from TestLib import TestLib [as 别名]
# 或者: from TestLib.TestLib import netperf_udp [as 别名]
def do_task(ctl, hosts, ifaces, aliases):
m1, m2, sw = hosts
m1_if1, m2_if1, sw_if1, sw_if2 = ifaces
m1_if1.reset(ip=test_ip(1, 1))
m1_if1_10 = m1.create_vlan(m1_if1, 10, ip=test_ip(2, 1))
m1_if1_20 = m1.create_vlan(m1_if1, 20, ip=test_ip(3, 1))
m2_if1.reset(ip=test_ip(1, 2))
m2_if1_10 = m2.create_vlan(m2_if1, 10, ip=test_ip(2, 2))
m2_if1_21 = m2.create_vlan(m2_if1, 21, ip=test_ip(3, 2))
br_options = {"vlan_filtering": 1, "multicast_querier": 1}
sw.create_bridge(slaves=[sw_if1, sw_if2], options=br_options)
sw_if1_10 = sw.create_vlan(sw_if1, 10)
sw_if2_10 = sw.create_vlan(sw_if2, 10)
sw.create_bridge(slaves=[sw_if1_10, sw_if2_10],
options={"multicast_querier": 1})
sw_if1_20 = sw.create_vlan(sw_if1, 20)
sw_if2_21 = sw.create_vlan(sw_if2, 21)
sw.create_bridge(slaves=[sw_if1_20, sw_if2_21],
options={"multicast_querier": 1})
sleep(30)
tl = TestLib(ctl, aliases)
tl.ping_simple(m1_if1, m2_if1)
tl.netperf_tcp(m1_if1, m2_if1)
tl.netperf_udp(m1_if1, m2_if1)
tl.ping_simple(m1_if1_10, m2_if1_10)
tl.netperf_tcp(m1_if1_10, m2_if1_10)
tl.netperf_udp(m1_if1_10, m2_if1_10)
tl.ping_simple(m1_if1_20, m2_if1_21)
tl.netperf_tcp(m1_if1_20, m2_if1_21)
tl.netperf_udp(m1_if1_20, m2_if1_21)
示例13: do_task
# 需要导入模块: from TestLib import TestLib [as 别名]
# 或者: from TestLib.TestLib import netperf_udp [as 别名]
def do_task(ctl, hosts, ifaces, aliases):
m1, m2, sw = hosts
m1_if1, m1_if2, m2_if1, m2_if2, sw_if1, sw_if2, sw_if3, sw_if4 = ifaces
team_config = '{"runner" : {"name" : "lacp"}}'
m1_lag1 = m1.create_team(slaves=[m1_if1, m1_if2],
config=team_config, ip=test_ip(1, 1))
m1_lag1_10 = m1.create_vlan(m1_lag1, 10, ip=test_ip(2, 1))
m1_lag1_20 = m1.create_vlan(m1_lag1, 20, ip=test_ip(3, 1))
m2_lag1 = m2.create_team(slaves=[m2_if1, m2_if2],
config=team_config, ip=test_ip(1, 2))
m2_lag1_10 = m2.create_vlan(m2_lag1, 10, ip=test_ip(2, 2))
m2_lag1_21 = m2.create_vlan(m2_lag1, 21, ip=test_ip(3, 2))
sw_lag1 = sw.create_team(slaves=[sw_if1, sw_if2], config=team_config)
sw_lag2 = sw.create_team(slaves=[sw_if3, sw_if4], config=team_config)
br_options = {"vlan_filtering": 1}
sw_br1 = sw.create_bridge(slaves=[sw_lag1, sw_lag2], options=br_options)
sw_lag1_10 = sw.create_vlan(sw_lag1, 10)
sw_lag2_10 = sw.create_vlan(sw_lag2, 10)
sw_br2 = sw.create_bridge(slaves=[sw_lag1_10, sw_lag2_10],
options=br_options)
sw_lag1_20 = sw.create_vlan(sw_lag1, 20)
sw_lag2_21 = sw.create_vlan(sw_lag2, 21)
sw_br3 = sw.create_bridge(slaves=[sw_lag1_20, sw_lag2_21],
options=br_options)
sleep(15)
tl = TestLib(ctl, aliases)
tl.ping_simple(m1_lag1, m2_lag1)
tl.netperf_tcp(m1_lag1, m2_lag1)
tl.netperf_udp(m1_lag1, m2_lag1)
tl.ping_simple(m1_lag1_10, m2_lag1_10)
tl.netperf_tcp(m1_lag1_10, m2_lag1_10)
tl.netperf_udp(m1_lag1_10, m2_lag1_10)
tl.ping_simple(m1_lag1_20, m2_lag1_21)
tl.netperf_tcp(m1_lag1_20, m2_lag1_21)
tl.netperf_udp(m1_lag1_20, m2_lag1_21)
sw_lag1.slave_del(sw_if1.get_id())
sw_lag1.slave_del(sw_if2.get_id())
m1_lag1.slave_del(m1_if1.get_id())
# Make sure slowpath is working.
sw_if1.reset(ip=test_ip(4, 1))
m1_if1.reset(ip=test_ip(4, 2))
sleep(15)
tl.ping_simple(sw_if1, m1_if1)
# Repopulate the LAGs and make sure fastpath is OK.
sw_lag3 = sw.create_team(slaves=[sw_if1, sw_if2],
config=team_config)
sw_br1.slave_add(sw_lag3.get_id())
sw_lag3_10 = sw.create_vlan(sw_lag3, 10)
sw_br2.slave_add(sw_lag3_10.get_id())
sw_lag3_20 = sw.create_vlan(sw_lag3, 20)
sw_br3.slave_add(sw_lag3_20.get_id())
m1_lag1.slave_add(m1_if1.get_id())
sleep(15)
tl.ping_simple(m1_lag1, m2_lag1)
tl.netperf_tcp(m1_lag1, m2_lag1)
tl.netperf_udp(m1_lag1, m2_lag1)
tl.ping_simple(m1_lag1_10, m2_lag1_10)
tl.netperf_tcp(m1_lag1_10, m2_lag1_10)
tl.netperf_udp(m1_lag1_10, m2_lag1_10)
tl.ping_simple(m1_lag1_20, m2_lag1_21)
tl.netperf_tcp(m1_lag1_20, m2_lag1_21)
tl.netperf_udp(m1_lag1_20, m2_lag1_21)