Populate Protocol property in Item.Drive interface
By populating this property, bmcweb can populate the "Protocol"
property in the Drive schema.
Tested:
$ busctl get-property xyz.openbmc_project.eStoraged \
/xyz/openbmc_project/inventory/storage/mmcblk0 \
xyz.openbmc_project.Inventory.Item.Drive Protocol
s "xyz.openbmc_project.Inventory.Item.Drive.DriveProtocol.eMMC"
Signed-off-by: John Wedig <johnwedig@google.com>
Change-Id: I2bd19190c445ce57f3d867ffbb437c1a4a370b51
diff --git a/src/test/estoraged_test.cpp b/src/test/estoraged_test.cpp
index 3d31112..5ad8f00 100644
--- a/src/test/estoraged_test.cpp
+++ b/src/test/estoraged_test.cpp
@@ -47,6 +47,7 @@
const std::string testSerialNumber = "ABCDEF1234";
const std::string testLocationCode = "U102020";
const std::string testDriveType = "SSD";
+ const std::string testDriveProtocol = "eMMC";
std::ofstream testFile;
std::string passwordString;
std::vector<uint8_t> password;
@@ -92,7 +93,8 @@
*objectServer, testConfigPath, testFileName, testLuksDevName,
testSize, testLifeTime, testPartNumber, testSerialNumber,
testLocationCode, ERASE_MAX_GEOMETRY, ERASE_MIN_GEOMETRY,
- testDriveType, std::move(cryptIface), std::move(fsIface));
+ testDriveType, testDriveProtocol, std::move(cryptIface),
+ std::move(fsIface));
}
void TearDown() override
diff --git a/src/test/util_test.cpp b/src/test/util_test.cpp
index 86e86e9..e2fdcc3 100644
--- a/src/test/util_test.cpp
+++ b/src/test/util_test.cpp
@@ -144,6 +144,7 @@
EXPECT_EQ(ERASE_MAX_GEOMETRY, result->eraseMaxGeometry);
EXPECT_EQ(ERASE_MIN_GEOMETRY, result->eraseMinGeometry);
EXPECT_EQ("SSD", result->driveType);
+ EXPECT_EQ("eMMC", result->driveProtocol);
/* Delete the dummy files. */
EXPECT_EQ(3U, std::filesystem::remove_all("mmcblk0"));
@@ -201,6 +202,7 @@
EXPECT_EQ(5566, result->eraseMaxGeometry);
EXPECT_EQ(1234, result->eraseMinGeometry);
EXPECT_EQ("SSD", result->driveType);
+ EXPECT_EQ("eMMC", result->driveProtocol);
/* Delete the dummy files. */
EXPECT_EQ(3U, std::filesystem::remove_all("mmcblk0"));