Ejemplo n.º 1
0
def test_hash(add_default_route_to_dut, duthosts, fib_info_files_per_function, setup_vlan, hash_keys, ptfhost, ipver,
              toggle_all_simulator_ports_to_rand_selected_tor_m,
              tbinfo, mux_server_url, router_macs,
              ignore_ttl, single_fib_for_duts):

    if 'dualtor' in tbinfo['topo']['name']:
        wait(30, 'Wait some time for mux active/standby state to be stable after toggled mux state')

    timestamp = datetime.now().strftime('%Y-%m-%d-%H:%M:%S')
    log_file = "/tmp/hash_test.HashTest.{}.{}.log".format(ipver, timestamp)
    logging.info("PTF log file: %s" % log_file)
    if ipver == "ipv4":
        src_ip_range = SRC_IP_RANGE
        dst_ip_range = DST_IP_RANGE
    else:
        src_ip_range = SRC_IPV6_RANGE
        dst_ip_range = DST_IPV6_RANGE
    ptf_runner(ptfhost,
            "ptftests",
            "hash_test.HashTest",
            platform_dir="ptftests",
            params={"fib_info_files": fib_info_files_per_function[:3],   # Test at most 3 DUTs
                    "ptf_test_port_map": ptf_test_port_map(ptfhost, tbinfo, duthosts, mux_server_url),
                    "hash_keys": hash_keys,
                    "src_ip_range": ",".join(src_ip_range),
                    "dst_ip_range": ",".join(dst_ip_range),
                    "router_macs": router_macs,
                    "vlan_ids": VLANIDS,
                    "ignore_ttl":ignore_ttl,
                    "single_fib_for_duts": single_fib_for_duts
                   },
            log_file=log_file,
            qlen=PTF_QLEN,
            socket_recv_size=16384)
Ejemplo n.º 2
0
def test_decap(tbinfo, duthosts, mux_server_url, setup_teardown, ptfhost, set_mux_random):

    setup_info = setup_teardown

    if 'dualtor' in tbinfo['topo']['name']:
        wait(30, 'Wait some time for mux active/standby state to be stable after toggled mux state')

    log_file = "/tmp/decap.{}.log".format(datetime.now().strftime('%Y-%m-%d-%H:%M:%S'))
    ptf_runner(ptfhost,
               "ptftests",
               "IP_decap_test.DecapPacketTest",
                platform_dir="ptftests",
                params={"outer_ipv4": setup_info["outer_ipv4"],
                        "outer_ipv6": setup_info["outer_ipv6"],
                        "inner_ipv4": setup_info["inner_ipv4"],
                        "inner_ipv6": setup_info["inner_ipv6"],
                        "lo_ips": setup_info["lo_ips"],
                        "lo_ipv6s": setup_info["lo_ipv6s"],
                        "router_macs": setup_info["router_macs"],
                        "dscp_mode": setup_info["dscp_mode"],
                        "ttl_mode": setup_info["ttl_mode"],
                        "ignore_ttl": setup_info["ignore_ttl"],
                        "max_internal_hops": setup_info["max_internal_hops"],
                        "fib_info_files": setup_info["fib_info_files"],
                        "ptf_test_port_map": ptf_test_port_map(ptfhost, tbinfo, duthosts, mux_server_url)
                        },
                qlen=PTFRUNNER_QLEN,
                log_file=log_file)
Ejemplo n.º 3
0
def test_basic_fib(duthosts, ptfhost, ipv4, ipv6, mtu,
                   toggle_all_simulator_ports_to_random_side,
                   fib_info_files_per_function, tbinfo, mux_server_url,
                   router_macs, ignore_ttl, single_fib_for_duts):

    if 'dualtor' in tbinfo['topo']['name']:
        wait(
            30,
            'Wait some time for mux active/standby state to be stable after toggled mux state'
        )

    timestamp = datetime.now().strftime('%Y-%m-%d-%H:%M:%S')

    # do not test load balancing for vs platform as kernel 4.9
    # can only do load balance base on L3
    if duthosts[0].facts['asic_type'] in ["vs"]:
        test_balancing = False
    else:
        test_balancing = True

    logging.info("run ptf test")
    log_file = "/tmp/fib_test.FibTest.ipv4.{}.ipv6.{}.{}.log".format(
        ipv4, ipv6, timestamp)
    logging.info("PTF log file: %s" % log_file)
    ptf_runner(
        ptfhost,
        "ptftests",
        "fib_test.FibTest",
        platform_dir="ptftests",
        params={
            "fib_info_files":
            fib_info_files_per_function[:3],  # Test at most 3 DUTs
            "ptf_test_port_map":
            ptf_test_port_map(ptfhost, tbinfo, duthosts, mux_server_url),
            "router_macs":
            router_macs,
            "ipv4":
            ipv4,
            "ipv6":
            ipv6,
            "testbed_mtu":
            mtu,
            "test_balancing":
            test_balancing,
            "ignore_ttl":
            ignore_ttl,
            "single_fib_for_duts":
            single_fib_for_duts
        },
        log_file=log_file,
        qlen=PTF_QLEN,
        socket_recv_size=16384)
Ejemplo n.º 4
0
def test_decap(tbinfo, duthosts, ptfhost, setup_teardown, mux_server_url, set_mux_random, supported_ttl_dscp_params, ip_ver, loopback_ips,
               duts_running_config_facts, duts_minigraph_facts):
    setup_info = setup_teardown

    ecn_mode = "copy_from_outer"
    ttl_mode = supported_ttl_dscp_params['ttl']
    dscp_mode = supported_ttl_dscp_params['dscp']
    if duthosts[0].facts['asic_type'] in ['mellanox']:
        ecn_mode = 'standard'

    try:
        apply_decap_cfg(duthosts, ip_ver, loopback_ips, ttl_mode, dscp_mode, ecn_mode, 'SET')

        if 'dualtor' in tbinfo['topo']['name']:
            wait(30, 'Wait some time for mux active/standby state to be stable after toggled mux state')

        log_file = "/tmp/decap.{}.log".format(datetime.now().strftime('%Y-%m-%d-%H:%M:%S'))
        ptf_runner(ptfhost,
                   "ptftests",
                   "IP_decap_test.DecapPacketTest",
                    platform_dir="ptftests",
                    params={"outer_ipv4": setup_info["outer_ipv4"],
                            "outer_ipv6": setup_info["outer_ipv6"],
                            "inner_ipv4": setup_info["inner_ipv4"],
                            "inner_ipv6": setup_info["inner_ipv6"],
                            "lo_ips": setup_info["lo_ips"],
                            "lo_ipv6s": setup_info["lo_ipv6s"],
                            "ttl_mode": ttl_mode,
                            "dscp_mode": dscp_mode,
                            "ignore_ttl": setup_info["ignore_ttl"],
                            "max_internal_hops": setup_info["max_internal_hops"],
                            "fib_info_files": setup_info["fib_info_files"],
                            "single_fib_for_duts": setup_info["single_fib_for_duts"],
                            "ptf_test_port_map": ptf_test_port_map(ptfhost, tbinfo, duthosts, mux_server_url, duts_running_config_facts, duts_minigraph_facts)
                            },
                    qlen=PTFRUNNER_QLEN,
                    log_file=log_file)
    except Exception as detail:
        raise Exception(detail)
    finally:
        # Remove test decap configuration
        apply_decap_cfg(duthosts, ip_ver, loopback_ips, ttl_mode, dscp_mode, ecn_mode, 'DEL')