From 7568a7370ee45851d9b0f38cdfcb4dfb05bbddb5 Mon Sep 17 00:00:00 2001 From: selldinesh Date: Fri, 18 Apr 2025 21:57:48 +0000 Subject: [PATCH 1/2] [Snappi] Modifying LACP cases to use snappi_api instead of cvg_api --- .../lacp/files/lacp_dut_helper.py | 92 +++++-------- .../lacp/files/lacp_physical_helper.py | 130 +++++++----------- .../lacp/test_add_remove_link_from_dut.py | 10 +- .../lacp/test_add_remove_link_physically.py | 14 +- .../lacp/test_lacp_timers_effect.py | 10 +- 5 files changed, 97 insertions(+), 159 deletions(-) diff --git a/tests/snappi_tests/lacp/files/lacp_dut_helper.py b/tests/snappi_tests/lacp/files/lacp_dut_helper.py index b4a63731f4d..bcf39fe39c8 100755 --- a/tests/snappi_tests/lacp/files/lacp_dut_helper.py +++ b/tests/snappi_tests/lacp/files/lacp_dut_helper.py @@ -12,13 +12,12 @@ aspaths = [65002, 65003] -def run_lacp_add_remove_link_from_dut(api, +def run_lacp_add_remove_link_from_dut(snappi_api, duthost, tgen_ports, iteration, port_count, - number_of_routes, - port_speed,): + number_of_routes,): """ Run Local link failover test @@ -29,7 +28,6 @@ def run_lacp_add_remove_link_from_dut(api, iteration: number of iterations for running convergence test on a port port_count: total number of ports used in test number_of_routes: Number of IPv4/IPv6 Routes - port_speed: speed of the port used for test """ """ Create bgp config on dut """ @@ -38,25 +36,21 @@ def run_lacp_add_remove_link_from_dut(api, port_count,) """ Create bgp config on TGEN """ - tgen_bgp_config = __tgen_bgp_config(api, + tgen_bgp_config = __tgen_bgp_config(snappi_api, port_count, - number_of_routes, - port_speed,) + number_of_routes,) """ Run the convergence test by flapping all the rx links one by one and calculate the convergence values """ - get_lacp_add_remove_link_from_dut(api, + get_lacp_add_remove_link_from_dut(snappi_api, duthost, tgen_bgp_config, iteration, port_count, number_of_routes,) - """ Cleanup the dut configs after getting the convergence numbers """ - cleanup_config(duthost) - def duthost_bgp_config(duthost, tgen_ports, @@ -130,10 +124,9 @@ def duthost_bgp_config(duthost, duthost.shell(bgp_config) -def __tgen_bgp_config(api, +def __tgen_bgp_config(snappi_api, port_count, - number_of_routes, - port_speed,): + number_of_routes,): """ Creating BGP config on TGEN @@ -141,9 +134,8 @@ def __tgen_bgp_config(api, api (pytest fixture): snappi API port_count: total number of ports used in test number_of_routes: Number of IPv4/IPv6 Routes - port_speed: speed of the port used for test """ - config = api.config() + config = snappi_api.config() for i in range(1, port_count+1): config.ports.port(name='Test_Port_%d' % i, location=temp_tg_port[i-1]['location']) @@ -169,15 +161,15 @@ def __tgen_bgp_config(api, layer1.name = 'port settings' layer1.port_names = [port.name for port in config.ports] layer1.ieee_media_defaults = False - layer1.auto_negotiation.rs_fec = True + layer1.auto_negotiation.rs_fec = False layer1.auto_negotiation.link_training = False - layer1.speed = port_speed + layer1.speed = temp_tg_port[0]['speed'] layer1.auto_negotiate = False # Source config.devices.device(name='Tx') eth_1 = config.devices[0].ethernets.add() - eth_1.port_name = lag0.name + eth_1.connection.port_name = lag0.name eth_1.name = 'Ethernet 1' eth_1.mac = "00:14:0a:00:00:01" ipv4_1 = eth_1.ipv4_addresses.add() @@ -194,7 +186,7 @@ def __tgen_bgp_config(api, # Destination config.devices.device(name="Rx") eth_2 = config.devices[1].ethernets.add() - eth_2.port_name = lag1.name + eth_2.connection.port_name = lag1.name eth_2.name = 'Ethernet 2' eth_2.mac = "00:14:01:00:00:01" ipv4_2 = eth_2.ipv4_addresses.add() @@ -254,31 +246,31 @@ def createTrafficItem(traffic_name, src, dest): return config -def get_flow_stats(api): +def get_flow_stats(snappi_api): """ Args: - api (pytest fixture): Snappi API + snappi_api (pytest fixture): Snappi API """ - request = api.metrics_request() + request = snappi_api.metrics_request() request.flow.flow_names = [] - return api.get_metrics(request).flow_metrics + return snappi_api.get_metrics(request).flow_metrics -def get_port_stats(api, port_name): +def get_port_stats(snappi_api, port_name): """ Args: - api (pytest fixture): Snappi API + snappi_api (pytest fixture): Snappi API """ - request = api.metrics_request() + request = snappi_api.metrics_request() request.port.port_names = [port_name] - return api.get_metrics(request).port_metrics + return snappi_api.get_metrics(request).port_metrics -def print_port_stats(api, port_names): +def print_port_stats(snappi_api, port_names): table1 = [] for i, j in enumerate(port_names): port_table = [] - port_stats = get_port_stats(api, j) + port_stats = get_port_stats(snappi_api, j) port_table.append(temp_tg_port[i]['peer_port']) port_table.append(j) port_table.append(port_stats[0].frames_tx_rate) @@ -289,7 +281,7 @@ def print_port_stats(api, port_names): tabulate(table1, headers=columns, tablefmt="psql")) -def get_lacp_add_remove_link_from_dut(api, +def get_lacp_add_remove_link_from_dut(snappi_api, duthost, bgp_config, iteration, @@ -310,7 +302,7 @@ def get_lacp_add_remove_link_from_dut(api, dut.append(temp_tg_port[i]['peer_port']) port_names = rx_port_names port_names.insert(0, 'Test_Port_1') - api.set_config(bgp_config) + snappi_api.set_config(bgp_config) def get_avg_cpdp_convergence_time(port_name, dut_port_name): """ @@ -319,32 +311,32 @@ def get_avg_cpdp_convergence_time(port_name, dut_port_name): """ table, tx_frate, rx_frate = [], [], [] print("Starting all protocols ...") - ps = api.protocol_state() - ps.state = ps.START - api.set_protocol_state(ps) + cs = snappi_api.control_state() + cs.protocol.all.state = cs.protocol.all.START + snappi_api.set_control_state(cs) wait(TIMEOUT, "For Protocols To start") for i in range(0, iteration): logger.info( '|---- {} Link Flap Iteration : {} ----|'.format(dut_port_name, i+1)) """ Starting Traffic """ logger.info('Starting Traffic') - ts = api.transmit_state() - ts.state = ts.START - api.set_transmit_state(ts) + cs = snappi_api.control_state() + cs.traffic.flow_transmit.state = cs.traffic.flow_transmit.START + snappi_api.set_control_state(cs) wait(TIMEOUT, "For Traffic To start") - flow_stats = get_flow_stats(api) + flow_stats = get_flow_stats(snappi_api) tx_frame_rate = flow_stats[0].frames_tx_rate assert tx_frame_rate != 0, "Traffic has not started" logger.info('Traffic has started') logger.info('Port Stats before {} failover'.format(dut_port_name)) - print_port_stats(api, port_names) + print_port_stats(snappi_api, port_names) """ Flapping Link """ logger.info( 'Simulating Link Failure on {} from dut side '.format(port_name)) duthost.shell( "sudo config portchannel member del PortChannel2 %s\n" % (dut_port_name)) wait(TIMEOUT-20, "For Link to go down and traffic to stabilize") - flows = get_flow_stats(api) + flows = get_flow_stats(snappi_api) for flow in flows: tx_frate.append(flow.frames_tx_rate) rx_frate.append(flow.frames_tx_rate) @@ -353,7 +345,7 @@ def get_avg_cpdp_convergence_time(port_name, dut_port_name): .format(sum(tx_frate), sum(rx_frate)) logger.info("Traffic has converged after link flap with no loss") logger.info('Port Stats after {} failover'.format(dut_port_name)) - print_port_stats(api, port_names) + print_port_stats(snappi_api, port_names) """ Performing link up at the end of iteration """ logger.info('Simulating Link Up on {} from dut side at the end of iteration {}'.format( dut_port_name, i+1)) @@ -372,19 +364,3 @@ def get_avg_cpdp_convergence_time(port_name, dut_port_name): tgen_port_name, dut_port_name)) columns = ['Event Name', 'No. of Routes', 'Iterations', 'Loss%'] logger.info("\n%s" % tabulate(table, headers=columns, tablefmt="psql")) - - -def cleanup_config(duthost): - """ - Cleaning up dut config at the end of the test - - Args: - duthost (pytest fixture): duthost fixture - """ - logger.info('Cleaning up config') - duthost.command("sudo cp {} {}".format( - "/etc/sonic/config_db_backup.json", "/etc/sonic/config_db.json")) - duthost.shell("sudo config reload -y \n") - pytest_assert(wait_until(360, 10, 1, duthost.critical_services_fully_started), - "Not all critical services are fully started") - logger.info('Convergence Test Completed') diff --git a/tests/snappi_tests/lacp/files/lacp_physical_helper.py b/tests/snappi_tests/lacp/files/lacp_physical_helper.py index da122b469e1..3b60e9730af 100755 --- a/tests/snappi_tests/lacp/files/lacp_physical_helper.py +++ b/tests/snappi_tests/lacp/files/lacp_physical_helper.py @@ -15,24 +15,22 @@ aspaths = [65002, 65003] -def run_lacp_add_remove_link_physically(cvg_api, +def run_lacp_add_remove_link_physically(snappi_api, duthost, tgen_ports, iteration, port_count, - number_of_routes, - port_speed,): + number_of_routes,): """ Run Local link failover test Args: - cvg_api (pytest fixture): snappi API + snappi_api (pytest fixture): snappi API duthost (pytest fixture): duthost fixture tgen_ports (pytest fixture): Ports mapping info of T0 testbed iteration: number of iterations for running convergence test on a port port_count: total number of ports used in test number_of_routes: Number of IPv4/IPv6 Routes - port_speed: speed of the port used for test """ """ Create bgp config on dut """ @@ -41,39 +39,34 @@ def run_lacp_add_remove_link_physically(cvg_api, port_count,) """ Create bgp config on TGEN """ - tgen_bgp_config = __tgen_bgp_config(cvg_api, + tgen_bgp_config = __tgen_bgp_config(snappi_api, port_count, - number_of_routes, - port_speed,) + number_of_routes,) """ Run the convergence test by flapping all the rx links one by one and calculate the convergence values """ - get_lacp_add_remove_link_physically(cvg_api, + get_lacp_add_remove_link_physically(snappi_api, tgen_bgp_config, iteration, port_count, number_of_routes,) - """ Cleanup the dut configs after getting the convergence numbers """ - cleanup_config(duthost) - -def run_lacp_timers_effect(cvg_api, +def run_lacp_timers_effect(snappi_api, duthost, tgen_ports, iteration, port_count, number_of_routes, - port_speed, lacpdu_interval_period, lacpdu_timeout,): """ Run Local link failover test Args: - cvg_api (pytest fixture): snappi API + snappi_api (pytest fixture): snappi API duthost (pytest fixture): duthost fixture tgen_ports (pytest fixture): Ports mapping info of T0 testbed iteration: number of iterations for running convergence test on a port @@ -88,10 +81,9 @@ def run_lacp_timers_effect(cvg_api, port_count,) """ Create bgp config on TGEN """ - tgen_bgp_config = __tgen_bgp_config(cvg_api, + tgen_bgp_config = __tgen_bgp_config(snappi_api, port_count, number_of_routes, - port_speed, lacpdu_interval_period, lacpdu_timeout,) @@ -99,15 +91,12 @@ def run_lacp_timers_effect(cvg_api, Run the convergence test by flapping all the rx links one by one and calculate the convergence values """ - get_lacp_add_remove_link_physically(cvg_api, + get_lacp_add_remove_link_physically(snappi_api, tgen_bgp_config, iteration, port_count, number_of_routes,) - """ Cleanup the dut configs after getting the convergence numbers """ - cleanup_config(duthost) - def duthost_bgp_config(duthost, tgen_ports, @@ -181,25 +170,22 @@ def duthost_bgp_config(duthost, duthost.shell(bgp_config) -def __tgen_bgp_config(cvg_api, +def __tgen_bgp_config(snappi_api, port_count, number_of_routes, - port_speed, lacpdu_interval_period=0, lacpdu_timeout=0,): """ Creating BGP config on TGEN Args: - cvg_api (pytest fixture): snappi API + snappi_api (pytest fixture): snappi API port_count: total number of ports used in test number_of_routes: Number of IPv4/IPv6 Routes - port_speed: speed of the port used for test lacpdu_interval_period: LACP update packet interval ( 0 - Auto, 1- Fast, 30 - Slow ) lacpdu_timeout: LACP Timeout value (0 - Auto, 3 - Short, 90 - Long) """ - conv_config = cvg_api.convergence_config() - config = conv_config.config + config = snappi_api.config() for i in range(1, port_count+1): config.ports.port(name='Test_Port_%d' % i, location=temp_tg_port[i-1]['location']) @@ -238,15 +224,15 @@ def __tgen_bgp_config(cvg_api, layer1.name = 'port settings' layer1.port_names = [port.name for port in config.ports] layer1.ieee_media_defaults = False - layer1.auto_negotiation.rs_fec = True + layer1.auto_negotiation.rs_fec = False layer1.auto_negotiation.link_training = False - layer1.speed = port_speed + layer1.speed = temp_tg_port[0]['speed'] layer1.auto_negotiate = False # Source config.devices.device(name='Tx') eth_1 = config.devices[0].ethernets.add() - eth_1.port_name = lag0.name + eth_1.connection.port_name = lag0.name eth_1.name = 'Ethernet 1' eth_1.mac = "00:14:0a:00:00:01" ipv4_1 = eth_1.ipv4_addresses.add() @@ -263,7 +249,7 @@ def __tgen_bgp_config(cvg_api, # Destination config.devices.device(name="Rx") eth_2 = config.devices[1].ethernets.add() - eth_2.port_name = lag1.name + eth_2.connection.port_name = lag1.name eth_2.name = 'Ethernet 2' eth_2.mac = "00:14:01:00:00:01" ipv4_2 = eth_2.ipv4_addresses.add() @@ -320,36 +306,38 @@ def createTrafficItem(traffic_name, src, dest): flow1.metrics.loss = True createTrafficItem("IPv4_1-IPv4_Routes", ipv4_1.name, route_range1.name) # createTrafficItem("IPv6_1-IPv6_Routes", ipv6_1.name, route_range2.name) - return conv_config + return config -def get_flow_stats(cvg_api): +def get_flow_stats(snappi_api): """ Args: - cvg_api (pytest fixture): Snappi API + snappi_api (pytest fixture): Snappi API """ - request = cvg_api.convergence_request() - request.metrics.flow_names = [] - return cvg_api.get_results(request).flow_metric + req = snappi_api.metrics_request() + req.flow.flow_names = [] + return snappi_api.get_metrics(req).flow_metrics -def get_lacp_add_remove_link_physically(cvg_api, +def get_lacp_add_remove_link_physically(snappi_api, bgp_config, iteration, port_count, number_of_routes,): """ Args: - cvg_api (pytest fixture): snappi API + snappi_api (pytest fixture): snappi API bgp_config: __tgen_bgp_config iteration: number of iterations for running convergence test on a port number_of_routes: Number of Routes """ rx_port_names = [] - for i in range(1, len(bgp_config.config.ports)): - rx_port_names.append(bgp_config.config.ports[i].name) - bgp_config.rx_rate_threshold = 90/(port_count-2) - cvg_api.set_config(bgp_config) + for i in range(1, len(bgp_config.ports)): + rx_port_names.append(bgp_config.ports[i].name) + bgp_config.events.cp_events.enable = True + bgp_config.events.dp_events.enable = True + bgp_config.events.dp_events.rx_rate_threshold = 90/(port_count-2) + snappi_api.set_config(bgp_config) def get_avg_cpdp_convergence_time(port_name): """ @@ -359,9 +347,9 @@ def get_avg_cpdp_convergence_time(port_name): table, avg, tx_frate, rx_frate, avg_delta = [], [], [], [], [] """ Starting Protocols """ logger.info("Starting all protocols ...") - cs = cvg_api.convergence_state() - cs.protocol.state = cs.protocol.START - cvg_api.set_state(cs) + cs = snappi_api.control_state() + cs.protocol.all.state = cs.protocol.all.START + snappi_api.set_control_state(cs) wait(TIMEOUT, "For Protocols To start") for i in range(0, iteration): logger.info( @@ -369,22 +357,23 @@ def get_avg_cpdp_convergence_time(port_name): """ Starting Traffic """ logger.info('Starting Traffic') - cs = cvg_api.convergence_state() - cs.transmit.state = cs.transmit.START - cvg_api.set_state(cs) + cs = snappi_api.control_state() + cs.traffic.flow_transmit.state = cs.traffic.flow_transmit.START + snappi_api.set_control_state(cs) wait(TIMEOUT, "For Traffic To start") - flow_stats = get_flow_stats(cvg_api) + flow_stats = get_flow_stats(snappi_api) tx_frame_rate = flow_stats[0].frames_tx_rate assert tx_frame_rate != 0, "Traffic has not started" logger.info('Traffic has started') """ Flapping Link """ logger.info('Simulating Link Failure on {} link'.format(port_name)) - cs = cvg_api.convergence_state() - cs.link.port_names = [port_name] - cs.link.state = cs.link.DOWN - cvg_api.set_state(cs) - wait(TIMEOUT-20, "For Link to go down") - flows = get_flow_stats(cvg_api) + cs.choice = cs.PORT + cs.port.choice = cs.port.LINK + cs.port.link.port_names = [port_name] + cs.port.link.state = cs.port.link.DOWN + snappi_api.set_control_state(cs) + wait(TIMEOUT, "For Link to go down") + flows = get_flow_stats(snappi_api) for flow in flows: tx_frate.append(flow.frames_tx_rate) rx_frate.append(flow.frames_tx_rate) @@ -393,9 +382,9 @@ def get_avg_cpdp_convergence_time(port_name): .format(sum(tx_frate), sum(rx_frate)) logger.info("Traffic has converged after link flap") """ Get control plane to data plane convergence value """ - request = cvg_api.convergence_request() + request = snappi_api.metrics_request() request.convergence.flow_names = [] - convergence_metrics = cvg_api.get_results(request).flow_convergence + convergence_metrics = snappi_api.get_metrics(request).convergence_metrics for metrics in convergence_metrics: logger.info('CP/DP Convergence Time (ms): {}'.format( metrics.control_plane_data_plane_convergence_us/1000)) @@ -405,10 +394,11 @@ def get_avg_cpdp_convergence_time(port_name): """ Performing link up at the end of iteration """ logger.info( 'Simulating Link Up on {} at the end of iteration {}'.format(port_name, i+1)) - cs = cvg_api.convergence_state() - cs.link.port_names = [port_name] - cs.link.state = cs.link.UP - cvg_api.set_state(cs) + cs.choice = cs.PORT + cs.port.choice = cs.port.LINK + cs.port.link.port_names = [port_name] + cs.port.link.state = cs.port.link.UP + snappi_api.set_control_state(cs) table.append('%s Link Failure' % port_name) table.append(number_of_routes) table.append(iteration) @@ -422,19 +412,3 @@ def get_avg_cpdp_convergence_time(port_name): columns = ['Event Name', 'No. of Routes', 'Iterations', 'Frames Delta', 'Avg Calculated Data Convergence Time (ms)'] logger.info("\n%s" % tabulate(table, headers=columns, tablefmt="psql")) - - -def cleanup_config(duthost): - """ - Cleaning up dut config at the end of the test - - Args: - duthost (pytest fixture): duthost fixture - """ - logger.info('Cleaning up config') - duthost.command("sudo cp {} {}".format( - "/etc/sonic/config_db_backup.json", "/etc/sonic/config_db.json")) - duthost.shell("sudo config reload -y \n") - pytest_assert(wait_until(360, 10, 1, duthost.critical_services_fully_started), - "Not all critical services are fully started") - logger.info('Convergence Test Completed') diff --git a/tests/snappi_tests/lacp/test_add_remove_link_from_dut.py b/tests/snappi_tests/lacp/test_add_remove_link_from_dut.py index 6c8d9e40e89..ab6910da39c 100755 --- a/tests/snappi_tests/lacp/test_add_remove_link_from_dut.py +++ b/tests/snappi_tests/lacp/test_add_remove_link_from_dut.py @@ -1,4 +1,4 @@ -from tests.common.snappi_tests.snappi_fixtures import cvg_api, snappi_api # noqa F401 +from tests.common.snappi_tests.snappi_fixtures import snappi_api # noqa F401 from tests.common.snappi_tests.snappi_fixtures import ( # noqa F401 snappi_api_serv_ip, snappi_api_serv_port, tgen_ports) from tests.snappi_tests.lacp.files.lacp_dut_helper import run_lacp_add_remove_link_from_dut @@ -12,7 +12,6 @@ @pytest.mark.parametrize('port_count', [4]) @pytest.mark.parametrize('number_of_routes', [1000]) @pytest.mark.parametrize('iterations', [1]) -@pytest.mark.parametrize('port_speed', ['speed_100_gbps']) def test_lacp_add_remove_link_from_dut(snappi_api, # noqa F811 duthost, tgen_ports, # noqa F811 @@ -20,8 +19,7 @@ def test_lacp_add_remove_link_from_dut(snappi_api, # noqa F conn_graph_facts, # noqa F811 fanout_graph_facts, # noqa F811 port_count, - number_of_routes, - port_speed,): + number_of_routes,): """ Topo: LAG1 --- DUT --- LAG2 (N-1 TGEN Ports) @@ -48,7 +46,6 @@ def test_lacp_add_remove_link_from_dut(snappi_api, # noqa F port_count: Total no of ports used in the test iterations: no of iterations to run the link flap test number_of_routes: Number of IPv4/IPv6 Routes - port_speed: speed of the port used for test """ # port_count, number_of_routes ,iterations and port_speed parameters can be modified as per user preference run_lacp_add_remove_link_from_dut(snappi_api, @@ -56,5 +53,4 @@ def test_lacp_add_remove_link_from_dut(snappi_api, # noqa F tgen_ports, iterations, port_count, - number_of_routes, - port_speed,) + number_of_routes,) diff --git a/tests/snappi_tests/lacp/test_add_remove_link_physically.py b/tests/snappi_tests/lacp/test_add_remove_link_physically.py index 313ec1c8d64..b2c99c5131d 100755 --- a/tests/snappi_tests/lacp/test_add_remove_link_physically.py +++ b/tests/snappi_tests/lacp/test_add_remove_link_physically.py @@ -1,4 +1,4 @@ -from tests.common.snappi_tests.snappi_fixtures import cvg_api # noqa F401 +from tests.common.snappi_tests.snappi_fixtures import snappi_api # noqa F401 from tests.common.snappi_tests.snappi_fixtures import ( # noqa F401 snappi_api_serv_ip, snappi_api_serv_port, tgen_ports) from tests.snappi_tests.lacp.files.lacp_physical_helper import run_lacp_add_remove_link_physically @@ -12,16 +12,14 @@ @pytest.mark.parametrize('port_count', [4]) @pytest.mark.parametrize('number_of_routes', [1000]) @pytest.mark.parametrize('iterations', [1]) -@pytest.mark.parametrize('port_speed', ['speed_100_gbps']) -def test_lacp_add_remove_link_physically(cvg_api, # noqa F811 +def test_lacp_add_remove_link_physically(snappi_api, # noqa F811 duthost, tgen_ports, # noqa F811 iterations, conn_graph_facts, # noqa F811 fanout_graph_facts, # noqa F811 port_count, - number_of_routes, - port_speed,): + number_of_routes,): """ Topo: LAG1 --- DUT --- LAG2 (N-1 TGEN Ports) @@ -49,15 +47,13 @@ def test_lacp_add_remove_link_physically(cvg_api, # noqa F811 port_count: Total no of ports used in the test iterations: no of iterations to run the link flap test number_of_routes: Number of IPv4/IPv6 Routes - port_speed: speed of the port used for test lacpdu_interval_period: LACP update packet interval ( 0 - Auto, 1- Fast, 30 - Slow ) lacpdu_timeout: LACP Timeout value (0 - Auto, 3 - Short, 90 - Long) """ # port_count, number_of_routes ,iterations and port_speed parameters can be modified as per user preference - run_lacp_add_remove_link_physically(cvg_api, + run_lacp_add_remove_link_physically(snappi_api, duthost, tgen_ports, iterations, port_count, - number_of_routes, - port_speed,) + number_of_routes,) diff --git a/tests/snappi_tests/lacp/test_lacp_timers_effect.py b/tests/snappi_tests/lacp/test_lacp_timers_effect.py index 7ced05d159c..bd83ebbd4f7 100644 --- a/tests/snappi_tests/lacp/test_lacp_timers_effect.py +++ b/tests/snappi_tests/lacp/test_lacp_timers_effect.py @@ -1,4 +1,4 @@ -from tests.common.snappi_tests.snappi_fixtures import cvg_api # noqa F401 +from tests.common.snappi_tests.snappi_fixtures import snappi_api # noqa F401 from tests.common.snappi_tests.snappi_fixtures import ( # noqa F401 snappi_api_serv_ip, snappi_api_serv_port, tgen_ports) from tests.snappi_tests.lacp.files.lacp_physical_helper import run_lacp_timers_effect @@ -12,10 +12,9 @@ @pytest.mark.parametrize('port_count', [4]) @pytest.mark.parametrize('number_of_routes', [1000]) @pytest.mark.parametrize('iterations', [1]) -@pytest.mark.parametrize('port_speed', ['speed_100_gbps']) @pytest.mark.parametrize('lacpdu_interval_period', [1]) @pytest.mark.parametrize('lacpdu_timeout', [90]) -def test_lacp_timers(cvg_api, # noqa F811 +def test_lacp_timers(snappi_api, # noqa F811 duthost, tgen_ports, # noqa F811 iterations, @@ -23,7 +22,6 @@ def test_lacp_timers(cvg_api, # noqa F811 fanout_graph_facts, # noqa F811 port_count, number_of_routes, - port_speed, lacpdu_interval_period, lacpdu_timeout,): """ @@ -54,18 +52,16 @@ def test_lacp_timers(cvg_api, # noqa F811 port_count: Total no of ports used in the test iterations: no of iterations to run the link flap test number_of_routes: Number of IPv4/IPv6 Routes - port_speed: speed of the port used for test lacpdu_interval_period: LACP update packet interval ( 0 - Auto, 1- Fast, 30 - Slow ) lacpdu_timeout: LACP Timeout value (0 - Auto, 3 - Short, 90 - Long) """ # port_count, number_of_routes ,iterations, port_speed, lacpdu_interval_period, # lacpdu_timeout parameters can be modified as per user preference - run_lacp_timers_effect(cvg_api, + run_lacp_timers_effect(snappi_api, duthost, tgen_ports, iterations, port_count, number_of_routes, - port_speed, lacpdu_interval_period, lacpdu_timeout,) From f0e1fd83a0a397bef23968c534cc5b6db468140a Mon Sep 17 00:00:00 2001 From: selldinesh Date: Thu, 24 Apr 2025 16:31:06 +0000 Subject: [PATCH 2/2] removing unused imports --- tests/snappi_tests/lacp/files/lacp_dut_helper.py | 3 +-- tests/snappi_tests/lacp/files/lacp_physical_helper.py | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/tests/snappi_tests/lacp/files/lacp_dut_helper.py b/tests/snappi_tests/lacp/files/lacp_dut_helper.py index bcf39fe39c8..67ece4eba64 100755 --- a/tests/snappi_tests/lacp/files/lacp_dut_helper.py +++ b/tests/snappi_tests/lacp/files/lacp_dut_helper.py @@ -1,7 +1,6 @@ import logging from tabulate import tabulate -from tests.common.utilities import (wait, wait_until) -from tests.common.helpers.assertions import pytest_assert +from tests.common.utilities import wait logger = logging.getLogger(__name__) TGEN_AS_NUM = 65200 diff --git a/tests/snappi_tests/lacp/files/lacp_physical_helper.py b/tests/snappi_tests/lacp/files/lacp_physical_helper.py index 3b60e9730af..20993ff0025 100755 --- a/tests/snappi_tests/lacp/files/lacp_physical_helper.py +++ b/tests/snappi_tests/lacp/files/lacp_physical_helper.py @@ -1,8 +1,7 @@ import logging from tabulate import tabulate from statistics import mean -from tests.common.utilities import (wait, wait_until) -from tests.common.helpers.assertions import pytest_assert +from tests.common.utilities import wait logger = logging.getLogger(__name__) TGEN_AS_NUM = 65200