VPD Tool: Update Hardware

Vpd tool has --Hardware/-H flag which should be given along
with writeKeyword flags, if the user wants to write directly to "Hardware".

In general the user should give only the object path in
--path/-P value.

Only if --Hardware/-H flag is given, the user has an
option to give either eeprom path or the object path in
--path/-P value.

Test:
Tested on simics.

./vpd-tool --writeKeyword -H --path < hardware path/object path > -R < record name > -K < keyword > -V < value in hex/ascii >

CASE 1: <updating eeprom path> < update directly on hardware using -H.>
./vpd-tool -u -H -P /sys/devices/platform/ahb/ahb:apb/ahb:apb:bus@1e78a000/1e78a480.i2c-bus/i2c-8/8-0051/8-00510/nvmem -R VINI -K PN -V 0x717273
updation successful on both dbus and hardware.

CASE 2:
./vpd-tool -u -H -P /sys/devices/platform/ahb/ahb:apb/ahb:apb:bus@1e78a000/1e78a480.i2c-bus/i2c-8/8-0051/8-00510/nvmem -R DINF -K FL -V 0x717273
updation successful on hardware. <this wont get updated in dbus as the given record-keyword pair is not required to update in dbus(only those record keywords
present in dbus_properties.json are required to be updated in dbus).

CASE 3: <failure case - invalid eeprom path>
root@rainier:/tmp# ./vpd-tool -u -H -P /sys/devices/platform/ahb/ahb:apb/ahb:apb:bus@1e78a000/1e78a490.i2c-bus/i2c-8/8-0051/8-00510/nvmem -R VINI -K PN -V 0x717273
Invalid object path : /sys/devices/platform/ahb/ahb:apb/ahb:apb:bus@1e78a000/1e78a490.i2c-bus/i2c-8/8-0051/8-00510/nvmem. Unable to find the corresponding EEPROM path for the given object path : /sys/devices/platform/ahb/ahb:apb/ahb:apb:bus@1e78a000/1e7$

Signed-off-by: PriyangaRamasamy <priyanga24@in.ibm.com>
Change-Id: I6b893e699fe343c90c3a3fd2b07fd8b9a4711687
diff --git a/test/vpd-manager-test/editor_test.cpp b/test/vpd-manager-test/editor_test.cpp
index 2f7114a..1549df8 100644
--- a/test/vpd-manager-test/editor_test.cpp
+++ b/test/vpd-manager-test/editor_test.cpp
@@ -87,7 +87,7 @@
     {
         // Invalid kwd name
         EditorImpl edit("VINI", "SN", std::move(emptyVpdFile));
-        edit.updateKeyword(dataToUodate);
+        edit.updateKeyword(dataToUodate, true);
     }
     catch (const std::exception& e)
     {
@@ -105,7 +105,7 @@
     {
         // the path is dummy
         EditorImpl edit("VINI", "SN", std::move(vpd));
-        edit.updateKeyword(dataToUodate);
+        edit.updateKeyword(dataToUodate, true);
     }
     catch (const std::exception& e)
     {
@@ -124,7 +124,7 @@
     {
         // Invalid record name "VIN", path is dummy
         EditorImpl edit("VIN", "SN", std::move(vpd));
-        edit.updateKeyword(dataToUodate);
+        edit.updateKeyword(dataToUodate, true);
     }
     catch (const std::exception& e)
     {
@@ -143,7 +143,7 @@
     {
         // All valid data
         EditorImpl edit("VINI", "Sn", std::move(vpd));
-        edit.updateKeyword(dataToUodate);
+        edit.updateKeyword(dataToUodate, true);
     }
     catch (std::runtime_error& e)
     {
@@ -162,7 +162,7 @@
     {
         // All valid data
         EditorImpl edit("VINI", "SN", std::move(vpd));
-        edit.updateKeyword(dataToUodate);
+        edit.updateKeyword(dataToUodate, true);
     }
     catch (std::runtime_error& e)
     {
@@ -176,4 +176,4 @@
     ::testing::InitGoogleTest(&argc, argv);
 
     return RUN_ALL_TESTS();
-}
\ No newline at end of file
+}