Ejemplo n.º 1
0
    def test_get_temperature(self, duthosts, enum_rand_one_per_hwsku_hostname, localhost, platform_api_conn):
        for i in range(self.num_thermals):
            temperature = thermal.get_temperature(platform_api_conn, i)

            if self.expect(temperature is not None, "Unable to retrieve Thermal {} temperature".format(i)):
                self.expect(isinstance(temperature, float), "Thermal {} temperature appears incorrect".format(i))
        self.assert_expectations()
Ejemplo n.º 2
0
    def test_get_temperature(self, duthost, localhost, platform_api_conn):
        for i in range(self.num_thermals):
            temperature = thermal.get_temperature(platform_api_conn, i)

            if self.expect(temperature is not None, "Unable to retrieve Thermal {} temperature".format(i)):
                if self.expect(isinstance(temperature, float), "Thermal {} temperature appears incorrect".format(i)):
                    self.expect(temperature >= 0 and temperature <= 100,
                                "Thermal {} temperature {} reading is not within range".format(i, temperature))
        self.assert_expectations()