diff --git a/test/tools_blob_unittest.cpp b/test/tools_blob_unittest.cpp
index cbbb151..f3a01c1 100644
--- a/test/tools_blob_unittest.cpp
+++ b/test/tools_blob_unittest.cpp
@@ -1,19 +1,31 @@
 #include "blob_handler.hpp"
+#include "crc_mock.hpp"
 #include "ipmi_interface_mock.hpp"
 
 #include <gtest/gtest.h>
 
-std::uint16_t expectedCrc = 0;
+CrcInterface* crcIntf = nullptr;
 
 std::uint16_t generateCrc(const std::vector<std::uint8_t>& data)
 {
-    return expectedCrc;
+    return (crcIntf) ? crcIntf->generateCrc(data) : 0x00;
 }
 
 using ::testing::Eq;
 using ::testing::Return;
 
-TEST(BlobHandler, getCountIpmiHappy)
+class BlobHandlerTest : public ::testing::Test
+{
+  protected:
+    void SetUp() override
+    {
+        crcIntf = &crcMock;
+    }
+
+    CrcMock crcMock;
+};
+
+TEST_F(BlobHandlerTest, getCountIpmiHappy)
 {
     /* Verify returns the value specified by the IPMI response. */
     IpmiInterfaceMock ipmiMock;
@@ -25,11 +37,14 @@
     std::vector<std::uint8_t> resp = {0xcf, 0xc2, 0x00, 0x00, 0x00,
                                       0x01, 0x00, 0x00, 0x00};
 
+    std::vector<std::uint8_t> bytes = {0x01, 0x00, 0x00, 0x00};
+    EXPECT_CALL(crcMock, generateCrc(Eq(bytes))).WillOnce(Return(0x00));
+
     EXPECT_CALL(ipmiMock, sendPacket(Eq(request))).WillOnce(Return(resp));
     EXPECT_EQ(1, blob.getBlobCount());
 }
 
-TEST(BlobHandler, enumerateBlobIpmiHappy)
+TEST_F(BlobHandlerTest, enumerateBlobIpmiHappy)
 {
     /* Verify returns the name specified by the IPMI response. */
     IpmiInterfaceMock ipmiMock;
@@ -43,11 +58,16 @@
     std::vector<std::uint8_t> resp = {0xcf, 0xc2, 0x00, 0x00, 0x00,
                                       'a',  'b',  'c',  'd',  0x00};
 
+    std::vector<std::uint8_t> bytes = {'a', 'b', 'c', 'd', 0x00};
+    std::vector<std::uint8_t> reqCrc = {0x01, 0x00, 0x00, 0x00};
+    EXPECT_CALL(crcMock, generateCrc(Eq(reqCrc))).WillOnce(Return(0x00));
+    EXPECT_CALL(crcMock, generateCrc(Eq(bytes))).WillOnce(Return(0x00));
+
     EXPECT_CALL(ipmiMock, sendPacket(Eq(request))).WillOnce(Return(resp));
     EXPECT_STREQ("abcd", blob.enumerateBlob(1).c_str());
 }
 
-TEST(BlobHandler, enumerateBlobIpmiNoBytes)
+TEST_F(BlobHandlerTest, enumerateBlobIpmiNoBytes)
 {
     /* Simulate a case where the IPMI command returns no data. */
     IpmiInterfaceMock ipmiMock;
@@ -60,11 +80,14 @@
     /* return value. */
     std::vector<std::uint8_t> resp = {};
 
+    std::vector<std::uint8_t> reqCrc = {0x01, 0x00, 0x00, 0x00};
+    EXPECT_CALL(crcMock, generateCrc(Eq(reqCrc))).WillOnce(Return(0x00));
+
     EXPECT_CALL(ipmiMock, sendPacket(Eq(request))).WillOnce(Return(resp));
     EXPECT_STREQ("", blob.enumerateBlob(1).c_str());
 }
 
