コード例 #1
0
    def test_get_name(self, duthosts, enum_rand_one_per_hwsku_hostname, localhost, platform_api_conn):
        duthost = duthosts[enum_rand_one_per_hwsku_hostname]
        for j in range(self.num_fan_drawers):
            num_fans = fan_drawer.get_num_fans(platform_api_conn, j)

            for i in range(num_fans):
                name = fan_drawer_fan.get_name(platform_api_conn, j ,i)

                if self.expect(name is not None, "Unable to retrieve fan drawer {} fan {} name".format(j, i)):
                    self.expect(isinstance(name, STRING_TYPE), "fan drawer {} fan {} name appears incorrect".format(j, i))
                    self.compare_value_with_platform_facts(duthost, 'name', name, j, i)

        self.assert_expectations()
コード例 #2
0
    def test_get_presence(self, duthosts, enum_rand_one_per_hwsku_hostname, localhost, platform_api_conn):

        for j in range(self.num_fan_drawers):
            num_fans = fan_drawer.get_num_fans(platform_api_conn, j)

            for i in range(num_fans):
                name = fan_drawer_fan.get_name(platform_api_conn, j ,i)

                presence = fan_drawer_fan.get_presence(platform_api_conn, j, i)

                if self.expect(presence is not None, "Unable to retrieve fan drawer {} fan {} presence".format(j, i)):
                    if self.expect(isinstance(presence, bool), "Fan drawer {} fan {} presence appears incorrect".format(j, i)):
                        self.expect(presence is True, "Fan {} is not present".format(j, i))

        self.assert_expectations()