def METHOD_NAME(iter):
    "Test route install for a variety of ecmp"
    tgen = get_topogen()
    # Don't run this test if we have any failure.
    if tgen.routers_have_failure():
        pytest.skip(tgen.errors)
    r1 = tgen.gears["r1"]
    # Avoid top ecmp case for runs with < 4G memory
    output = tgen.net.cmd_raises("free")
    m = re.search(r"Mem:\s+(\d+)\s+(\d+)\s+(\d+)\s+(\d+)\s+(\d+)\s+(\d+)", output)
    total_mem = int(m.group(2))
    if total_mem < 4000000 and iter == 5:
        logger.info(
            "Limited memory available: {}, skipping x32 testcase".format(total_mem)
        )
        return;
    installed_file = "{}/r1/installed.routes.json".format(CWD)
    expected_installed = json.loads(open(installed_file).read())
    removed_file = "{}/r1/no.routes.json".format(CWD)
    expected_removed = json.loads(open(removed_file).read())
    # dict keys of params: ecmp number, corresponding nhg name, timeout,
    # number of times to wait
    scale_keys = ["ecmp", "nhg", "wait", "retries", "expect_in", "expect_rem"]
    # Table of defaults, used for timeout values and 'expected' objects
    scale_defaults = dict(
        zip(scale_keys, [None, None, 10, 50, expected_installed, expected_removed])
    )
    # List of params for each step in the test; note extra time given
    # for the highest ecmp steps. Executing 'show' at scale can be costly
    # so we widen the interval there too.
    scale_steps = [
        [1, "one"],
        [2, "two"],
        [4, "four"],
        [8, "eight"],
        [16, "sixteen", 10, 40],
        [32, "thirtytwo", 10, 40],
    ]
    # Build up a list of dicts with params for each step of the test;
    # use defaults where the step doesn't supply a value
    scale_setups = []
    s = scale_steps[iter]
    d = dict(zip(scale_keys, s))
    for k in scale_keys:
        if k not in d:
            d[k] = scale_defaults[k]
    run_one_setup(r1, d)