def test_l3_host_scaling_tc5_5(): pre_test_l3_fwding() vars = st.get_testbed_vars() # Config 2 IPV4 interfaces on DUT. (tg1, _, tg_ph_1, _) = get_handles() dut1 = vars.D1 ipfeature.get_interface_ip_address(dut1, family="ipv4") ipfeature.get_interface_ip_address(dut1, family="ipv6") ipfeature.show_ip_route(dut1) ifapi.interface_status_show(dut1) tg1.tg_traffic_control(action='reset', port_handle=tg_ph_1) tr1 = create_l3_host(tg1, tg_ph_1, 8000, 120) st.wait(15) # Verified ARP and counters at the DUT. total = arpfeature.get_arp_count(dut1) st.log("Total ARP entries: {}".format(total)) if (total): arpfeature.clear_arp_table(vars.D1) st.wait(30) total = arpfeature.get_arp_count(dut1) st.log("Total ARP entries: {}".format(total)) tg1.tg_traffic_control(action='stop', handle=tr1['stream_id']) tg1.tg_traffic_control(action='reset', port_handle=tg_ph_1) post_test_l3_fwding() if (total >= data.max_host_1): st.report_pass("test_case_passed") else: st.report_fail("test_case_failed")
def test_l3_host_scaling_tc5_1(): pre_test_l3_fwding() vars = st.get_testbed_vars() # Config 2 IPV4 interfaces on DUT. (tg1, _, tg_ph_1, _) = get_handles() dut1 = vars.D1 ipfeature.get_interface_ip_address(dut1, family="ipv4") ipfeature.get_interface_ip_address(dut1, family="ipv6") ipfeature.show_ip_route(dut1) ifapi.interface_status_show(dut1) tr1 = create_l3_host(tg1, tg_ph_1, 8000, 5) st.wait(15) # Verified ARP and counters at the DUT. total_in_sw = arpfeature.get_arp_count(dut1) st.log("Total ARP entries: {}".format(total_in_sw)) #We expect all 8k host entries should be programmed in hw within 32secs st.wait(20) output = bcm_show(dut1, 'bcmcmd "l3 l3table show" | wc -l') total_in_hw = parse_route_output(output) tg1.tg_traffic_control(action='stop', handle=tr1['stream_id']) tg1.tg_traffic_control(action='reset', port_handle=tg_ph_1) post_test_l3_fwding() if (total_in_sw >= data.max_host_1 and total_in_hw >= data.max_host_1): st.report_pass("test_case_passed") else: st.report_fail("test_case_failed")
def test_l3_host_scaling_tc5_8(): vars = st.get_testbed_vars() # Config 2 IPV4 interfaces on DUT. (tg1, _, tg_ph_1, _) = get_handles_1() dut1 = vars.D1 ipfeature.get_interface_ip_address(dut1, family="ipv4") ipfeature.get_interface_ip_address(dut1, family="ipv6") ipfeature.show_ip_route(dut1) papi.get_status(dut1) ret = fast_reboot_node(dut1) pre_test_l3_fwding() if (ret): tg1.tg_traffic_control(action='reset',port_handle=tg_ph_1) tr1 = create_l3_host(tg1, tg_ph_1, data.max_host_1, 20) st.wait(15) total = get_arp_count(dut1) st.log("Total ARP entries: {}".format(total)) tg1.tg_traffic_control(action='stop', handle=tr1['stream_id']) tg1.tg_traffic_control(action='reset',port_handle=tg_ph_1) post_test_l3_fwding() if (total >= data.max_host_1): st.report_pass("test_case_passed") else: st.report_fail("test_case_failed") else: post_test_l3_fwding() st.report_fail("test_case_failed")
def test_l3_perf_tc_12_3(): pre_test_l3_fwding() vars = st.get_testbed_vars() # Config 2 IPV4 interfaces on DUT. (tg1, _, tg_ph_1, _) = get_handles() dut1 = vars.D1 ipfeature.get_interface_ip_address(dut1, family="ipv4") ipfeature.get_interface_ip_address(dut1, family="ipv6") ipfeature.show_ip_route(dut1) interface_status_show(dut1) tr1 = create_l3_host(tg1, tg_ph_1, 32000) # Verified ARP and counters at the DUT. cmd = "show arp | grep Total" default_arp = arpapi.get_arp_count(dut1) st.log("Total ARP entries: {}".format(default_arp)) measure_arp_learn_time(dut1, default_arp, 32000, cmd, False) tg1.tg_traffic_control(action='stop', handle=tr1['stream_id'], max_wait_timer=10) tg1.tg_traffic_control(action='reset', port_handle=tg_ph_1) post_test_l3_fwding() st.report_pass("test_case_passed")
def verify_arp_count(dut,expected_count=data.max_host_1,**kwargs): #n = show_arp_count(dut) cli_type = kwargs.pop('cli_type', "") n = arp_api.get_arp_count(dut,None,None,cli_type,**kwargs) if int(n) >= int(expected_count): st.log('PASS - Expected number of ARP entries found in the arp table') return True else: st.log('FAIL - Expected number of ARP entries not found in the arp table.') return False
def test_l3_perf_tc_12_1(): pre_test_l3_fwding() vars = st.get_testbed_vars() # Config 2 IPV4 interfaces on DUT. (tg1, _, tg_ph_1, _) = get_handles() dut1 = vars.D1 port1 = vars.D1T1P1 ipfeature.get_interface_ip_address(dut1, family="ipv4") ipfeature.get_interface_ip_address(dut1, family="ipv6") ipfeature.show_ip_route(dut1) interface_status_show(dut1) tr1 = create_l3_host(tg1, tg_ph_1, 8000) # Verified ARP and counters at the DUT. cmd = "show arp | grep Total" default_arp = arpapi.get_arp_count(dut1) st.log("Total ARP entries: {}".format(default_arp)) measure_arp_learn_time(dut1, default_arp, 8000, cmd, False) #shut the link and make sure all the entries deleted from the hw interface_operation(dut1, port1, operation="shutdown") st.wait(15) cmd = 'bcmcmd "l3 l3table show" | wc -l' output = bcm_show(dut1, cmd) st.log(output) curr_arp = parse_route_output(output) if (curr_arp != default_arp): st.log("cleaning up host entries from HW failed" + str(curr_arp) + str(default_arp)) interface_operation(dut1, port1, operation="startup") #Now measure the hardware performance cmd = 'bcmcmd "l3 l3table show" | wc -l' output = bcm_show(dut1, cmd) st.log(output) default_arp = parse_route_output(output) measure_arp_learn_time(dut1, default_arp, 8000, cmd, True) tg1.tg_traffic_control(action='stop', handle=tr1['stream_id']) tg1.tg_traffic_control(action='reset', port_handle=tg_ph_1) post_test_l3_fwding() st.report_pass("test_case_passed")
def test_l3_host_scaling_tc5_2(): pre_test_l3_fwding() vars = st.get_testbed_vars() (tg1, _, tg_ph_1, _) = get_handles() dut1 = vars.D1 ipfeature.get_interface_ip_address(dut1) cnt = 0 pass_flag = True host_count = 32000 curr_count = 8000 wait_time = 15 duration = 8 #Send burst of 8k upto 32k max create_l3_host(tg1, tg_ph_1, host_count, duration) while (cnt <= 3 and pass_flag): st.wait(wait_time) # Verified ARP and counters at the DUT. total = arpfeature.get_arp_count(dut1) st.log("Total ARP entries: {}".format(total)) bcm_show(dut1, 'bcmcmd "l3 l3table show" | wc -l') if (total >= curr_count): curr_count += 8000 else: pass_flag = False cnt += 1 #Make sure all the entries programmed in the hw st.wait(90) bcm_show(dut1, 'bcmcmd "l3 l3table show" | wc -l') post_test_l3_fwding() if (pass_flag): st.report_pass("test_case_passed") else: st.report_fail("test_case_failed")
def test_l3_host_scaling_tc5_4(): pre_test_l3_fwding() vars = st.get_testbed_vars() data.my_dut_list = st.get_dut_names() dut1 = vars.D1 ipfeature.get_interface_ip_address(dut1, family="ipv4") ipfeature.get_interface_ip_address(dut1, family="ipv6") ipfeature.show_ip_route(dut1) ifapi.interface_status_show(dut1) # L3 traffic streams (tg1, tg2, tg_ph_1, tg_ph_2) = get_handles() tg1.tg_traffic_control(action='reset', port_handle=tg_ph_1) tr1 = create_l3_host(tg1, tg_ph_1, data.max_host_1, 20) st.wait(15) # Verified ARP and counters at the DUT. total = arpfeature.get_arp_count(dut1) st.log("Total ARP entries: {}".format(total)) tg1.tg_traffic_control(action='stop', handle=tr1['stream_id']) tg1.tg_traffic_control(action='reset', port_handle=tg_ph_1) tg1.tg_traffic_control(action='reset', port_handle=tg_ph_1) tg2.tg_traffic_control(action='reset', port_handle=tg_ph_2) res = tg1.tg_interface_config(port_handle=tg_ph_1, mode='config', intf_ip_addr=data.t1d1_ip_addr, gateway=data.d1t1_ip_addr, src_mac_addr='00:0a:01:00:11:01', arp_send_req='1') st.log("INTFCONF: " + str(res)) handle1 = res['handle'] #tg1.tg_test_control(action='sync') res = tg2.tg_interface_config(port_handle=tg_ph_2, mode='config', intf_ip_addr=data.t1d2_ip_addr, gateway=data.d1t2_ip_addr, src_mac_addr='00:0a:01:00:12:01', arp_send_req='1') st.log("INTFCONF: " + str(res)) handle2 = res['handle'] #tg2.tg_test_control(action='sync') tr1 = tg1.tg_traffic_config(port_handle=tg_ph_1, mode='create', transmit_mode='continuous', length_mode='fixed', l3_length=data.tgen_l3_len, rate_pps=data.tgen_rate_pps, emulation_src_handle=handle1, emulation_dst_handle=handle2) tr2 = tg2.tg_traffic_config(port_handle=tg_ph_2, mode='create', transmit_mode='continuous', length_mode='fixed', l3_length=data.tgen_l3_len, rate_pps=data.tgen_rate_pps, emulation_src_handle=handle2, emulation_dst_handle=handle1) tg1.tg_packet_control(port_handle=tg_ph_1, action='start') tg2.tg_packet_control(port_handle=tg_ph_2, action='start') tg1.tg_traffic_control(action='clear_stats', handle=tr1['stream_id']) tg2.tg_traffic_control(action='clear_stats', handle=tr2['stream_id']) papi.clear_interface_counters(dut1) tg1.tg_traffic_control(action='run', handle=tr1['stream_id'], duration=2) tg2.tg_traffic_control(action='run', handle=tr2['stream_id'], duration=2) st.wait(data.traffic_run_time) tg1.tg_traffic_control(action='stop', handle=tr1['stream_id']) tg2.tg_traffic_control(action='stop', handle=tr2['stream_id']) st.wait(5) tg1.tg_packet_control(port_handle=tg_ph_1, action='stop') tg2.tg_packet_control(port_handle=tg_ph_2, action='stop') stats_tg1 = tg1.tg_traffic_stats(port_handle=tg_ph_1, mode='aggregate') total_tg1_tx = stats_tg1[tg_ph_1]['aggregate']['tx']['total_pkts'] total_tg1_rx = stats_tg1[tg_ph_1]['aggregate']['rx']['total_pkts'] stats_tg2 = tg2.tg_traffic_stats(port_handle=tg_ph_2, mode='aggregate') total_tg2_tx = stats_tg2[tg_ph_2]['aggregate']['tx']['total_pkts'] total_tg2_rx = stats_tg2[tg_ph_2]['aggregate']['rx']['total_pkts'] st.log( "Tgen Sent Packets on D1T1P1: {} and Received Packets on D2T1P1: {}". format(total_tg1_tx, total_tg2_rx)) st.log( "Tgen Sent Packets on D2T1P1: {} and Received Packets on D1T1P1: {}". format(total_tg2_tx, total_tg1_rx)) flap_interface(vars.D1T1P1) flap_interface(vars.D1T1P2) #Getting interfaces counter values on DUT DUT_rx_value = ifapi.get_interface_counters(dut1, vars.D1T1P1, "rx_ok") DUT_tx_value = ifapi.get_interface_counters(dut1, vars.D1T1P2, "tx_ok") for i in DUT_rx_value: p1_rcvd = i['rx_ok'] p1_rcvd = p1_rcvd.replace(",", "") for i in DUT_tx_value: p2_txmt = i['tx_ok'] p2_txmt = p2_txmt.replace(",", "") st.log( "rx_ok counter value on DUT Ingress port: {} and tx_ok xounter value on DUT Egress port : {}" .format(p1_rcvd, p2_txmt)) post_test_l3_fwding() if (total >= data.max_host_1): st.report_pass("test_case_passed") else: st.report_fail("test_case_failed")
def test_l3_host_scaling_tc5_3(): pre_test_l3_fwding() vars = st.get_testbed_vars() # Config 2 IPV4 interfaces on DUT. (tg1, tg2, tg_ph_1, tg_ph_2) = get_handles() dut1 = vars.D1 ipfeature.get_interface_ip_address(dut1, family="ipv4") ipfeature.get_interface_ip_address(dut1, family="ipv6") ipfeature.show_ip_route(dut1) ifapi.interface_status_show(dut1) tr1 = create_l3_host(tg1, tg_ph_1, data.max_host_1, 20) st.wait(15) # Verified ARP and counters at the DUT. total = arpfeature.get_arp_count(dut1) st.log("Total ARP entries: {}".format(total)) tg1.tg_traffic_control(action='stop', handle=tr1['stream_id']) tg1.tg_traffic_control(action='reset', port_handle=tg_ph_1) tg1.tg_traffic_control(action='reset', port_handle=tg_ph_1) tg2.tg_traffic_control(action='reset', port_handle=tg_ph_2) res = tg1.tg_interface_config(port_handle=tg_ph_1, mode='config', intf_ip_addr=data.t1d1_ip_addr, gateway=data.d1t1_ip_addr, src_mac_addr='00:0a:01:00:11:01', arp_send_req='1') st.log("INTFCONF: " + str(res)) handle1 = res['handle'] #tg1.tg_test_control(action='sync') res = tg2.tg_interface_config(port_handle=tg_ph_2, mode='config', intf_ip_addr=data.t1d2_ip_addr, gateway=data.d1t2_ip_addr, src_mac_addr='00:0a:01:00:12:01', arp_send_req='1') st.log("INTFCONF: " + str(res)) handle2 = res['handle'] #tg2.tg_test_control(action='sync') tr1 = tg1.tg_traffic_config(port_handle=tg_ph_1, mode='create', transmit_mode='continuous', length_mode='fixed', l3_length=data.tgen_l3_len, rate_pps=data.tgen_rate_pps, emulation_src_handle=handle1, emulation_dst_handle=handle2) tr2 = tg2.tg_traffic_config(port_handle=tg_ph_2, mode='create', transmit_mode='continuous', length_mode='fixed', l3_length=data.tgen_l3_len, rate_pps=data.tgen_rate_pps, emulation_src_handle=handle2, emulation_dst_handle=handle1) tg1.tg_packet_control(port_handle=tg_ph_1, action='start') tg2.tg_packet_control(port_handle=tg_ph_2, action='start') tg1.tg_traffic_control(action='clear_stats', handle=tr1['stream_id']) tg2.tg_traffic_control(action='clear_stats', handle=tr2['stream_id']) papi.clear_interface_counters(dut1) tg1.tg_traffic_control(action='run', handle=tr1['stream_id'], duration=2) tg2.tg_traffic_control(action='run', handle=tr2['stream_id'], duration=2) st.wait(data.traffic_run_time) tg1.tg_traffic_control(action='stop', handle=tr1['stream_id']) tg2.tg_traffic_control(action='stop', handle=tr2['stream_id']) tg1.tg_packet_control(port_handle=tg_ph_1, action='stop') tg2.tg_packet_control(port_handle=tg_ph_2, action='stop') papi.clear_interface_counters(dut1) tg2.tg_traffic_control(action='run', handle=tr1['stream_id']) st.wait(20) retval = check_intf_traffic_counters(dut1) post_test_l3_fwding() if (total >= data.max_host_1 and retval): st.report_pass("test_case_passed") else: st.report_fail("test_case_failed")