def test_execute_set_fan_speed_action(): chassis = MockChassis() fan_list = chassis.get_all_fans() fan_list.append(MockFan()) fan_list.append(MockFan()) fan_info = FanInfo() fan_info.collect(chassis) from sonic_platform.thermal_actions import SetAllFanSpeedAction action = SetAllFanSpeedAction() action.speed = 99 action.execute({'fan_info': fan_info}) assert fan_list[0].speed == 99 assert fan_list[1].speed == 99
def test_execute_set_fan_speed_action(): chassis = MockChassis() chassis.get_all_fan_drawers().append(MockFanDrawer()) fan_list = chassis.get_all_fan_drawers()[0].get_all_fans() fan_list.append(MockFan()) fan_list.append(MockFan()) fan_info = FanInfo() fan_info.collect(chassis) Thermal.expect_cooling_level = None from sonic_platform.thermal_actions import SetAllFanSpeedAction action = SetAllFanSpeedAction() action.speed = 20 action.execute({'fan_info': fan_info}) assert Thermal.expect_cooling_level == 2