-TEST(BlobHandler, getBlobListIpmiHappy)
+TEST_F(BlobHandlerTest, getBlobListIpmiHappy)
 {
     /* Verify returns the list built via the above two commands. */
     IpmiInterfaceMock ipmiMock;
@@ -77,6 +100,9 @@
     std::vector<std::uint8_t> resp1 = {0xcf, 0xc2, 0x00, 0x00, 0x00,
                                        0x01, 0x00, 0x00, 0x00};
 
+    std::vector<std::uint8_t> bytes1 = {0x01, 0x00, 0x00, 0x00};
+    EXPECT_CALL(crcMock, generateCrc(Eq(bytes1))).WillOnce(Return(0x00));
+
     EXPECT_CALL(ipmiMock, sendPacket(Eq(request1))).WillOnce(Return(resp1));
 
     std::vector<std::uint8_t> request2 = {
@@ -88,6 +114,11 @@
     std::vector<std::uint8_t> resp2 = {0xcf, 0xc2, 0x00, 0x00, 0x00,
                                        'a',  'b',  'c',  'd',  0x00};
 
+    std::vector<std::uint8_t> reqCrc = {0x00, 0x00, 0x00, 0x00};
+    std::vector<std::uint8_t> bytes2 = {'a', 'b', 'c', 'd', 0x00};
+    EXPECT_CALL(crcMock, generateCrc(Eq(reqCrc))).WillOnce(Return(0x00));
+    EXPECT_CALL(crcMock, generateCrc(Eq(bytes2))).WillOnce(Return(0x00));
+
     EXPECT_CALL(ipmiMock, sendPacket(Eq(request2))).WillOnce(Return(resp2));
 
     /* A std::string is not nul-terminated by default. */
@@ -96,7 +127,7 @@
     EXPECT_EQ(expectedList, blob.getBlobList());
 }
 
-TEST(BlobHandler, getStatWithMetadata)
+TEST_F(BlobHandlerTest, getStatWithMetadata)
 {
     /* Stat received metadata. */
     IpmiInterfaceMock ipmiMock;
@@ -110,6 +141,12 @@
     std::vector<std::uint8_t> resp = {0xcf, 0xc2, 0x00, 0x00, 0x00, 0xff, 0xff,
                                       0x00, 0x00, 0x00, 0x00, 0x02, 0x34, 0x45};
 
+    std::vector<std::uint8_t> reqCrc = {'a', 'b', 'c', 'd', 0x00};
+    std::vector<std::uint8_t> respCrc = {0xff, 0xff, 0x00, 0x00, 0x00,
+                                         0x00, 0x02, 0x34, 0x45};
+    EXPECT_CALL(crcMock, generateCrc(Eq(reqCrc))).WillOnce(Return(0x00));
+    EXPECT_CALL(crcMock, generateCrc(Eq(respCrc))).WillOnce(Return(0x00));
+
     EXPECT_CALL(ipmiMock, sendPacket(Eq(request))).WillOnce(Return(resp));
 
     auto meta = blob.getStat("abcd");
@@ -119,7 +156,7 @@
     EXPECT_EQ(metadata, meta.metadata);
 }
 
-TEST(BlobHandler, getStatNoMetadata)
+TEST_F(BlobHandlerTest, getStatNoMetadata)
 {
     /* Stat received no metadata. */
     IpmiInterfaceMock ipmiMock;
@@ -133,6 +170,13 @@
     std::vector<std::uint8_t> resp = {0xcf, 0xc2, 0x00, 0x00, 0x00, 0xff,
                                       0xff, 0x00, 0x00, 0x00, 0x00, 0x00};
 
+    std::vector<std::uint8_t> reqCrc = {'a', 'b', 'c', 'd', 0x00};
+    std::vector<std::uint8_t> respCrc = {0xff, 0xff, 0x00, 0x00,
+                                         0x00, 0x00, 0x00};
+
+    EXPECT_CALL(crcMock, generateCrc(Eq(reqCrc))).WillOnce(Return(0x00));
+    EXPECT_CALL(crcMock, generateCrc(Eq(respCrc))).WillOnce(Return(0x00));
+
     EXPECT_CALL(ipmiMock, sendPacket(Eq(request))).WillOnce(Return(resp));
 
     auto meta = blob.getStat("abcd");
@@ -142,7 +186,7 @@
     EXPECT_EQ(metadata, meta.metadata);
 }
 
-TEST(BlobHandler, openBlobSucceeds)
+TEST_F(BlobHandlerTest, openBlobSucceeds)
 {
     /* The open blob succeeds. */
     IpmiInterfaceMock ipmiMock;
@@ -156,6 +200,11 @@
 
     std::vector<std::uint8_t> resp = {0xcf, 0xc2, 0x00, 0x00, 0x00, 0xfe, 0xed};
 
+    std::vector<std::uint8_t> reqCrc = {0x02, 0x04, 'a', 'b', 'c', 'd', 0x00};
+    std::vector<std::uint8_t> respCrc = {0xfe, 0xed};
+    EXPECT_CALL(crcMock, generateCrc(Eq(reqCrc))).WillOnce(Return(0x00));
+    EXPECT_CALL(crcMock, generateCrc(Eq(respCrc))).WillOnce(Return(0x00));
+
     EXPECT_CALL(ipmiMock, sendPacket(Eq(request))).WillOnce(Return(resp));
 
     auto session =
