sonic-net / sonic-mgmt

Configuration management examples for SONiC
Other
200 stars 732 forks source link

[Bug]: platform_api_conn missing fixture error fails test_sfp and test_thermal #15716

Open anamehra opened 6 days ago

anamehra commented 6 days ago

Issue Description

With latest sonic-mgmt suite, platform_tests/api/test_thermal.py. and platform_tests/api/test_sfp.py does not work. The test fails. Modification in these files were missed as part of the change introduced in https://github.com/sonic-net/sonic-mgmt/pull/15605

Results you see

      def test_get_model(self, duthosts, enum_rand_one_per_hwsku_hostname, localhost, platform_api_conn):
E       fixture 'platform_api_conn' not found
>       available fixtures: __pytest_repeat_step_number, active_active_ports, active_active_ports_config, active_standby_ports, add_mgmt_test_mark, ansible_adhoc, ansible_facts, ansible_module, backup_and_restore_config_db_session, bring_up_dut_interfaces, cable_type, cache, capfd, capfdbinary, caplog, capsys, capsysbinary, capture_interface_counters, check_bgp, check_dbmemory, check_dut_asic_type, check_interfaces, check_ipv6_mgmt, check_monit, check_mux_simulator, check_neighbor_macsec_empty, check_not_implemented_warnings, check_orchagent_usage, check_processes, check_secureboot, check_simulator_read_side, cleanup_cache_for_session, clear_neigh_entries, collect_db_dump, collect_techsupport, collect_techsupport_all_duts, collect_techsupport_all_nbrs, config_active_active_dualtor_active_standby, conn_graph_facts, core_dump_and_config_check, creds, creds_all_duts, disable_container_autorestart, disable_timed_oscillation_active_standby, doctest_namespace, dpu_npu_port_list, dut_test_params, dut_test_params_qos, duthost, duthost_console, duthosts, duts_minigraph_facts, duts_running_config_facts, enable_container_autorestart, enable_l2_mode, enhance_inventory, enum_asic_index, enum_backend_asic_index, enum_dut_feature, enum_dut_hostname, enum_frontend_asic_index, enum_frontend_dut_hostname, enum_rand_one_asic_index, enum_rand_one_frontend_asic_index, enum_rand_one_per_hwsku_frontend_hostname, enum_rand_one_per_hwsku_hostname, enum_supervisor_dut_hostname, enum_upstream_dut_hostname, eos, extra, extras, fanouthosts, force_active_tor, force_standby_tor, get_mux_status, get_pdu_controller, get_reboot_cause, gnxi_path, include_metadata_in_junit_xml, k8scluster, k8smasters, localhost, log_rotate_modular_chassis, loganalyzer, lower_tor_host, macsec_duthost, memory_utilization, metadata, mg_facts, monkeypatch, mux_config, mux_server_info, mux_server_url, mux_status_from_nic_simulator, nbr_device_numbers, nbr_ptfadapter, nbrhosts, nic_simulator_channel, nic_simulator_client, nic_simulator_flap_counter, nic_simulator_info, nic_simulator_url, on_exit, parallel_run_context, patch_lldpctl, pdu, pdu_controller, port_list_with_flat_memory, prepare_parallel_run, ptf_portmap_file, ptf_server_intf, ptfadapter, ptfhost, pytestconfig, rand_one_dut_front_end_hostname, rand_one_dut_hostname, rand_one_dut_lossless_prio, rand_one_dut_portname_oper_up, rand_one_tgen_dut_hostname, rand_selected_dut, rand_selected_front_end_dut, rand_unselected_dut, random_seed, record_property, record_testsuite_property, record_xml_attribute, recover_directions, recover_directions_all, recwarn, reset_critical_services_list, reset_simulator_port, restart_mux_simulator, restart_mux_simulator_session, restart_nic_simulator, restart_nic_simulator_session, rotate_syslog, run_icmp_responder_session, sanity_check, sanity_check_full, selected_dut, selected_rand_dut, selected_rand_one_per_hwsku_hostname, set_drop, set_drop_active_active, set_drop_all, set_output, set_output_all, set_random_seed, setup, setup_standby_ports_on_non_enum_rand_one_per_hwsku_frontend_host_m, setup_standby_ports_on_non_enum_rand_one_per_hwsku_frontend_host_m_unconditionally, setup_standby_ports_on_rand_selected_tor, setup_standby_ports_on_rand_unselected_tor, setup_standby_ports_on_rand_unselected_tor_unconditionally, shutdown_ebgp, simulator_flap_counter, simulator_server_down_active_active, skip_on_simx, sonic, start_platform_api_service, stop_nic_grpc_server, stop_platform_api_service, store_fixture_values, suspend_and_resume_hw_tc_on_mellanox_device, swapSyncd, t1_lower_tor_intfs, t1_upper_tor_intfs, tag_test_report, tbinfo, thermal_manager_enabled, tmp_path, tmp_path_factory, tmpdir, tmpdir_factory, toggle_active_active_simulator_ports, toggle_active_all_ports_both_tors, toggle_all_simulator_ports, toggle_all_simulator_ports_to_another_side, toggle_all_simulator_ports_to_lower_tor, toggle_all_simulator_ports_to_random_side, toggle_all_simulator_ports_to_upper_tor, toggle_simulator_port_to_lower_tor, toggle_simulator_port_to_upper_tor, tor_mux_intf, tor_mux_intfs, unpatch_lldpctl, upper_tor_host, url, validate_active_active_dualtor_setup, vmhost, worker_id, xcvr_skip_list
>       use 'pytest --fixtures [testpath]' for help on them.

/data/tests/platform_tests/api/test_sfp.py:343

Results you expected to see

Tests to pass.

Is it platform specific

generic

Relevant log output

No response

Output of show version

No response

Attach files (if any)

No response

yutongzhang-microsoft commented 9 hours ago

Hi, @anamehra, I raised PR #15807 to fix this issue. Please help me review.