psutil: Add PSU update validation logic

This commit adds the PSUUpdateValidator class implementation which
validates whether it is safe to proceed with a PSU firmware update
based on current system state. It verifies the following:

- All present PSUs match the model of the target PSU
- Count the number of present PSUs in the system
- Ensure that the number of PSUs currently present, none faulty and
  all of the same model, is sufficient to meet the PSU requirement
  specified in the system configuration

This validator fetches PSU inventory paths, properties such as
'SupportedModel' and 'RedundantCount', and checks the PSU presence and
not faulty via D-Bus.

The method `validToUpdate()` encapsulates the overall logic, returning
true if all criteria for a safe update are met.

This class is designed to be integrated before triggering PSU updates
to ensure system safety.

Tested:
  - Ran psutils with --validate on powered-on system, verified update
    blocked
  - Ran psutils with simulated PSUs of mismatched models, verified
    update blocked
  - Ran with matching models and sufficient present PSUs, verified
    update succeeded

Change-Id: I367ef6d1b2cd66e8209f6b67a325de2b1a6da12a
Signed-off-by: Faisal Awada <faisal@us.ibm.com>
diff --git a/tools/power-utils/updater.hpp b/tools/power-utils/updater.hpp
index 21bc4cd..79ecc5b 100644
--- a/tools/power-utils/updater.hpp
+++ b/tools/power-utils/updater.hpp
@@ -53,6 +53,21 @@
 bool update(sdbusplus::bus_t& bus, const std::string& psuInventoryPath,
             const std::string& imageDir);
 
+/**
+ * Validate number of present PSUs vs number of required PSUs for this system,
+ * and validate all PSUs have same model before proceeding to Update PSU
+ * firmware
+ *
+ * @param[in] bus - The sdbusplus DBus bus connection
+ * @param[in] psuInventoryPath - The inventory path of the PSU
+ * @param[in] imageDir - The directory containing the PSU image
+ *
+ * @return true if successful, otherwise false
+ */
+bool validateAndUpdate(sdbusplus::bus_t& bus,
+                       const std::string& psuInventoryPath,
+                       const std::string& imageDir);
+
 class Updater
 {
   public: