Пример #1
0
    def test_get_low_critical_threshold(self, duthosts,
                                        enum_rand_one_per_hwsku_hostname,
                                        localhost, platform_api_conn):
        duthost = duthosts[enum_rand_one_per_hwsku_hostname]
        thermals_skipped = 0

        for i in range(self.num_thermals):
            threshold_supported = self.get_thermal_facts(
                duthost, i, True, "low-crit-threshold")
            if not threshold_supported:
                logger.info(
                    "test_get_low_critical_threshold: Skipping thermal {} (threshold not supported)"
                    .format(i))
                thermals_skipped += 1
                continue

            low_critical_threshold = thermal.get_low_critical_threshold(
                platform_api_conn, i)

            # Ensure the thermal low critical threshold temperature is sane
            if self.expect(
                    low_critical_threshold is not None,
                    "Unable to retrieve Thermal {} low critical threshold".
                    format(i)):
                self.expect(
                    isinstance(low_critical_threshold, float),
                    "Thermal {} low threshold appears incorrect".format(i))
        if thermals_skipped == self.num_thermals:
            pytest.skip(
                "skipped as all chassis thermals' low-critical-threshold is not supported"
            )

        self.assert_expectations()
Пример #2
0
    def test_get_low_critical_threshold(self, duthost, localhost, platform_api_conn):
        # Ensure the thermal low critical threshold temperature is sane
        for i in range(self.num_thermals):
            low_critical_threshold = thermal.get_low_critical_threshold(platform_api_conn, i)

            if self.expect(low_critical_threshold is not None, "Unable to retrieve Thermal {} low critical threshold".format(i)):
                if self.expect(isinstance(low_critical_threshold, float), "Thermal {} low threshold appears incorrect".format(i)):
                    self.expect(low_critical_threshold >= 0 and low_critical_threshold <= 110,
                                "Thermal {} low critical threshold {} reading is not within range".format(i, low_critical_threshold))
        self.assert_expectations()
Пример #3
0
    def test_get_low_critical_threshold(self, duthosts,
                                        enum_rand_one_per_hwsku_hostname,
                                        localhost, platform_api_conn):
        # Ensure the thermal low critical threshold temperature is sane
        for i in range(self.num_thermals):
            low_critical_threshold = thermal.get_low_critical_threshold(
                platform_api_conn, i)

            if self.expect(
                    low_critical_threshold is not None,
                    "Unable to retrieve Thermal {} low critical threshold".
                    format(i)):
                self.expect(
                    isinstance(low_critical_threshold, float),
                    "Thermal {} low threshold appears incorrect".format(i))
        self.assert_expectations()