diff options
Diffstat (limited to 'test/tools_blob_unittest.cpp')
-rw-r--r-- | test/tools_blob_unittest.cpp | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/test/tools_blob_unittest.cpp b/test/tools_blob_unittest.cpp index 75e43cb..e9f2c96 100644 --- a/test/tools_blob_unittest.cpp +++ b/test/tools_blob_unittest.cpp @@ -295,6 +295,28 @@ TEST_F(BlobHandlerTest, closeBlobSucceeds) blob.closeBlob(0x0001); } +TEST_F(BlobHandlerTest, commitSucceedsNoData) +{ + /* The commit succeeds. */ + auto ipmi = CreateIpmiMock(); + IpmiInterfaceMock* ipmiMock = + reinterpret_cast<IpmiInterfaceMock*>(ipmi.get()); + BlobHandler blob(std::move(ipmi)); + + std::vector<std::uint8_t> request = { + 0xcf, 0xc2, 0x00, BlobHandler::BlobOEMCommands::bmcBlobCommit, + 0x00, 0x00, 0x01, 0x00, + 0x00}; + + std::vector<std::uint8_t> resp = {0xcf, 0xc2, 0x00}; + std::vector<std::uint8_t> reqCrc = {0x01, 0x00, 0x00}; + EXPECT_CALL(crcMock, generateCrc(Eq(reqCrc))).WillOnce(Return(0x00)); + + EXPECT_CALL(*ipmiMock, sendPacket(Eq(request))).WillOnce(Return(resp)); + + blob.commit(0x0001, {}); +} + TEST_F(BlobHandlerTest, writeBytesSucceeds) { /* The write bytes succeeds. */ |