def run_static_route_test(duthost, ptfadapter, ptfhost, tbinfo, prefix, nexthop_addrs, prefix_len, nexthop_devs, nexthop_interfaces, ipv6=False, config_reload_test=False):
    clear_arp_ndp(duthost, ipv6=ipv6)
    add_ipaddr(ptfadapter, ptfhost, nexthop_addrs, prefix_len, nexthop_interfaces, ipv6=ipv6)
    try:
        duthost.shell("sonic-db-cli CONFIG_DB hmset 'STATIC_ROUTE|{}' nexthop {}".format(prefix, ','.join(nexthop_addrs)))
        time.sleep(5)
        ip_dst = str(ipaddress.ip_network(unicode(prefix))[1])
        generate_and_verify_traffic(duthost, ptfadapter, tbinfo, ip_dst, nexthop_devs, ipv6=ipv6)
        check_route_redistribution(duthost, prefix, ipv6)
        if config_reload_test:
            duthost.shell('config save -y')
            config_reload(duthost, wait=350)
            generate_and_verify_traffic(duthost, ptfadapter, tbinfo, ip_dst, nexthop_devs, ipv6=ipv6)
            check_route_redistribution(duthost, prefix, ipv6)
    finally:
        duthost.shell("sonic-db-cli CONFIG_DB del 'STATIC_ROUTE|{}'".format(prefix), module_ignore_errors=True)
        del_ipaddr(ptfhost, nexthop_addrs, prefix_len, nexthop_devs, ipv6=ipv6)
        time.sleep(5)
        check_route_redistribution(duthost, prefix, ipv6, removed=True)
        if config_reload_test:
            duthost.shell('config save -y')
        clear_arp_ndp(duthost, ipv6=ipv6)
def run_static_route_test(duthost, ptfadapter, ptfhost, tbinfo, prefix, nexthop_addrs, prefix_len, nexthop_devs, nexthop_interfaces, ipv6=False, config_reload_test=False):
    clear_arp_ndp(duthost, ipv6=ipv6)
    add_ipaddr(ptfadapter, ptfhost, nexthop_addrs, prefix_len, nexthop_interfaces, ipv6=ipv6)
    try:
        duthost.shell("sonic-db-cli CONFIG_DB hmset 'STATIC_ROUTE|{}' nexthop {}".format(prefix, ','.join(nexthop_addrs)))
        time.sleep(5)
        ip_dst = str(ipaddress.ip_network(unicode(prefix))[1])
        generate_and_verify_traffic(duthost, ptfadapter, tbinfo, ip_dst, nexthop_devs, ipv6=ipv6)
        check_route_redistribution(duthost, prefix, ipv6)
        if config_reload_test:
            duthost.shell('config save -y')
            config_reload(duthost, wait=350)
            generate_and_verify_traffic(duthost, ptfadapter, tbinfo, ip_dst, nexthop_devs, ipv6=ipv6)
            check_route_redistribution(duthost, prefix, ipv6)
    finally:
        duthost.shell("sonic-db-cli CONFIG_DB del 'STATIC_ROUTE|{}'".format(prefix), module_ignore_errors=True)
        del_ipaddr(ptfhost, nexthop_addrs, prefix_len, nexthop_devs, ipv6=ipv6)
        time.sleep(5)
        check_route_redistribution(duthost, prefix, ipv6, removed=True)
        if config_reload_test:
            duthost.shell('config save -y')
        clear_arp_ndp(duthost, ipv6=ipv6)