Beispiel #1
0
    def test_set_low_threshold(self, duthosts, enum_rand_one_per_hwsku_hostname, localhost, platform_api_conn):
        duthost = duthosts[enum_rand_one_per_hwsku_hostname]
        thermals_skipped = 0
        skip_release_for_platform(duthost, ["202012", "201911", "201811"], ["arista"])

        # Ensure the thermal temperature is sane
        for i in range(self.num_thermals):
            threshold_supported = self.get_thermal_facts(duthost, i, True, "low-threshold")
            threshold_controllable = self.get_thermal_facts(duthost, i, True, "controllable")
            if not threshold_supported or not threshold_controllable:
                logger.info("test_set_low_threshold: Skipping thermal {} (threshold not supported or controllable)".format(i))
                thermals_skipped += 1
                continue

            low_temperature = 20
            result = thermal.set_low_threshold(platform_api_conn, i, low_temperature)
            if self.expect(result is not None, "Failed to perform set_low_threshold"):
                self.expect(result is True, "Failed to set set_low_threshold for thermal {} to {}".format(i, low_temperature))

            temperature = thermal.get_low_threshold(platform_api_conn, i)
            if self.expect(temperature is not None, "Unable to retrieve Thermal {} low threshold".format(i)):
                if self.expect(isinstance(temperature, float), "Thermal {} low threshold appears incorrect".format(i)):
                    self.expect(temperature == 20,
                                "Thermal {} low threshold {} is not matching the set value {}".format(i, temperature, low_temperature))

        if thermals_skipped == self.num_thermals:
            pytest.skip("skipped as all chassis thermals' low-threshold is not controllable")

        self.assert_expectations()
Beispiel #2
0
    def test_set_low_threshold(self, duthost, localhost, platform_api_conn):
        # Ensure the thermal temperature is sane
        for i in range(self.num_thermals):
            low_temperature = 20
            result = thermal.set_low_threshold(platform_api_conn, i,
                                               low_temperature)
            if self.expect(result is not None,
                           "Failed to perform set_low_threshold"):
                self.expect(
                    result is True,
                    "Failed to set set_low_threshold for thermal {} to {}".
                    format(i, low_temperature))

            temperature = thermal.get_low_threshold(platform_api_conn, i)
            if self.expect(
                    temperature is not None,
                    "Unable to retrieve Thermal {} low threshold".format(i)):
                if self.expect(
                        isinstance(temperature, float),
                        "Thermal {} low threshold appears incorrect".format(
                            i)):
                    self.expect(
                        temperature == 20,
                        "Thermal {} low threshold {} is not matching the set value {}"
                        .format(i, temperature, low_temperature))

        self.assert_expectations()
Beispiel #3
0
    def test_set_low_threshold(self, duthosts,
                               enum_rand_one_per_hwsku_hostname, localhost,
                               platform_api_conn):
        duthost = duthosts[enum_rand_one_per_hwsku_hostname]
        skip_release_for_platform(duthost, ["202012", "201911", "201811"],
                                  ["arista"])

        # Ensure the thermal temperature is sane
        for i in range(self.num_thermals):
            low_temperature = 20
            result = thermal.set_low_threshold(platform_api_conn, i,
                                               low_temperature)
            if self.expect(result is not None,
                           "Failed to perform set_low_threshold"):
                self.expect(
                    result is True,
                    "Failed to set set_low_threshold for thermal {} to {}".
                    format(i, low_temperature))

            temperature = thermal.get_low_threshold(platform_api_conn, i)
            if self.expect(
                    temperature is not None,
                    "Unable to retrieve Thermal {} low threshold".format(i)):
                if self.expect(
                        isinstance(temperature, float),
                        "Thermal {} low threshold appears incorrect".format(
                            i)):
                    self.expect(
                        temperature == 20,
                        "Thermal {} low threshold {} is not matching the set value {}"
                        .format(i, temperature, low_temperature))

        self.assert_expectations()