Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@
import logging
import time
from pkg_resources import parse_version
from tests.platform_tests.thermal_control_test_helper import mocker, FanStatusMocker, ThermalStatusMocker, \
from tests.common.helpers.thermal_control_test_helper import mocker, FanStatusMocker, ThermalStatusMocker, \
SingleFanMocker
from tests.common.mellanox_data import get_hw_management_version, get_platform_data
from .minimum_table import get_min_table
from tests.common.helpers.minimum_table import get_min_table
from tests.common.utilities import wait_until
from tests.common.helpers.assertions import pytest_assert

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,6 @@ def _create_mocker(dut, mocker_name):
mocker_object = None

if 'mlnx' in platform or 'nvidia' in platform:
from tests.platform_tests.mellanox import mellanox_thermal_control_test_helper # noqa F401
mocker_type = BaseMocker.get_mocker_type(mocker_name)
if mocker_type:
mocker_object = mocker_type(dut)
Expand Down
2 changes: 1 addition & 1 deletion tests/platform_tests/api/test_chassis_fans.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

from tests.common.helpers.platform_api import chassis, fan
from .platform_api_test_base import PlatformApiTestBase
from tests.platform_tests.thermal_control_test_helper import start_thermal_control_daemon, stop_thermal_control_daemon
from tests.common.helpers.thermal_control_test_helper import start_thermal_control_daemon, stop_thermal_control_daemon

###################################################
# TODO: Remove this after we transition to Python 3
Expand Down
2 changes: 1 addition & 1 deletion tests/platform_tests/api/test_fan_drawer_fans.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import pytest

from tests.common.helpers.platform_api import chassis, fan_drawer, fan_drawer_fan
from tests.platform_tests.thermal_control_test_helper import start_thermal_control_daemon, stop_thermal_control_daemon
from tests.common.helpers.thermal_control_test_helper import start_thermal_control_daemon, stop_thermal_control_daemon
from .platform_api_test_base import PlatformApiTestBase

###################################################
Expand Down
2 changes: 1 addition & 1 deletion tests/platform_tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
from tests.common.plugins.loganalyzer.loganalyzer import LogAnalyzer
from tests.common.plugins.sanity_check.recover import neighbor_vm_restore
from .args.counterpoll_cpu_usage_args import add_counterpoll_cpu_usage_args
from .mellanox.mellanox_thermal_control_test_helper import suspend_hw_tc_service, resume_hw_tc_service
from tests.common.helpers.mellanox_thermal_control_test_helper import suspend_hw_tc_service, resume_hw_tc_service


TEMPLATES_DIR = os.path.join(os.path.dirname(
Expand Down
4 changes: 2 additions & 2 deletions tests/platform_tests/mellanox/test_psu_power_threshold.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
from tests.common.helpers.assertions import pytest_assert
from tests.common.mellanox_data import get_platform_data
from tests.common.utilities import wait_until # noqa F401
from tests.platform_tests.thermal_control_test_helper import mocker_factory # noqa F401
from .mellanox_thermal_control_test_helper import MockerHelper, PsuPowerThresholdMocker # noqa F401
from tests.common.helpers.thermal_control_test_helper import mocker_factory # noqa F401
from tests.common.helpers.mellanox_thermal_control_test_helper import MockerHelper, PsuPowerThresholdMocker # noqa F401

pytestmark = [
pytest.mark.asic('mellanox'),
Expand Down
2 changes: 1 addition & 1 deletion tests/platform_tests/mellanox/test_reboot_cause.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import logging
import pytest
from tests.common.reboot import REBOOT_TYPE_BIOS, REBOOT_TYPE_ASIC, check_reboot_cause
from tests.platform_tests.thermal_control_test_helper import mocker_factory # noqa: F401
from tests.common.helpers.thermal_control_test_helper import mocker_factory # noqa: F401

pytestmark = [
pytest.mark.asic('mellanox'),
Expand Down
4 changes: 2 additions & 2 deletions tests/platform_tests/test_platform_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@
from tests.common.plugins.loganalyzer.loganalyzer import LogAnalyzer
from tests.common.utilities import wait_until, get_sup_node_or_random_node
from tests.common.platform.device_utils import get_dut_psu_line_pattern
from .thermal_control_test_helper import ThermalPolicyFileContext,\
check_cli_output_with_mocker, restart_thermal_control_daemon, check_thermal_algorithm_status,\
from tests.common.helpers.thermal_control_test_helper import ThermalPolicyFileContext,\
check_cli_output_with_mocker, restart_thermal_control_daemon, check_thermal_algorithm_status, \
mocker_factory, disable_thermal_policy # noqa F401

pytestmark = [
Expand Down
4 changes: 3 additions & 1 deletion tests/snmp/test_snmp_phy_entity.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
from tests.common.utilities import wait_until
from tests.common.helpers.assertions import pytest_require
from tests.common.helpers.snmp_helpers import get_snmp_facts
from tests.platform_tests.thermal_control_test_helper import mocker_factory # noqa F401
from tests.common.helpers.thermal_control_test_helper import mocker_factory # noqa F401

pytestmark = [
pytest.mark.topology('any'),
Expand Down Expand Up @@ -808,6 +808,8 @@ def redis_hgetall(duthost, db_id, key):
return {}
# fix to make literal_eval() work with nested dictionaries
content = content.replace("'{", '"{').replace("}'", '}"')
# Remove any null characters
content = content.replace('\x00', '')
return ast.literal_eval(content)


Expand Down
2 changes: 1 addition & 1 deletion tests/system_health/mellanox/mellanox_device_mocker.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from ..device_mocker import DeviceMocker
from pkg_resources import parse_version
from tests.common.mellanox_data import get_platform_data, get_hw_management_version
from tests.platform_tests.mellanox.mellanox_thermal_control_test_helper import MockerHelper, FanDrawerData, FanData, \
from tests.common.helpers.mellanox_thermal_control_test_helper import MockerHelper, FanDrawerData, FanData, \
FAN_NAMING_RULE

HW_MANAGE_VER = '7.0030.2003'
Expand Down
2 changes: 1 addition & 1 deletion tests/system_health/test_system_health.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
from tests.common.utilities import wait_until
from tests.common.helpers.assertions import pytest_require
from tests.common.plugins.loganalyzer.loganalyzer import LogAnalyzer
from tests.platform_tests.thermal_control_test_helper import disable_thermal_policy # noqa F401
from tests.common.helpers.thermal_control_test_helper import disable_thermal_policy # noqa F401
from .device_mocker import device_mocker_factory # noqa F401
from tests.common.helpers.assertions import pytest_assert
from tests.common.fixtures.duthost_utils import is_support_mock_asic # noqa F401
Expand Down