Export the part number and serial number
This commit exposes the eMMC's part name and serial number over the
appropriate D-Bus interface, so that it can be exposed over Redfish in
bmcweb.
Tested:
$ busctl introspect xyz.openbmc_project.eStoraged \
/xyz/openbmc_project/inventory/storage/mmcblk0
...
xyz.openbmc_project.Inventory.Decorator.Asset interface - - -
.PartNumber property s "ABCDEF" emits-change
.SerialNumber property s "123456abcd" emits-change
...
$ wget -qO- http://localhost:80/redfish/v1/Chassis/DC_SCM/Drives/mmcblk0
{
"@odata.id": "/redfish/v1/Chassis/DC_SCM/Drives/mmcblk0",
"@odata.type": "#Drive.v1_7_0.Drive",
"CapacityBytes": 15634268160,
"Id": "mmcblk0",
"Links": {
"Chassis": {
"@odata.id": "/redfish/v1/Chassis/DC_SCM"
}
},
"Name": "Name",
"PartNumber": "ABCDEF",
"PhysicalLocation": {
"PartLocation": {
"LocationType": "Embedded"
}
},
"SerialNumber": "123456abcd",
"Status": {
"State": "Enabled"
}
}
Signed-off-by: John Wedig <johnwedig@google.com>
Change-Id: I1d17f08b99907620b5f2c73fdaeacc84950ce64e
diff --git a/src/test/estoraged_test.cpp b/src/test/estoraged_test.cpp
index 89581ab..0bbb32b 100644
--- a/src/test/estoraged_test.cpp
+++ b/src/test/estoraged_test.cpp
@@ -42,6 +42,8 @@
"/xyz/openbmc_project/inventory/system/board/test_board/test_emmc";
const uint64_t testSize = 24;
const uint8_t testLifeTime = 25;
+ const std::string testPartNumber = "12345678";
+ const std::string testSerialNumber = "ABCDEF1234";
std::ofstream testFile;
std::string passwordString;
std::vector<uint8_t> password;
@@ -82,7 +84,8 @@
esObject = std::make_unique<estoraged::EStoraged>(
*objectServer, testConfigPath, testFileName, testLuksDevName,
- testSize, testLifeTime, std::move(cryptIface), std::move(fsIface));
+ testSize, testLifeTime, testPartNumber, testSerialNumber,
+ std::move(cryptIface), std::move(fsIface));
}
void TearDown() override