BMC file mirror from REST to Redfish
Change-Id: I5088389125cdb1d820be7c5e9f34dc3e01961afc
Signed-off-by: Sushil Singh <susilsi7@in.ibm.com>
diff --git a/redfish/extended/test_bmc_file_mirroring.robot b/redfish/extended/test_bmc_file_mirroring.robot
new file mode 100755
index 0000000..8bc4999
--- /dev/null
+++ b/redfish/extended/test_bmc_file_mirroring.robot
@@ -0,0 +1,64 @@
+*** Settings ***
+Documentation Test BMC file mirroring sync from primary flash chip to
+... alternate flash chip side.
+
+Resource ../../lib/openbmc_ffdc.robot
+Resource ../../lib/bmc_network_utils.robot
+Resource ../../lib/bmc_redfish_resource.robot
+Library ../../lib/bmc_ssh_utils.py
+
+Test Teardown Test Teardown Execution
+
+*** Test Cases ***
+
+Test BMC Alt Side Mirroring
+ [Documentation] Verify the modified file is synced to alt flash side.
+ [Tags] Test_BMC_Alt_Side_Mirroring
+
+ # BMC file sync list.
+ # Example output from "cat /etc/synclist" file:
+ # /etc/dropbear/
+ # /etc/group
+ # /etc/gshadow
+ # /etc/hostname
+ # /etc/machine-id
+ # /etc/passwd
+ # /etc/shadow
+ # /etc/ssl/
+ # /etc/ssl/certs/nginx/
+ # /etc/ssl/private/
+ # /etc/systemd/network/
+
+ # Save off the original hostname.
+ ${orig_hostname} ${stderr} ${rc}= BMC Execute Command
+ ... cat /etc/hostname
+ Set Suite Variable ${hostname} ${orig_hostname}
+ ${mirror_filename}= Set Variable mirror-filename
+
+ Redfish.Login
+ Configure Hostname ${mirror_filename}
+ ${curr_hostname} ${stderr} ${rc}= BMC Execute Command hostname
+
+ Should Be Equal As Strings ${curr_hostname} ${mirror_filename}
+ ... msg=The hostname interface ${mirror_filename} and command value ${curr_hostname} do not match.
+
+ # File "hostname" should have synced to alt media space.
+ # Example output from "ls /media/alt/var/persist/etc/":
+ # group group- gshadow gshadow- hostname machine-id ssl systemd
+
+ ${curr_hostname} ${stderr} ${rc}= BMC Execute Command
+ ... cat /media/alt/var/persist/etc/hostname
+
+ Should Be Equal As Strings ${curr_hostname} ${mirror_filename}
+ ... msg=hostname primary file is not synced to the alt flash chip side.
+
+*** Keywords ***
+
+Test Teardown Execution
+ [Documentation] Do the post test teardown.
+
+ FFDC On Test Case Fail
+
+ Redfish.Login
+ Configure Hostname ${hostname}
+