worker::CollectionStatus for each inventory FRU
This commit populates CollectionStatus D-bus property under
com.ibm.VPD.Collection D-bus interface for each inventory D-bus object
path which represents a FRU.
The property tells the current status of VPD collection for a given
FRU's D-bus object path.
The property takes the below enum values:
>>>com.ibm.VPD.Collection.Status.Success
-------------------------------------
This value is assigned when VPD collection is successful.
>>>com.ibm.VPD.Collection.Status.Failure
-------------------------------------
VPD collection failure due to VPD exceptions.
>>>com.ibm.VPD.Collection.Status.InProgress
----------------------------------------
This value is assigned when VPD collection starts for the given FRU.
>>>com.ibm.VPD.Collection.Status.NotStarted
----------------------------------------
This default value is assigned when we hit prime inventory path.
Test:
1. VPD parsing failed for /sys/bus/i2c/drivers/at24/0-0051
/eeprom due to error: Unable to determine VPD format
=>CollectionStatus property value for tpm_wilson
s "com.ibm.VPD.Collection.Status.Failure"
2. FRU not found
s "com.ibm.VPD.Collection.Status.Failure"
3. Successful collection of VPD
s "com.ibm.VPD.Collection.Status.Success"
Change-Id: Ia5010a181f720454bb51538d6fcf308daf6b75ca
Signed-off-by: Priyanga Ramasamy <priyanga24@in.ibm.com>
diff --git a/vpd-manager/include/constants.hpp b/vpd-manager/include/constants.hpp
index 7f23070..f7e55d0 100644
--- a/vpd-manager/include/constants.hpp
+++ b/vpd-manager/include/constants.hpp
@@ -197,5 +197,18 @@
static constexpr auto systemdObjectPath = "/org/freedesktop/systemd1";
static constexpr auto systemdManagerInterface =
"org.freedesktop.systemd1.Manager";
+
+static constexpr auto vpdCollectionInterface = "com.ibm.VPD.Collection";
+
+// enumerated values of CollectionStatus D-bus property defined under
+// com.ibm.VPD.Collection interface.
+static constexpr auto vpdCollectionSuccess =
+ "com.ibm.VPD.Collection.Status.Success";
+static constexpr auto vpdCollectionFailure =
+ "com.ibm.VPD.Collection.Status.Failure";
+static constexpr auto vpdCollectionInProgress =
+ "com.ibm.VPD.Collection.Status.InProgress";
+static constexpr auto vpdCollectionNotStarted =
+ "com.ibm.VPD.Collection.Status.NotStarted";
} // namespace constants
} // namespace vpd