def do_pings(warmup=False): if warmup: ping_opts = {"count": 1} else: ping_opts = {"count": 10, "interval": 0.2} if ipv in ['ipv4', 'both']: ping((guest1, g1_nic, 0, { "scope": 0 }), (host2, h2_nic, 0, { "scope": 0 }), options=ping_opts, expect="pass") if not skip_tc_verify: verify_tc_rules('ipv4') if ipv in ['ipv6', 'both']: ping6((guest1, g1_nic, 1, { "scope": 0 }), (host2, h2_nic, 1, { "scope": 0 }), options=ping_opts, expect="pass") if not skip_tc_verify: verify_tc_rules('ipv6')
def do_pings(): ping_opts = {"count": 100, "interval": 0.2} if ipv in ['ipv4', 'both']: ping((guest1, g1_nic, 0, {"scope": 0}), (host2, h2_nic, 0, {"scope": 0}), options=ping_opts, expect="pass") verify_tc_rules('ip') if ipv in ['ipv6', 'both']: ping6((guest1, g1_nic, 1, {"scope": 0}), (host2, h2_nic, 1, {"scope": 0}), options=ping_opts, expect="pass") verify_tc_rules('ipv6')
def do_test(): ping_opts = {"count": 200} if ipv in ['ipv4', 'both']: ping_proc = ping((guest1, g1_nic, 0, { "scope": 0 }), (host2, h2_nic, 0, { "scope": 0 }), options=ping_opts, expect="pass", bg=True) ctl.wait(2) turn_off_sriov() ctl.wait(2) ping_proc.intr() verify_tc_rules('ipv4') if ipv in ['ipv6', 'both']: ping_proc = ping6((guest1, g1_nic, 1, { "scope": 0 }), (host2, h2_nic, 1, { "scope": 0 }), options=ping_opts, expect="pass", bg=True) ctl.wait(2) turn_off_sriov() ctl.wait(2) ping_proc.intr() verify_tc_rules('ipv6')
def do_pings(): ping_opts = {"count": 100, "interval": 0.2} if ipv in ['ipv4', 'both']: ping((guest1, g1_nic, 0, { "scope": 0 }), (host2, h2_nic, 0, { "scope": 0 }), options=ping_opts, expect="pass") verify_tc_rules('ip') if ipv in ['ipv6', 'both']: ping6((guest1, g1_nic, 1, { "scope": 0 }), (host2, h2_nic, 1, { "scope": 0 }), options=ping_opts, expect="pass") verify_tc_rules('ipv6')
# this will pin devices irqs to cpu #0 for m, d in dev_list: pin_dev_irqs(m, d, 0) nperf_opts = "" if nperf_cpupin and nperf_num_parallel == 1: nperf_opts = " -T%s,%s" % (nperf_cpupin, nperf_cpupin) ctl.wait(15) ping_opts = {"count": 100, "interval": 0.1} if ipv in [ 'ipv4', 'both' ]: ping((m1, test_if1, 0, {"scope": 0}), (m2, test_if2, 0, {"scope": 0}), options=ping_opts) ctl.wait(2) # prepare PerfRepo result for tcp result_tcp = perf_api.new_result("tcp_ipv4_id", "tcp_ipv4_result", hash_ignore=[ r'kernel_release', r'redhat_release', r'test_if\.hwaddr']) result_tcp.add_tag(product_name) if nperf_num_parallel > 1: result_tcp.add_tag("multithreaded") result_tcp.set_parameter('num_parallel', nperf_num_parallel)
for m, d in [(host1, h1_if), (host2, h2_if)]: pin_dev_irqs(m, d, netdev_cpupin) nperf_opts = "" if nperf_cpupin and nperf_num_parallel == 1: nperf_opts = " -T%s,%s" % (nperf_cpupin, nperf_cpupin) ctl.wait(15) #pings ping_opts = {"count": 100, "interval": 0.1} if ipv in ['ipv4', 'both']: ping((guest1, g1_nic, 0, { "scope": 0 }), (guest2, g2_nic, 0, { "scope": 0 }), options=ping_opts, expect="fail") ping((guest1, g1_nic, 0, { "scope": 0 }), (guest3, g3_nic, 0, { "scope": 0 }), options=ping_opts) ping((guest1, g1_nic, 0, { "scope": 0 }), (guest4, g4_nic, 0, { "scope": 0 }), options=ping_opts,
# this will pin devices irqs to cpu #0 for m, d in [(h1, h1_phy), (h2, h2_phy)]: pin_dev_irqs(m, d, 0) nperf_opts = "" if nperf_cpupin and nperf_num_parallel == 1: nperf_opts = " -T%s,%s" % (nperf_cpupin, nperf_cpupin) ctl.wait(15) #pings ping_opts = {"count": 100, "interval": 0.1} if ipv in [ 'ipv4', 'both' ]: ping((h1, h1_nic, 0, {"scope": 0}), (h2, h2_nic, 0, {"scope": 0}), options=ping_opts) if ipv in [ 'ipv6', 'both' ]: ping6((h1, h1_nic, 1, {"scope": 0}), (h2, h2_nic, 1, {"scope": 0}), options=ping_opts) client_opts = {"duration" : netperf_duration, "testname" : "TCP_STREAM", "confidence" : nperf_confidence, "num_parallel" : nperf_num_parallel, "cpu_util" : nperf_cpu_util, "runs": nperf_max_runs, "netperf_opts": nperf_opts, "debug": nperf_debug,
h1_nic1.set_addresses(["192.168.1.1/24"]) h1_nic2.set_addresses(["192.168.1.3/24"]) h2_nic1.set_addresses(["192.168.1.2/24"]) h2_nic2.set_addresses(["192.168.1.4/24"]) ctl.wait(5) ping_opts = {"count": 100, "interval": 0.1, "limit_rate": 20} pings = [] pings.append( ping((h1, h1_nic1, 0, { "scope": 0 }), (h2, h2_nic1, 0, { "scope": 0 }), options=ping_opts, bg=True)) pings.append( ping((h1, h1_nic2, 0, { "scope": 0 }), (h2, h2_nic2, 0, { "scope": 0 }), options=ping_opts, bg=True)) pings.append( ping((h2, h2_nic1, 0, { "scope": 0
# this will pin devices irqs to cpu #0 for m, d in [(h1, h1_nic), (h2, h2_nic)]: pin_dev_irqs(m, d, 0) nperf_opts = "" if nperf_cpupin and nperf_num_parallel == 1: nperf_opts = " -T%s,%s" % (nperf_cpupin, nperf_cpupin) ctl.wait(15) #pings ping_opts = {"count": 100, "interval": 0.1} if ipv in ['ipv4', 'both']: ping((h1, h1_nic, 0, { "scope": 0 }), (h2, h2_nic, 0, { "scope": 0 }), options=ping_opts) if ipv in ['ipv6', 'both']: ping6((h1, h1_nic, 1, { "scope": 0 }), (h2, h2_nic, 1, { "scope": 0 }), options=ping_opts) #netperfs if ipv in ['ipv4', 'both']: ctl.wait(2)
}), (g1, test_if3, 0, { "scope": 0 })] ipv6_endpoints = [(m1, test_if1, 1, { "scope": 0 }), (m2, test_if2, 1, { "scope": 0 }), (g1, test_if3, 1, { "scope": 0 })] ipv4_pings = [] for x in ipv4_endpoints: for y in ipv4_endpoints: if not x == y: ipv4_pings.append(ping(x, y, options=ping_opts, bg=True)) for i in ipv4_pings: i.wait() ipv6_pings = [] for x in ipv6_endpoints: for y in ipv6_endpoints: if not x == y: ipv6_pings.append(ping6(x, y, options=ping_opts, bg=True)) for i in ipv6_pings: i.wait() client_opts = { "duration": netperf_duration,
pin_dev_irqs(m, d, netdev_cpupin) nperf_opts = "" if nperf_cpupin and nperf_num_parallel == 1: nperf_opts = " -T%s,%s" % (nperf_cpupin, nperf_cpupin) ctl.wait(15) ping_opts = {"count": 100, "interval": 0.1} encryption_settings = ['on', 'off'] #availability check ping((m1, m1_phy, 0, { "scope": 0 }), (m2, m2_phy, 0, { "scope": 0 }), options=ping_opts) ctl.wait(2) client_opts = { "duration": netperf_duration, "testname": "TCP_STREAM", "confidence": nperf_confidence, "num_parallel": nperf_num_parallel, "cpu_util": nperf_cpu_util, "runs": nperf_max_runs, "netperf_opts": nperf_opts, "debug": nperf_debug, "max_deviation": nperf_max_dev
# this will pin devices irqs to cpu #0 for m, d in dev_list: pin_dev_irqs(m, d, 0) nperf_opts = "" if nperf_cpupin and nperf_num_parallel == 1: nperf_opts = " -T%s,%s" % (nperf_cpupin, nperf_cpupin) ctl.wait(15) ping_opts = {"count": 100, "interval": 0.1} if ipv in ['ipv4', 'both']: ping((m1, test_if1, 0, { "scope": 0 }), (m2, test_if2, 0, { "scope": 0 }), options=ping_opts) ctl.wait(2) # prepare PerfRepo result for tcp result_tcp = perf_api.new_result( "tcp_ipv4_id", "tcp_ipv4_result", hash_ignore=[r'kernel_release', r'redhat_release', r'test_if\.hwaddr']) result_tcp.add_tag(product_name) if nperf_num_parallel > 1: result_tcp.add_tag("multithreaded") result_tcp.set_parameter('num_parallel', nperf_num_parallel)
ctl.wait(15) ping_opts = {"count": 100, "interval": 0.1} ipv4_endpoints = [(m1, test_if1, 0, {"scope": 0}), (m2, test_if2, 0, {"scope": 0}), (g1, test_if3, 0, {"scope": 0})] ipv6_endpoints = [(m1, test_if1, 1, {"scope": 0}), (m2, test_if2, 1, {"scope": 0}), (g1, test_if3, 1, {"scope": 0})] ipv4_pings = [] for x in ipv4_endpoints: for y in ipv4_endpoints: if not x == y: ipv4_pings.append(ping(x, y, options=ping_opts, bg=True)) for i in ipv4_pings: i.wait() ipv6_pings = [] for x in ipv6_endpoints: for y in ipv6_endpoints: if not x == y: ipv6_pings.append(ping6(x, y, options=ping_opts, bg=True)) for i in ipv6_pings: i.wait() client_opts = {"duration" : netperf_duration, "testname" : "TCP_STREAM",
# WARMP UP - teach switch about mac addresses #============================================ h1_nic1.set_addresses(["192.168.1.1/24"]) h1_nic2.set_addresses(["192.168.1.3/24"]) h2_nic1.set_addresses(["192.168.1.2/24"]) h2_nic2.set_addresses(["192.168.1.4/24"]) ctl.wait(5) ping_opts = {"count": 100, "interval": 0.1, "limit_rate": 20} pings = [] pings.append(ping((h1, h1_nic1, 0, {"scope": 0}), (h2, h2_nic1, 0, {"scope": 0}), options=ping_opts, bg=True)) pings.append(ping((h1, h1_nic2, 0, {"scope": 0}), (h2, h2_nic2, 0, {"scope": 0}), options=ping_opts, bg=True)) pings.append(ping((h2, h2_nic1, 0, {"scope": 0}), (h1, h1_nic1, 0, {"scope": 0}), options=ping_opts, bg=True)) pings.append(ping((h2, h2_nic2, 0, {"scope": 0}), (h1, h1_nic2, 0, {"scope": 0}), options=ping_opts, bg=True)) for i in pings: i.wait()
#this will pin devices irqs to cpu #0 for m, d in [(host1, h1_if), (host2, h2_if)]: pin_dev_irqs(m, d, 0) nperf_opts = "" if nperf_cpupin and nperf_num_parallel == 1: nperf_opts = " -T%s,%s" % (nperf_cpupin, nperf_cpupin) ctl.wait(15) #pings ping_opts = {"count": 100, "interval": 0.1} if ipv in ['ipv4', 'both']: ping((guest1, g1_nic, 0, {"scope": 0}), (guest2, g2_nic, 0, {"scope": 0}), options=ping_opts, expect="fail") ping((guest1, g1_nic, 0, {"scope": 0}), (guest3, g3_nic, 0, {"scope": 0}), options=ping_opts) ping((guest1, g1_nic, 0, {"scope": 0}), (guest4, g4_nic, 0, {"scope": 0}), options=ping_opts, expect="fail") ping((guest2, g2_nic, 0, {"scope": 0}), (guest3, g3_nic, 0, {"scope": 0}), options=ping_opts, expect="fail") ping((guest2, g2_nic, 0, {"scope": 0}), (guest4, g4_nic, 0, {"scope": 0}), options=ping_opts)
for m, d in dev_list: pin_dev_irqs(m, d, 0) nperf_opts = "" if nperf_cpupin and nperf_num_parallel == 1: nperf_opts = " -T%s,%s" % (nperf_cpupin, nperf_cpupin) ctl.wait(15) ping_opts = {"count": 100, "interval": 0.1} encryption_settings = ['on', 'off'] #availability check ping((m1, m1_phy, 0, {"scope": 0}), (m2, m2_phy, 0, {"scope": 0}), options=ping_opts) ctl.wait(2) for setting in encryption_settings: #macsec setup macsecSetup(setting) m1_tif = m1.get_device(msec_tif_name) m2_tif = m2.get_device(msec_tif_name) if ipv in [ 'ipv4', 'both' ]: ping((m1, m1_tif, 0, {"scope": 0}), (m2, m2_tif, 0, {"scope": 0}), options=ping_opts)