Host Code Update ApplyTime policy

Added Code for Host code update for Apply time policy
      - Immediate
      - OnReset

Change-Id: I4ab5397147a6374e92934e7ba72f420f4521b12b
Signed-off-by: Sushil Singh <susilsi7@in.ibm.com>
diff --git a/lib/redfish_code_update_utils.robot b/lib/redfish_code_update_utils.robot
index cf0ae51..0b99ca4 100644
--- a/lib/redfish_code_update_utils.robot
+++ b/lib/redfish_code_update_utils.robot
@@ -108,7 +108,7 @@
     [Arguments]  ${apply_time}
 
     # Description of argument(s):
-    # policy     ApplyTime allowed values (e.g. "OnReset", "Immediate").
+    # apply_time     ApplyTime allowed values (e.g. "OnReset", "Immediate").
 
     Set ApplyTime  policy=${apply_Time}
     Redfish Upload Image  ${REDFISH_BASE_URI}UpdateService  ${IMAGE_FILE_PATH}
@@ -135,7 +135,7 @@
     [Arguments]  ${apply_time}  ${start_boot_seconds}
 
     # Description of argument(s):
-    # policy                ApplyTime allowed values
+    # apply_time            ApplyTime allowed values
     #                       (e.g. "OnReset", "Immediate").
     # start_boot_seconds    See 'Wait For Reboot' for details.
 
@@ -151,8 +151,16 @@
 
 Poweron Host And Verify Host Image
     [Documentation]  Power on Host and verify installed image is functional.
+    [Arguments]  ${apply_time}
 
-    Redfish Power On
+    # Description of argument(s):
+    # apply_time            ApplyTime allowed values
+    #                       (e.g. "OnReset", "Immediate").
+
+    Run Keyword if  'OnReset' == '${apply_time}'
+    ...    Redfish Host Reboot
+    ...  ELSE
+    ...    Wait State  os_running_match_state  10 mins
     Redfish.Login
     Redfish Verify Host Version  ${IMAGE_FILE_PATH}
 
diff --git a/redfish/update_service/test_redfish_host_code_update.robot b/redfish/update_service/test_redfish_host_code_update.robot
index d90e2a2..2c59a9a 100644
--- a/redfish/update_service/test_redfish_host_code_update.robot
+++ b/redfish/update_service/test_redfish_host_code_update.robot
@@ -47,6 +47,7 @@
     # policy
     Immediate
 
+
 *** Keywords ***
 
 Suite Setup Execution
@@ -56,7 +57,7 @@
     Redfish.Login
     Delete All BMC Dump
     Redfish Purge Event Log
-    Redfish Power Off  stack_mode=skip
+    Redfish Power On  stack_mode=skip
 
 
 Redfish Update Firmware
@@ -68,5 +69,5 @@
 
     Redfish.Login
     Redfish Upload Image And Check Progress State  ${apply_time}
-    Poweron Host And Verify Host Image
+    Poweron Host And Verify Host Image  ${apply_time}