def test_get_tx_bias(self, duthost, localhost, platform_api_conn): # TODO: Do more sanity checking on the data we retrieve for i in range(self.num_sfps): tx_bias = sfp.get_tx_bias(platform_api_conn, i) if self.expect(tx_bias is not None, "Unable to retrieve transceiver {} TX bias data".format(i)): self.expect(isinstance(tx_bias, list) and (all(isinstance(item, float) for item in tx_bias)), "Transceiver {} TX bias data appears incorrect".format(i)) self.assert_expectations()
def test_get_tx_bias(self, duthosts, enum_rand_one_per_hwsku_hostname, localhost, platform_api_conn): duthost = duthosts[enum_rand_one_per_hwsku_hostname] skip_release_for_platform(duthost, ["202012"], ["arista", "mlnx"]) # TODO: Do more sanity checking on the data we retrieve for i in self.sfp_setup["sfp_test_port_indices"]: info_dict = sfp.get_transceiver_info(platform_api_conn, i) # Determine whether the transceiver type supports TX Bias if not self.is_xcvr_optical(info_dict): logger.warning("test_get_tx_bias: Skipping transceiver {} (not applicable for this transceiver type)".format(i)) continue tx_bias = sfp.get_tx_bias(platform_api_conn, i) if self.expect(tx_bias is not None, "Unable to retrieve transceiver {} TX bias data".format(i)): self.expect(isinstance(tx_bias, list) and (all(isinstance(item, float) for item in tx_bias)), "Transceiver {} TX bias data appears incorrect".format(i)) self.assert_expectations()