Add test for BIOS Post codes

Changes:
     - Added test cases for Host reboot and host poweroff

Tested:
     Ran successfully redfish/systems/LogServices/test_post_codes.robot

Change-Id: Icff9eb93225ea0de5113adff14a439cafade8c7a
Signed-off-by: George Keishing <gkeishin@in.ibm.com>
diff --git a/redfish/systems/LogServices/test_post_codes.robot b/redfish/systems/LogServices/test_post_codes.robot
index 4a432d6..e504851 100644
--- a/redfish/systems/LogServices/test_post_codes.robot
+++ b/redfish/systems/LogServices/test_post_codes.robot
@@ -27,6 +27,42 @@
     Should Be True  ${post_codes['Members@odata.count']} >= 1  msg=No BIOS POST Codes populated.
 
 
+Test PostCodes When Host Reboot
+    [Documentation]  Initiate Host reboot the system and verify PostCodes from host are logged.
+    [Tags]  Test_PostCodes_When_Host_Reboot
+
+    # Boot to runtime and clear post codes.
+    Redfish Power On  stack_mode=skip
+    Redfish Clear PostCodes
+
+    RF SYS GracefulRestart
+    ${post_code_list}=  Redfish Get PostCodes
+    Rprint Vars  post_code_list
+
+    ${post_codes}=  Redfish.Get Properties
+    ...  /redfish/v1/Systems/system/LogServices/PostCodes/Entries
+    Log To Console  BIOS POST Codes count: ${post_codes['Members@odata.count']}
+    Should Be True  ${post_codes['Members@odata.count']} >= 1  msg=No BIOS POST Codes populated.
+
+
+Test PostCodes When Host Powered Off
+    [Documentation]  Power off the system and verify PostCodes from host are logged.
+    [Tags]  Test_PostCodes_When_Host_Powered_Off
+
+    # Boot to runtime and clear post codes.
+    Redfish Power On  stack_mode=skip
+    Redfish Clear PostCodes
+
+    Redfish Power Off
+    ${post_code_list}=  Redfish Get PostCodes
+    Rprint Vars  post_code_list
+
+    ${post_codes}=  Redfish.Get Properties
+    ...  /redfish/v1/Systems/system/LogServices/PostCodes/Entries
+    Log To Console  BIOS POST Codes count: ${post_codes['Members@odata.count']}
+    Should Be True  ${post_codes['Members@odata.count']} >= 1  msg=No BIOS POST Codes populated.
+
+
 *** Keywords ***
 
 Test Setup Execution