bmc: add mode json option for verification systemd

Signed-off-by: Patrick Venture <venture@google.com>
Change-Id: Ibe5764c4e2ad7dd938177c813c8c6706886258a2
diff --git a/bmc/buildjson.cpp b/bmc/buildjson.cpp
index 60575db..0be61be 100644
--- a/bmc/buildjson.cpp
+++ b/bmc/buildjson.cpp
@@ -91,9 +91,17 @@
             {
                 const auto& path = verify.at("path");
                 const auto& unit = verify.at("unit");
-                const std::string mode = "replace";
+
+                /* the mode parameter is optional. */
+                std::string systemdMode = "replace";
+                const auto& mode = verify.find("mode");
+                if (mode != verify.end())
+                {
+                    systemdMode = verify.at("mode").get<std::string>();
+                }
+
                 pack->verification = SystemdVerification::CreateVerification(
-                    sdbusplus::bus::new_default(), path, unit, mode);
+                    sdbusplus::bus::new_default(), path, unit, systemdMode);
             }
             else
             {