Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test_lldp_max_neighbours (Key-Error) #407

Closed
hubogee opened this issue Oct 3, 2023 · 0 comments · Fixed by dentproject/dentOS#294
Closed

test_lldp_max_neighbours (Key-Error) #407

hubogee opened this issue Oct 3, 2023 · 0 comments · Fixed by dentproject/dentOS#294
Assignees
Labels
regression issue found in regression

Comments

@hubogee
Copy link
Contributor

hubogee commented Oct 3, 2023

Build: 2023-09-27-0724

Test Results: http://10.36.118.11/TestResults/10-02-2023-20-20-02-096352_functional/report_suite_group_functional.html?sort=result&visible=failed,error,xpassed,rerun

Test results will be automatically removed in 14 days

async def test_lldp_max_neighbours(testbed):
    """
    Test Name: test_lldp_max_neighbours
    Test Suite: suite_functional_lldp
    Test Overview: Verify that lldp will have amount of neighbours equal to max-neighbors configured in lldp
    Test Procedure:
    1. Init interfaces and set first DUT port up
    2. Set lldp status on first DUT port rx-only, get max-neighbors configured in lldp
    3. Setup incremented lldp packet for trasmitting to first DUT port and transmit stream
    4. Verify that lldp will have configured amount of max-neighbors
    """

    tgen_dev, dent_devices = await tgen_utils_get_dent_devices_with_tgen(testbed, [], 2)
    if not tgen_dev or not dent_devices:
        pytest.skip('The testbed does not have enough dent with tgen connections')
    dev_name = dent_devices[0].host_name
    dent_dev = dent_devices[0]
    tg_ports = tgen_dev.links_dict[dev_name][0]
    dut_ports = tgen_dev.links_dict[dev_name][1]

    # 1.Init interfaces and set first DUT port up
    out = await IpLink.set(
        input_data=[{dev_name: [
            {'device': dut_ports[0], 'operstate': 'up'}]}])
    assert not out[0][dev_name]['rc'], f"Verify {dut_ports[0]} set to 'UP' state.\n{out}"

    dev_groups = tgen_utils_dev_groups_from_config(
        [{'ixp': tg_ports[0], 'ip': '10.0.0.3', 'gw': '10.0.0.1', 'plen': 24},
         {'ixp': tg_ports[1], 'ip': '11.0.0.3', 'gw': '11.0.0.1', 'plen': 24}]
    )
    await tgen_utils_traffic_generator_connect(tgen_dev, tg_ports, dut_ports, dev_groups)

    # 2.Set lldp status on first DUT port rx-only, get max-neighbors configured in lldp
    out = await Lldp.configure(
            input_data=[{dev_name: [
                {'interface': dut_ports[0], 'ports': '', 'lldp': '', 'status': 'rx-only'}]}])
    assert not out[0][dev_name]['rc'], \
        f'Failed to configure lldp status on port {dut_ports[0]}.\n{out}'

    out = await Lldp.show_lldpcli(
        input_data=[{dev_name: [
            {'running-configuration': '', 'cmd_options': '-f json'}]}], parse_output=True)
    assert not out[0][dev_name]['rc'], f'Failed to show LLDP neighbors.\n{out}'
  max_neighbors = int(out[0][dev_name]['parsed_output']['configuration']['config']['max-neighbors'])

E KeyError: 'max-neighbors'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
regression issue found in regression
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants