Example #1
0
    def test_get_presence(self, duthost, localhost, platform_api_conn):
        if self.num_modules == 0:
            pytest.skip("No modules found on device")

        for i in range(self.num_modules):
            presence = module.get_presence(platform_api_conn, i)
            pytest_assert(presence is not None,
                          "Module {}: Unable to retrieve presence".format(i))
            pytest_assert(isinstance(presence, bool),
                          "Module {}: Presence appears incorrect".format(i))
            # All modules are expected to be present on DuT
            pytest_assert(presence is True, "Module {} not present".format(i))
Example #2
0
    def test_get_presence(self, duthost, localhost, platform_api_conn):
        if self.num_modules == 0:
            pytest.skip("No modules found on device")

        for i in range(self.num_modules):
            presence = module.get_presence(platform_api_conn, i)
            if self.expect(presence is not None,
                           "Unable to retrieve module {} presence".format(i)):
                if self.expect(
                        isinstance(presence, bool),
                        "Module {} presence appears incorrect".format(i)):
                    self.expect(presence is True,
                                "Module {} is not present".format(i))
        self.assert_expectations()
Example #3
0
    def test_get_presence(self, duthosts, enum_rand_one_per_hwsku_hostname,
                          localhost, platform_api_conn):

        for i in range(self.num_modules):
            presence = module.get_presence(platform_api_conn, i)
            if self.expect(presence is not None,
                           "Unable to retrieve module {} presence".format(i)):
                if self.expect(
                        isinstance(presence, bool),
                        "Module {} presence appears incorrect".format(i)):
                    name = module.get_name(platform_api_conn, i)
                    if name in self.skip_mod_list:
                        self.expect(presence is False,
                                    "Module {} is not present".format(i))
                    else:
                        self.expect(presence is True,
                                    "Module {} is not present".format(i))
        self.assert_expectations()