Skip to content

Commit 6e18086

Browse files
Harshit Gulatimeta-codesync[bot]
authored andcommitted
HW Test to verify Transceiver Error states
Summary: title Differential Revision: D90925167 fbshipit-source-id: d3d66d91e2cf756f8012e791132c1267e65abe35
1 parent e504387 commit 6e18086

File tree

3 files changed

+17
-0
lines changed

3 files changed

+17
-0
lines changed

fboss/qsfp_service/test/hw_test/HwPortProfileTest.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,8 @@ class HwPortProfileTest : public HwTest {
128128
transceivers);
129129
utility::HwTransceiverUtils::verifyTempAndVccFlags(
130130
portToTransceiverInfoMap);
131+
utility::HwTransceiverUtils::verifyTcvrErrorStates(
132+
portToTransceiverInfoMap);
131133
};
132134
verifyAcrossWarmBoots(setup, verify);
133135
}

fboss/qsfp_service/test/hw_test/HwTransceiverUtils.cpp

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,18 @@ void HwTransceiverUtils::verifyTempAndVccFlags(
4040
}
4141
}
4242

43+
void HwTransceiverUtils::verifyTcvrErrorStates(
44+
std::map<std::string, TransceiverInfo>& portToTransceiverInfoMap) {
45+
for (auto& [_, transceiverInfo] : portToTransceiverInfoMap) {
46+
auto& tcvrState = *transceiverInfo.tcvrState();
47+
auto tcvrID = *tcvrState.port();
48+
EXPECT_TRUE(tcvrState.errorStates()->empty()) << folly::sformat(
49+
"{:d} has error states {:s}",
50+
tcvrID,
51+
folly::join(",", *tcvrState.errorStates()));
52+
}
53+
}
54+
4355
void HwTransceiverUtils::verifyPortNameToLaneMap(
4456
const std::vector<PortID>& portIDs,
4557
cfg::PortProfileID profile,

fboss/qsfp_service/test/hw_test/HwTransceiverUtils.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,9 @@ class HwTransceiverUtils {
4040
static void verifyTempAndVccFlags(
4141
std::map<std::string, TransceiverInfo>& portToTransceiverInfoMap);
4242

43+
static void verifyTcvrErrorStates(
44+
std::map<std::string, TransceiverInfo>& portToTransceiverInfoMap);
45+
4346
static void verifyDatapathResetTimestamp(
4447
const std::string& portName,
4548
const TcvrState& tcvrState,

0 commit comments

Comments
 (0)