Exemplo n.º 1
0
    def test_get_high_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, "high-crit-threshold")
            if not threshold_supported:
                logger.info(
                    "test_get_high_critical_threshold: Skipping thermal {} (threshold not supported)"
                    .format(i))
                thermals_skipped += 1
                continue

            high_critical_threshold = thermal.get_high_critical_threshold(
                platform_api_conn, i)

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

        self.assert_expectations()
Exemplo n.º 2
0
    def test_get_high_critical_threshold(self, duthost, localhost, platform_api_conn):
        # Ensure the thermal high threshold temperature is sane
        for i in range(self.num_thermals):
            high_critical_threshold = thermal.get_high_critical_threshold(platform_api_conn, i)

            if self.expect(high_critical_threshold is not None, "Unable to retrieve Thermal {} high critical threshold".format(i)):
                if self.expect(isinstance(high_critical_threshold, float), "Thermal {} high threshold appears incorrect".format(i)):
                    self.expect(high_critical_threshold > 0 and high_critical_threshold <= 110,
                                "Thermal {} high critical threshold {} reading is not within range".format(i, high_critical_threshold))
        self.assert_expectations()
Exemplo n.º 3
0
    def test_get_high_critical_threshold(self, duthosts,
                                         enum_rand_one_per_hwsku_hostname,
                                         localhost, platform_api_conn):
        # Ensure the thermal high threshold temperature is sane
        for i in range(self.num_thermals):
            high_critical_threshold = thermal.get_high_critical_threshold(
                platform_api_conn, i)

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