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
190 changes: 22 additions & 168 deletions tests/common/mellanox_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
SWITCH_HWSKUS = SPC1_HWSKUS + SPC2_HWSKUS + SPC3_HWSKUS

SWITCH_MODELS = {
"ACS-MSN2700": {
"x86_64-mlnx_msn2700-r0": {
"reboot": {
"cold_reboot": True,
"fast_reboot": True,
Expand Down Expand Up @@ -55,107 +55,7 @@
}
}
},
"Mellanox-SN2700": {
"reboot": {
"cold_reboot": True,
"fast_reboot": True,
"warm_reboot": True
},
"fans": {
"number": 4,
"hot_swappable": True
},
"psus": {
"number": 2,
"hot_swappable": True
},
"cpu_pack": {
"number": 1
},
"cpu_cores": {
"number": 2
},
"ports": {
"number": 32
},
"thermals": {
"cpu_core": {
"start": 0,
"number": 2
},
"module": {
"start": 1,
"number": 32
},
"psu": {
"start": 1,
"number": 2
},
"cpu_pack": {
"number": 1
},
"asic_ambient": {
"number": 1
},
"port_ambient": {
"number": 1
},
"fan_ambient": {
"number": 1
}
}
},
"Mellanox-SN2700-D48C8": {
"reboot": {
"cold_reboot": True,
"fast_reboot": True,
"warm_reboot": True
},
"fans": {
"number": 4,
"hot_swappable": True
},
"psus": {
"number": 2,
"hot_swappable": True
},
"cpu_pack": {
"number": 1
},
"cpu_cores": {
"number": 2
},
"ports": {
"number": 32
},
"thermals": {
"cpu_core": {
"start": 0,
"number": 2
},
"module": {
"start": 1,
"number": 32
},
"psu": {
"start": 1,
"number": 2
},
"cpu_pack": {
"number": 1
},
"asic_ambient": {
"number": 1
},
"port_ambient": {
"number": 1
},
"fan_ambient": {
"number": 1
}
}
},
"ACS-MSN2740": {
"x86_64-mlnx_msn2740-r0": {
"reboot": {
"cold_reboot": True,
"fast_reboot": True,
Expand Down Expand Up @@ -202,7 +102,7 @@
}
}
},
"ACS-MSN2410": {
"x86_64-mlnx_msn2410-r0": {
"reboot": {
"cold_reboot": True,
"fast_reboot": True,
Expand Down Expand Up @@ -252,7 +152,7 @@
}
}
},
"ACS-MSN2010": {
"x86_64-mlnx_msn2010-r0": {
"reboot": {
"cold_reboot": True,
"fast_reboot": True,
Expand Down Expand Up @@ -295,7 +195,7 @@
}
}
},
"ACS-MSN2100": {
"x86_64-mlnx_msn2100-r0": {
"reboot": {
"cold_reboot": True,
"fast_reboot": True,
Expand Down Expand Up @@ -338,64 +238,7 @@
}
}
},
"ACS-MSN3800": {
"reboot": {
"cold_reboot": True,
"fast_reboot": False,
"warm_reboot": True
},
"fans": {
"number": 3,
"hot_swappable": True
},
"psus": {
"number": 2,
"hot_swappable": True
},
"cpu_pack": {
"number": 1
},
"cpu_cores": {
"number": 4
},
"ports": {
"number": 64
},
"thermals": {
"cpu_core": {
"start": 0,
"number": 4
},
"module": {
"start": 1,
"number": 64
},
"psu": {
"start": 1,
"number": 2
},
"cpu_pack": {
"number": 1
},
"gearbox": {
"start": 1,
"number": 32
},
"asic_ambient": {
"number": 1
},
"port_ambient": {
"number": 1
},
"fan_ambient": {
"number": 1
},
"comex_ambient": {
"number": 1
}
}
},
"Mellanox-SN3800-D112C8": {
"x86_64-mlnx_msn3800-r0": {
"reboot": {
"cold_reboot": True,
"fast_reboot": False,
Expand Down Expand Up @@ -452,7 +295,7 @@
}
}
},
"ACS-MSN3700": {
"x86_64-mlnx_msn3700-r0": {
"reboot": {
"cold_reboot": True,
"fast_reboot": False,
Expand Down Expand Up @@ -505,7 +348,7 @@
}
}
},
"ACS-MSN3700C": {
"x86_64-mlnx_msn3700c-r0": {
"reboot": {
"cold_reboot": True,
"fast_reboot": False,
Expand Down Expand Up @@ -558,7 +401,7 @@
}
}
},
"ACS-MSN4700": {
"x86_64-mlnx_msn4700-r0": {
"reboot": {
"cold_reboot": True,
"fast_reboot": False,
Expand Down Expand Up @@ -611,7 +454,7 @@
}
}
},
"ACS-MSN4600C": {
"x86_64-mlnx_msn4600c-r0": {
"reboot": {
"cold_reboot": True,
"fast_reboot": False,
Expand Down Expand Up @@ -664,7 +507,7 @@
}
}
},
"ACS-MSN3420": {
"x86_64-mlnx_msn3420-r0": {
"reboot": {
"cold_reboot": True,
"fast_reboot": False,
Expand Down Expand Up @@ -719,5 +562,16 @@
}
}


def is_mellanox_device(dut):
return dut.facts["asic_type"] == "mellanox"


def get_platform_data(dut):
"""
Get the platform physical data for the given dut object
:param dut: dut object
:return: A dictionary contains the platform physical data
"""
dut_platform = dut.facts["platform"]
return SWITCH_MODELS[dut_platform]
2 changes: 1 addition & 1 deletion tests/platform_tests/args/normal_reboot_args.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ def add_normal_reboot_args(parser):
# If this option is not specified, [5, 15] will be used by default, see function pytest_generate_tests in
# tests/platform_tests/conftest.py
parser.addoption("--power_off_delay", action="store", type=str, default='5,15',
help="Power off delay seconds for test_power_off_reboot")
help="Power off delay seconds for test_power_off_reboot")
2 changes: 1 addition & 1 deletion tests/platform_tests/conftest.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import pytest

from tests.common.fixtures.advanced_reboot import get_advanced_reboot
from .args.normal_reboot_args import add_normal_reboot_args
from .args.advanced_reboot_args import add_advanced_reboot_args
from .args.cont_warm_reboot_args import add_cont_warm_reboot_args
from .args.normal_reboot_args import add_normal_reboot_args
Expand Down
Loading