process: add IPMI error return mechanism and update errors
The IPMI packet validation code must return specific IPMI errors
corresponding to what error has occurred instead of the invalid command
error.
Update all IPMI handler pieces to return more specific errors.
Change-Id: I8d21e92015d84cc0880e3b83991aed7288e19eab
Signed-off-by: Patrick Venture <venture@google.com>
diff --git a/test/ipmi_stat_unittest.cpp b/test/ipmi_stat_unittest.cpp
index 75f90c4..e7ff277 100644
--- a/test/ipmi_stat_unittest.cpp
+++ b/test/ipmi_stat_unittest.cpp
@@ -39,7 +39,8 @@
dataLen = sizeof(struct BmcBlobStatTx) + blobId.length();
- EXPECT_EQ(IPMI_CC_INVALID, statBlob(&mgr, request, reply, &dataLen));
+ EXPECT_EQ(IPMI_CC_REQ_DATA_LEN_INVALID,
+ statBlob(&mgr, request, reply, &dataLen));
}
TEST(BlobStatTest, RequestRejectedReturnsFailure)
@@ -65,7 +66,8 @@
Matcher<struct BlobMeta*>(_)))
.WillOnce(Return(false));
- EXPECT_EQ(IPMI_CC_INVALID, statBlob(&mgr, request, reply, &dataLen));
+ EXPECT_EQ(IPMI_CC_UNSPECIFIED_ERROR,
+ statBlob(&mgr, request, reply, &dataLen));
}
TEST(BlobStatTest, RequestSucceedsNoMetadata)