xref: /openbmc/openbmc-test-automation/redfish/extended/test_bmc_file_mirroring.robot (revision 94041a34a992d9b5f6418a43e1cd5273a6d9f9b2)
1*** Settings ***
2Documentation  Test BMC file mirroring sync from primary flash chip to
3...  alternate flash chip side.
4
5Resource       ../../lib/openbmc_ffdc.robot
6Resource       ../../lib/bmc_network_utils.robot
7Resource       ../../lib/bmc_redfish_resource.robot
8Library        ../../lib/bmc_ssh_utils.py
9
10Test Teardown  Test Teardown Execution
11
12Test Tags      BMC_File_Mirroring
13
14*** Test Cases ***
15
16Test BMC Alt Side Mirroring
17    [Documentation]  Verify the modified file is synced to alt flash side.
18    [Tags]  Test_BMC_Alt_Side_Mirroring
19
20    # BMC file sync list.
21    # Example output from "cat /etc/synclist" file:
22    # /etc/dropbear/
23    # /etc/group
24    # /etc/gshadow
25    # /etc/hostname
26    # /etc/machine-id
27    # /etc/passwd
28    # /etc/shadow
29    # /etc/ssl/
30    # /etc/ssl/certs/nginx/
31    # /etc/ssl/private/
32    # /etc/systemd/network/
33
34    # Save off the original hostname.
35    ${orig_hostname}  ${stderr}  ${rc}=  BMC Execute Command
36    ...  cat /etc/hostname
37    Set Suite Variable  ${hostname}  ${orig_hostname}
38    ${mirror_filename}=  Set Variable  mirror-filename
39
40    Redfish.Login
41    Configure Hostname  ${mirror_filename}
42    ${curr_hostname}  ${stderr}  ${rc}=  BMC Execute Command  hostname
43
44    Should Be Equal As Strings  ${curr_hostname}  ${mirror_filename}
45    ...  msg=The hostname interface ${mirror_filename} and command value ${curr_hostname} do not match.
46
47    # File "hostname" should have synced to alt media space.
48    # Example output from "ls /media/alt/var/persist/etc/":
49    # group  group-  gshadow  gshadow-  hostname  machine-id  ssl  systemd
50
51    # Wait time for syncing to ALT side.
52    Sleep  2
53
54    ${curr_hostname}  ${stderr}  ${rc}=  BMC Execute Command
55    ...  cat /media/alt/var/persist/etc/hostname
56
57    Should Be Equal As Strings  ${curr_hostname}  ${mirror_filename}
58    ...  msg=hostname primary file is not synced to the alt flash chip side.
59
60*** Keywords ***
61
62Test Teardown Execution
63    [Documentation]  Do the post test teardown.
64
65    FFDC On Test Case Fail
66
67    Redfish.Login
68    Configure Hostname  ${hostname}
69
70