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

        # Ensure the base MAC address of each module is sane
        # TODO: Add expected base MAC address for each module to inventory file and compare against it
        for i in range(self.num_modules):
            base_mac = module.get_base_mac(platform_api_conn, i)
            pytest_assert(
                base_mac is not None,
                "Module {}: Failed to retrieve base MAC address".format(i))
            pytest_assert(
                re.match(REGEX_MAC_ADDRESS, base_mac),
                "Module {}: Base MAC address appears to be incorrect".format(
                    i))
Example #2
0
    def test_get_base_mac(self, duthosts, enum_rand_one_per_hwsku_hostname,
                          localhost, platform_api_conn):

        # Ensure the base MAC address of each module is sane
        # TODO: Add expected base MAC address for each module to inventory file and compare against it
        for i in range(self.num_modules):
            base_mac = module.get_base_mac(platform_api_conn, i)
            if not self.expect(
                    base_mac is not None,
                    "Module {}: Failed to retrieve base MAC address".format(
                        i)):
                continue
            self.expect(
                re.match(REGEX_MAC_ADDRESS, base_mac),
                "Module {}: Base MAC address appears to be incorrect".format(
                    i))
        self.assert_expectations()