bmc: move away from blobs namespace
The blobs namespace is really owned by phosphor-ipmi-blobs. Move all
phosphor-ipmi-flash objects into ipmi_flash namespace.
Signed-off-by: Patrick Venture <venture@google.com>
Change-Id: I51b721ad4f3cdc4cc43846c942967ed2e5f16589
diff --git a/test/data_interface_mock.hpp b/test/data_interface_mock.hpp
index 3e8f24a..3189e5b 100644
--- a/test/data_interface_mock.hpp
+++ b/test/data_interface_mock.hpp
@@ -15,7 +15,7 @@
MOCK_METHOD2(sendContents, bool(const std::string&, std::uint16_t));
MOCK_CONST_METHOD0(supportedType,
- blobs::FirmwareBlobHandler::UpdateFlags());
+ ipmi_flash::FirmwareBlobHandler::UpdateFlags());
};
} // namespace host_tool
diff --git a/test/data_mock.hpp b/test/data_mock.hpp
index ae8c9c7..c8109ad 100644
--- a/test/data_mock.hpp
+++ b/test/data_mock.hpp
@@ -4,7 +4,7 @@
#include <gmock/gmock.h>
-namespace blobs
+namespace ipmi_flash
{
class DataHandlerMock : public DataInterface
@@ -19,4 +19,4 @@
MOCK_METHOD0(readMeta, std::vector<std::uint8_t>());
};
-} // namespace blobs
+} // namespace ipmi_flash
diff --git a/test/file_handler_unittest.cpp b/test/file_handler_unittest.cpp
index 26a490d..ab12125 100644
--- a/test/file_handler_unittest.cpp
+++ b/test/file_handler_unittest.cpp
@@ -7,7 +7,7 @@
#include <gtest/gtest.h>
-namespace blobs
+namespace ipmi_flash
{
static constexpr auto TESTPATH = "test.output";
@@ -55,4 +55,4 @@
/* annoyingly the memcmp was failing... but it's the same data. */
}
-} // namespace blobs
+} // namespace ipmi_flash
diff --git a/test/firmware_canhandle_unittest.cpp b/test/firmware_canhandle_unittest.cpp
index 380df45..02549fe 100644
--- a/test/firmware_canhandle_unittest.cpp
+++ b/test/firmware_canhandle_unittest.cpp
@@ -8,7 +8,7 @@
#include <gtest/gtest.h>
-namespace blobs
+namespace ipmi_flash
{
TEST(FirmwareHandlerCanHandleTest, VerifyItemsInListAreOk)
{
@@ -40,4 +40,4 @@
EXPECT_EQ(item.expected, handler->canHandleBlob(item.name));
}
}
-} // namespace blobs
+} // namespace ipmi_flash
diff --git a/test/firmware_close_unittest.cpp b/test/firmware_close_unittest.cpp
index 2b40d6d..6242d54 100644
--- a/test/firmware_close_unittest.cpp
+++ b/test/firmware_close_unittest.cpp
@@ -11,7 +11,7 @@
#include <gmock/gmock.h>
#include <gtest/gtest.h>
-namespace blobs
+namespace ipmi_flash
{
using ::testing::Eq;
using ::testing::Return;
@@ -30,7 +30,7 @@
EXPECT_CALL(imageMock, open(StrEq(hashBlobId))).WillOnce(Return(true));
EXPECT_TRUE(handler->open(
- 0, OpenFlags::write | FirmwareBlobHandler::UpdateFlags::lpc,
+ 0, blobs::OpenFlags::write | FirmwareBlobHandler::UpdateFlags::lpc,
hashBlobId));
/* The active hash blob_id was added. */
@@ -57,7 +57,7 @@
EXPECT_CALL(imageMock, open(StrEq(hashBlobId))).WillOnce(Return(true));
EXPECT_TRUE(handler->open(
- 0, OpenFlags::write | FirmwareBlobHandler::UpdateFlags::ipmi,
+ 0, blobs::OpenFlags::write | FirmwareBlobHandler::UpdateFlags::ipmi,
hashBlobId));
/* The active hash blob_id was added. */
@@ -71,4 +71,4 @@
EXPECT_TRUE(handler->close(0));
}
-} // namespace blobs
+} // namespace ipmi_flash
diff --git a/test/firmware_commit_unittest.cpp b/test/firmware_commit_unittest.cpp
index b3d023f..5f2f82e 100644
--- a/test/firmware_commit_unittest.cpp
+++ b/test/firmware_commit_unittest.cpp
@@ -9,7 +9,7 @@
#include <gtest/gtest.h>
-namespace blobs
+namespace ipmi_flash
{
using ::testing::_;
using ::testing::IsNull;
@@ -54,7 +54,8 @@
EXPECT_CALL(imageMock2, open("asdf")).WillOnce(Return(true));
EXPECT_TRUE(handler->open(
- 0, OpenFlags::write | FirmwareBlobHandler::UpdateFlags::ipmi, "asdf"));
+ 0, blobs::OpenFlags::write | FirmwareBlobHandler::UpdateFlags::ipmi,
+ "asdf"));
EXPECT_FALSE(handler->commit(0, {}));
}
@@ -75,7 +76,7 @@
EXPECT_CALL(imageMock1, open(StrEq(hashBlobId))).WillOnce(Return(true));
EXPECT_TRUE(handler->open(
- 0, OpenFlags::write | FirmwareBlobHandler::UpdateFlags::ipmi,
+ 0, blobs::OpenFlags::write | FirmwareBlobHandler::UpdateFlags::ipmi,
hashBlobId));
EXPECT_FALSE(handler->commit(0, {}));
@@ -92,7 +93,7 @@
auto handler = FirmwareBlobHandler::CreateFirmwareBlobHandler(
blobs, data, std::move(verifyMock));
- EXPECT_TRUE(handler->open(0, OpenFlags::write, verifyBlobId));
+ EXPECT_TRUE(handler->open(0, blobs::OpenFlags::write, verifyBlobId));
EXPECT_CALL(*verifyMockPtr, triggerVerification())
.WillRepeatedly(Return(true));
@@ -111,7 +112,7 @@
auto handler = FirmwareBlobHandler::CreateFirmwareBlobHandler(
blobs, data, std::move(verifyMock));
- EXPECT_TRUE(handler->open(0, OpenFlags::write, verifyBlobId));
+ EXPECT_TRUE(handler->open(0, blobs::OpenFlags::write, verifyBlobId));
EXPECT_CALL(*verifyMockPtr, triggerVerification())
.WillRepeatedly(Return(true));
@@ -120,4 +121,4 @@
EXPECT_TRUE(handler->commit(0, {}));
}
-} // namespace blobs
+} // namespace ipmi_flash
diff --git a/test/firmware_createhandler_unittest.cpp b/test/firmware_createhandler_unittest.cpp
index 4821ffa..10e8410 100644
--- a/test/firmware_createhandler_unittest.cpp
+++ b/test/firmware_createhandler_unittest.cpp
@@ -6,7 +6,7 @@
#include <gtest/gtest.h>
-namespace blobs
+namespace ipmi_flash
{
using ::testing::Return;
using ::testing::StrEq;
@@ -37,4 +37,4 @@
EXPECT_FALSE(handler == nullptr);
}
-} // namespace blobs
+} // namespace ipmi_flash
diff --git a/test/firmware_delete_unittest.cpp b/test/firmware_delete_unittest.cpp
index de67a15..755dc30 100644
--- a/test/firmware_delete_unittest.cpp
+++ b/test/firmware_delete_unittest.cpp
@@ -9,7 +9,7 @@
#include <gmock/gmock.h>
#include <gtest/gtest.h>
-namespace blobs
+namespace ipmi_flash
{
using ::testing::Eq;
using ::testing::Return;
@@ -36,7 +36,7 @@
EXPECT_CALL(imageMock, open(StrEq(hashBlobId))).WillOnce(Return(true));
EXPECT_TRUE(handler->open(
- 0, OpenFlags::write | FirmwareBlobHandler::UpdateFlags::ipmi,
+ 0, blobs::OpenFlags::write | FirmwareBlobHandler::UpdateFlags::ipmi,
hashBlobId));
/* The active hash blob_id was added. */
@@ -63,4 +63,4 @@
activeHashBlobId));
}
-} // namespace blobs
+} // namespace ipmi_flash
diff --git a/test/firmware_handler_unittest.cpp b/test/firmware_handler_unittest.cpp
index 09cbf9e..d3a8c13 100644
--- a/test/firmware_handler_unittest.cpp
+++ b/test/firmware_handler_unittest.cpp
@@ -8,7 +8,7 @@
#include <gtest/gtest.h>
-namespace blobs
+namespace ipmi_flash
{
TEST(FirmwareHandlerTest, CreateEmptyListVerifyFails)
@@ -60,4 +60,4 @@
std::count(result.begin(), result.end(), hashBlobId) +
std::count(result.begin(), result.end(), verifyBlobId));
}
-} // namespace blobs
+} // namespace ipmi_flash
diff --git a/test/firmware_open_unittest.cpp b/test/firmware_open_unittest.cpp
index c8c93c0..4da41a1 100644
--- a/test/firmware_open_unittest.cpp
+++ b/test/firmware_open_unittest.cpp
@@ -11,7 +11,7 @@
#include <gmock/gmock.h>
#include <gtest/gtest.h>
-namespace blobs
+namespace ipmi_flash
{
using ::testing::Eq;
using ::testing::Return;
@@ -32,7 +32,8 @@
EXPECT_CALL(imageMock, open("asdf")).WillOnce(Return(true));
EXPECT_TRUE(handler->open(
- 0, OpenFlags::write | FirmwareBlobHandler::UpdateFlags::ipmi, "asdf"));
+ 0, blobs::OpenFlags::write | FirmwareBlobHandler::UpdateFlags::ipmi,
+ "asdf"));
/* The active image blob_id was added. */
auto currentBlobs = handler->getBlobIds();
@@ -47,7 +48,7 @@
EXPECT_CALL(imageMock, open(StrEq(hashBlobId))).WillOnce(Return(true));
EXPECT_TRUE(handler->open(
- 0, OpenFlags::write | FirmwareBlobHandler::UpdateFlags::ipmi,
+ 0, blobs::OpenFlags::write | FirmwareBlobHandler::UpdateFlags::ipmi,
hashBlobId));
/* The active hash blob_id was added. */
@@ -66,7 +67,7 @@
EXPECT_CALL(imageMock, open(StrEq(hashBlobId))).WillOnce(Return(true));
EXPECT_TRUE(handler->open(
- 0, OpenFlags::write | FirmwareBlobHandler::UpdateFlags::lpc,
+ 0, blobs::OpenFlags::write | FirmwareBlobHandler::UpdateFlags::lpc,
hashBlobId));
/* The active hash blob_id was added. */
@@ -82,7 +83,7 @@
EXPECT_CALL(dataMock, open()).WillOnce(Return(false));
EXPECT_FALSE(handler->open(
- 0, OpenFlags::write | FirmwareBlobHandler::UpdateFlags::lpc,
+ 0, blobs::OpenFlags::write | FirmwareBlobHandler::UpdateFlags::lpc,
hashBlobId));
/* The active hash blob_id was added. */
@@ -99,7 +100,8 @@
EXPECT_CALL(imageMock, open("asdf")).WillOnce(Return(true));
EXPECT_TRUE(handler->open(
- 0, OpenFlags::write | FirmwareBlobHandler::UpdateFlags::ipmi, "asdf"));
+ 0, blobs::OpenFlags::write | FirmwareBlobHandler::UpdateFlags::ipmi,
+ "asdf"));
/* The active image blob_id was added. */
auto currentBlobs = handler->getBlobIds();
@@ -109,7 +111,7 @@
/* Open the hash file (since we opened an image file). */
EXPECT_FALSE(handler->open(
- 1, OpenFlags::write | FirmwareBlobHandler::UpdateFlags::ipmi,
+ 1, blobs::OpenFlags::write | FirmwareBlobHandler::UpdateFlags::ipmi,
hashBlobId));
EXPECT_TRUE(handler->close(0));
@@ -117,7 +119,7 @@
EXPECT_CALL(imageMock, open(StrEq(hashBlobId))).WillOnce(Return(true));
EXPECT_TRUE(handler->open(
- 1, OpenFlags::write | FirmwareBlobHandler::UpdateFlags::ipmi,
+ 1, blobs::OpenFlags::write | FirmwareBlobHandler::UpdateFlags::ipmi,
hashBlobId));
}
@@ -131,7 +133,8 @@
EXPECT_CALL(imageMock, open("asdf")).WillOnce(Return(true));
EXPECT_TRUE(handler->open(
- 0, OpenFlags::write | FirmwareBlobHandler::UpdateFlags::ipmi, "asdf"));
+ 0, blobs::OpenFlags::write | FirmwareBlobHandler::UpdateFlags::ipmi,
+ "asdf"));
/* The active image blob_id was added. */
auto currentBlobs = handler->getBlobIds();
@@ -145,7 +148,7 @@
EXPECT_TRUE(handler->close(0));
EXPECT_FALSE(handler->open(
- 1, OpenFlags::write | FirmwareBlobHandler::UpdateFlags::ipmi,
+ 1, blobs::OpenFlags::write | FirmwareBlobHandler::UpdateFlags::ipmi,
activeImageBlobId));
}
@@ -157,7 +160,8 @@
EXPECT_CALL(imageMock, open("asdf")).WillOnce(Return(false));
EXPECT_FALSE(handler->open(
- 0, OpenFlags::write | FirmwareBlobHandler::UpdateFlags::ipmi, "asdf"));
+ 0, blobs::OpenFlags::write | FirmwareBlobHandler::UpdateFlags::ipmi,
+ "asdf"));
/* Verify blob_id list doesn't grow. */
auto currentBlobs = handler->getBlobIds();
@@ -182,7 +186,8 @@
{
/* The client sends a request with an invalid image blob_id. */
EXPECT_FALSE(handler->open(
- 0, OpenFlags::write | FirmwareBlobHandler::UpdateFlags::ipmi, "bcdf"));
+ 0, blobs::OpenFlags::write | FirmwareBlobHandler::UpdateFlags::ipmi,
+ "bcdf"));
}
/* TODO: The client sends a request during verification. */
@@ -192,4 +197,4 @@
/* TODO: The client sends a request to open active image. */
/* TODO: The client sends a request to open active hash. */
-} // namespace blobs
+} // namespace ipmi_flash
diff --git a/test/firmware_sessionstat_unittest.cpp b/test/firmware_sessionstat_unittest.cpp
index d3d35f9..98fb6da 100644
--- a/test/firmware_sessionstat_unittest.cpp
+++ b/test/firmware_sessionstat_unittest.cpp
@@ -9,7 +9,7 @@
#include <gtest/gtest.h>
-namespace blobs
+namespace ipmi_flash
{
using ::testing::Eq;
using ::testing::Return;
@@ -30,15 +30,16 @@
EXPECT_CALL(imageMock, open("asdf")).WillOnce(Return(true));
EXPECT_TRUE(handler->open(
- 0, OpenFlags::write | FirmwareBlobHandler::UpdateFlags::ipmi, "asdf"));
+ 0, blobs::OpenFlags::write | FirmwareBlobHandler::UpdateFlags::ipmi,
+ "asdf"));
int size = 512;
EXPECT_CALL(imageMock, getSize()).WillOnce(Return(size));
- struct BlobMeta meta;
+ struct blobs::BlobMeta meta;
EXPECT_TRUE(handler->stat(0, &meta));
EXPECT_EQ(meta.blobState,
- OpenFlags::write | FirmwareBlobHandler::UpdateFlags::ipmi);
+ blobs::OpenFlags::write | FirmwareBlobHandler::UpdateFlags::ipmi);
EXPECT_EQ(meta.size, size);
EXPECT_EQ(meta.metadata.size(), 0);
}
@@ -53,21 +54,22 @@
EXPECT_CALL(imageMock, open("asdf")).WillOnce(Return(true));
EXPECT_TRUE(handler->open(
- 0, OpenFlags::write | FirmwareBlobHandler::UpdateFlags::lpc, "asdf"));
+ 0, blobs::OpenFlags::write | FirmwareBlobHandler::UpdateFlags::lpc,
+ "asdf"));
int size = 512;
EXPECT_CALL(imageMock, getSize()).WillOnce(Return(size));
std::vector<std::uint8_t> mBytes = {0x01, 0x02};
EXPECT_CALL(dataMock, readMeta()).WillOnce(Return(mBytes));
- struct BlobMeta meta;
+ struct blobs::BlobMeta meta;
EXPECT_TRUE(handler->stat(0, &meta));
EXPECT_EQ(meta.blobState,
- OpenFlags::write | FirmwareBlobHandler::UpdateFlags::lpc);
+ blobs::OpenFlags::write | FirmwareBlobHandler::UpdateFlags::lpc);
EXPECT_EQ(meta.size, size);
EXPECT_EQ(meta.metadata.size(), mBytes.size());
EXPECT_EQ(meta.metadata[0], mBytes[0]);
EXPECT_EQ(meta.metadata[1], mBytes[1]);
}
-} // namespace blobs
+} // namespace ipmi_flash
diff --git a/test/firmware_stat_unittest.cpp b/test/firmware_stat_unittest.cpp
index becb3f1..beab6f9 100644
--- a/test/firmware_stat_unittest.cpp
+++ b/test/firmware_stat_unittest.cpp
@@ -7,7 +7,7 @@
#include <gtest/gtest.h>
-namespace blobs
+namespace ipmi_flash
{
TEST(FirmwareHandlerStatTest, StatOnInactiveBlobIDReturnsTransport)
{
@@ -31,9 +31,9 @@
auto handler = FirmwareBlobHandler::CreateFirmwareBlobHandler(
blobs, data, CreateVerifyMock());
- struct BlobMeta meta;
+ struct blobs::BlobMeta meta;
EXPECT_TRUE(handler->stat("asdf", &meta));
EXPECT_EQ(FirmwareBlobHandler::UpdateFlags::ipmi, meta.blobState);
}
-} // namespace blobs
+} // namespace ipmi_flash
diff --git a/test/firmware_unittest.hpp b/test/firmware_unittest.hpp
index 0eea768..da84c1b 100644
--- a/test/firmware_unittest.hpp
+++ b/test/firmware_unittest.hpp
@@ -11,7 +11,7 @@
#include <gmock/gmock.h>
#include <gtest/gtest.h>
-namespace blobs
+namespace ipmi_flash
{
class IpmiOnlyFirmwareTest : public ::testing::Test
@@ -21,7 +21,7 @@
std::vector<HandlerPack> blobs;
std::vector<DataHandlerPack> data = {
{FirmwareBlobHandler::UpdateFlags::ipmi, nullptr}};
- std::unique_ptr<GenericBlobInterface> handler;
+ std::unique_ptr<blobs::GenericBlobInterface> handler;
void SetUp() override
{
@@ -41,7 +41,7 @@
ImageHandlerMock imageMock;
std::vector<HandlerPack> blobs;
std::vector<DataHandlerPack> data;
- std::unique_ptr<GenericBlobInterface> handler;
+ std::unique_ptr<blobs::GenericBlobInterface> handler;
void SetUp() override
{
@@ -58,4 +58,4 @@
}
};
-} // namespace blobs
+} // namespace ipmi_flash
diff --git a/test/firmware_write_unittest.cpp b/test/firmware_write_unittest.cpp
index 77f6326..f4f78fc 100644
--- a/test/firmware_write_unittest.cpp
+++ b/test/firmware_write_unittest.cpp
@@ -11,7 +11,7 @@
#include <gtest/gtest.h>
-namespace blobs
+namespace ipmi_flash
{
using ::testing::Eq;
using ::testing::Return;
@@ -30,7 +30,8 @@
EXPECT_CALL(imageMock, open("asdf")).WillOnce(Return(true));
EXPECT_TRUE(handler->open(
- 0, OpenFlags::write | FirmwareBlobHandler::UpdateFlags::ipmi, "asdf"));
+ 0, blobs::OpenFlags::write | FirmwareBlobHandler::UpdateFlags::ipmi,
+ "asdf"));
std::vector<std::uint8_t> bytes = {0xaa, 0x55};
@@ -45,7 +46,8 @@
EXPECT_CALL(imageMock, open("asdf")).WillOnce(Return(true));
EXPECT_TRUE(handler->open(
- 0, OpenFlags::write | FirmwareBlobHandler::UpdateFlags::lpc, "asdf"));
+ 0, blobs::OpenFlags::write | FirmwareBlobHandler::UpdateFlags::lpc,
+ "asdf"));
struct ExtChunkHdr request;
request.length = 4; /* number of bytes to read. */
@@ -68,7 +70,8 @@
EXPECT_CALL(imageMock, open("asdf")).WillOnce(Return(true));
EXPECT_TRUE(handler->open(
- 0, OpenFlags::write | FirmwareBlobHandler::UpdateFlags::lpc, "asdf"));
+ 0, blobs::OpenFlags::write | FirmwareBlobHandler::UpdateFlags::lpc,
+ "asdf"));
struct ExtChunkHdr request;
request.length = 4; /* number of bytes to read. */
@@ -82,4 +85,4 @@
EXPECT_FALSE(handler->write(0, 0, ipmiRequest));
}
-} // namespace blobs
+} // namespace ipmi_flash
diff --git a/test/firmware_writemeta_unittest.cpp b/test/firmware_writemeta_unittest.cpp
index 0ca5c62..e7d8463 100644
--- a/test/firmware_writemeta_unittest.cpp
+++ b/test/firmware_writemeta_unittest.cpp
@@ -10,7 +10,7 @@
#include <gtest/gtest.h>
-namespace blobs
+namespace ipmi_flash
{
using ::testing::Eq;
using ::testing::Return;
@@ -24,7 +24,8 @@
EXPECT_CALL(imageMock, open("asdf")).WillOnce(Return(true));
EXPECT_TRUE(handler->open(
- 0, OpenFlags::write | FirmwareBlobHandler::UpdateFlags::ipmi, "asdf"));
+ 0, blobs::OpenFlags::write | FirmwareBlobHandler::UpdateFlags::ipmi,
+ "asdf"));
std::vector<std::uint8_t> bytes = {0xaa, 0x55};
@@ -37,7 +38,8 @@
EXPECT_CALL(imageMock, open("asdf")).WillOnce(Return(true));
EXPECT_TRUE(handler->open(
- 0, OpenFlags::write | FirmwareBlobHandler::UpdateFlags::lpc, "asdf"));
+ 0, blobs::OpenFlags::write | FirmwareBlobHandler::UpdateFlags::lpc,
+ "asdf"));
std::vector<std::uint8_t> bytes = {0x01, 0x02, 0x03, 0x04};
@@ -45,4 +47,4 @@
EXPECT_TRUE(handler->writeMeta(0, 0, bytes));
}
-} // namespace blobs
+} // namespace ipmi_flash
diff --git a/test/image_mock.hpp b/test/image_mock.hpp
index c831c45..fb10c39 100644
--- a/test/image_mock.hpp
+++ b/test/image_mock.hpp
@@ -4,7 +4,7 @@
#include <gmock/gmock.h>
-namespace blobs
+namespace ipmi_flash
{
class ImageHandlerMock : public ImageHandlerInterface
@@ -18,4 +18,4 @@
MOCK_METHOD0(getSize, int());
};
-} // namespace blobs
+} // namespace ipmi_flash
diff --git a/test/tools_updater_unittest.cpp b/test/tools_updater_unittest.cpp
index 080671f..95a5abc 100644
--- a/test/tools_updater_unittest.cpp
+++ b/test/tools_updater_unittest.cpp
@@ -25,22 +25,22 @@
ipmiblob::BlobInterfaceMock blobMock;
ipmiblob::StatResponse statObj;
- statObj.blob_state = blobs::FirmwareBlobHandler::UpdateFlags::ipmi |
- blobs::FirmwareBlobHandler::UpdateFlags::lpc;
+ statObj.blob_state = ipmi_flash::FirmwareBlobHandler::UpdateFlags::ipmi |
+ ipmi_flash::FirmwareBlobHandler::UpdateFlags::lpc;
statObj.size = 0;
EXPECT_CALL(blobMock, getBlobList())
.WillOnce(
- Return(std::vector<std::string>({blobs::staticLayoutBlobId})));
- EXPECT_CALL(blobMock,
- getStat(TypedEq<const std::string&>(blobs::staticLayoutBlobId)))
+ Return(std::vector<std::string>({ipmi_flash::staticLayoutBlobId})));
+ EXPECT_CALL(blobMock, getStat(TypedEq<const std::string&>(
+ ipmi_flash::staticLayoutBlobId)))
.WillOnce(Return(statObj));
EXPECT_CALL(handlerMock, supportedType())
- .WillOnce(Return(blobs::FirmwareBlobHandler::UpdateFlags::lpc));
+ .WillOnce(Return(ipmi_flash::FirmwareBlobHandler::UpdateFlags::lpc));
UpdateHandler updater(&blobMock, &handlerMock);
- EXPECT_TRUE(updater.checkAvailable(blobs::staticLayoutBlobId));
+ EXPECT_TRUE(updater.checkAvailable(ipmi_flash::staticLayoutBlobId));
}
TEST(UpdaterTest, SendFileSuccess)
@@ -53,15 +53,16 @@
std::uint16_t supported =
static_cast<std::uint16_t>(
- blobs::FirmwareBlobHandler::UpdateFlags::lpc) |
+ ipmi_flash::FirmwareBlobHandler::UpdateFlags::lpc) |
static_cast<std::uint16_t>(blobs::OpenFlags::write);
std::uint16_t session = 0xbeef;
EXPECT_CALL(handlerMock, supportedType())
- .WillOnce(Return(blobs::FirmwareBlobHandler::UpdateFlags::lpc));
+ .WillOnce(Return(ipmi_flash::FirmwareBlobHandler::UpdateFlags::lpc));
- EXPECT_CALL(blobMock,
- openBlob(StrEq(blobs::staticLayoutBlobId.c_str()), supported))
+ EXPECT_CALL(
+ blobMock,
+ openBlob(StrEq(ipmi_flash::staticLayoutBlobId.c_str()), supported))
.WillOnce(Return(session));
EXPECT_CALL(handlerMock,
@@ -71,7 +72,7 @@
EXPECT_CALL(blobMock, closeBlob(session)).Times(1);
UpdateHandler updater(&blobMock, &handlerMock);
- updater.sendFile(blobs::staticLayoutBlobId, firmwareImage);
+ updater.sendFile(ipmi_flash::staticLayoutBlobId, firmwareImage);
}
#if 0 /* TODO: fix this up. */
@@ -86,26 +87,26 @@
std::string firmwareImage = "image.bin";
std::string signatureFile = "image.sig";
- std::vector<std::string> blobList = {blobs::staticLayoutBlobId};
+ std::vector<std::string> blobList = {ipmi_flash::staticLayoutBlobId};
ipmiblob::StatResponse statObj;
- statObj.blob_state = blobs::FirmwareBlobHandler::UpdateFlags::ipmi |
- blobs::FirmwareBlobHandler::UpdateFlags::lpc;
+ statObj.blob_state = ipmi_flash::FirmwareBlobHandler::UpdateFlags::ipmi |
+ ipmi_flash::FirmwareBlobHandler::UpdateFlags::lpc;
statObj.size = 0;
std::uint16_t supported =
static_cast<std::uint16_t>(
- blobs::FirmwareBlobHandler::UpdateFlags::lpc) |
+ ipmi_flash::FirmwareBlobHandler::UpdateFlags::lpc) |
static_cast<std::uint16_t>(blobs::OpenFlags::write);
std::uint16_t session = 0xbeef;
EXPECT_CALL(blobMock, getBlobList()).WillOnce(Return(blobList));
- EXPECT_CALL(blobMock, getStat(TypedEq<const std::string&>(blobs::staticLayoutBlobId)))
+ EXPECT_CALL(blobMock, getStat(TypedEq<const std::string&>(ipmi_flash::staticLayoutBlobId)))
.WillOnce(Return(statObj));
EXPECT_CALL(handlerMock, supportedType())
- .WillOnce(Return(blobs::FirmwareBlobHandler::UpdateFlags::lpc));
+ .WillOnce(Return(ipmi_flash::FirmwareBlobHandler::UpdateFlags::lpc));
- EXPECT_CALL(blobMock, openBlob(StrEq(blobs::staticLayoutBlobId.c_str()), Eq(supported)))
+ EXPECT_CALL(blobMock, openBlob(StrEq(ipmi_flash::staticLayoutBlobId.c_str()), Eq(supported)))
.WillOnce(Return(session));
EXPECT_CALL(handlerMock,
@@ -129,7 +130,7 @@
verificationResponse.blob_state = supported | blobs::StateFlags::committing;
verificationResponse.size = 0;
verificationResponse.metadata.push_back(static_cast<std::uint8_t>(
- blobs::FirmwareBlobHandler::VerifyCheckResponses::success));
+ ipmi_flash::FirmwareBlobHandler::VerifyCheckResponses::success));
EXPECT_CALL(blobMock, getStat(TypedEq<std::uint16_t>(session)))
.WillOnce(Return(verificationResponse));
diff --git a/test/verification_mock.hpp b/test/verification_mock.hpp
index e1021c8..e027f00 100644
--- a/test/verification_mock.hpp
+++ b/test/verification_mock.hpp
@@ -8,7 +8,7 @@
#include <gtest/gtest.h>
-namespace blobs
+namespace ipmi_flash
{
class VerificationMock : public VerificationInterface
@@ -24,4 +24,4 @@
return std::make_unique<VerificationMock>();
}
-} // namespace blobs
+} // namespace ipmi_flash
diff --git a/test/window_mapper_mock.hpp b/test/window_mapper_mock.hpp
index c8a75c6..8fc41fa 100644
--- a/test/window_mapper_mock.hpp
+++ b/test/window_mapper_mock.hpp
@@ -8,7 +8,7 @@
#include <gmock/gmock.h>
-namespace blobs
+namespace ipmi_flash
{
class HardwareInterfaceMock : public HardwareMapperInterface
@@ -23,4 +23,4 @@
MOCK_METHOD1(copyFrom, std::vector<std::uint8_t>(std::uint32_t));
};
-} // namespace blobs
+} // namespace ipmi_flash