George Keishing | dc17149 | 2018-05-11 09:32:17 -0500 | [diff] [blame] | 1 | *** Settings *** |
| 2 | Documentation Test BMC file mirroring sync from primary flash chip to |
| 3 | ... alternate flash chip side. |
| 4 | |
| 5 | Resource ../lib/openbmc_ffdc.robot |
| 6 | Library ../lib/bmc_ssh_utils.py |
| 7 | |
| 8 | Test Teardown Test Teardown Execution |
| 9 | |
| 10 | *** Test Cases *** |
| 11 | |
| 12 | Test BMC Alt Side Mirroring |
| 13 | [Documentation] Verify the modified file is synced to alt flash side. |
| 14 | [Tags] Test_BMC_Alt_Side_Mirroring |
| 15 | |
| 16 | # BMC file sync list. |
| 17 | # Example output from "cat /etc/synclist" file: |
| 18 | # /etc/dropbear/ |
| 19 | # /etc/group |
| 20 | # /etc/gshadow |
| 21 | # /etc/hostname |
| 22 | # /etc/machine-id |
| 23 | # /etc/passwd |
| 24 | # /etc/shadow |
| 25 | # /etc/ssl/ |
| 26 | # /etc/ssl/certs/nginx/ |
| 27 | # /etc/ssl/private/ |
| 28 | # /etc/systemd/network/ |
| 29 | |
| 30 | # Save off the original hostname. |
| 31 | ${orig_hostname} ${stderr} ${rc}= BMC Execute Command |
| 32 | ... cat /etc/hostname |
| 33 | Set Suite Variable ${hostname} ${orig_hostname} |
George Keishing | 299ccd3 | 2018-11-07 01:38:30 -0600 | [diff] [blame] | 34 | ${mirror_filename}= Set Variable mirror-filename |
George Keishing | dc17149 | 2018-05-11 09:32:17 -0500 | [diff] [blame] | 35 | |
George Keishing | 299ccd3 | 2018-11-07 01:38:30 -0600 | [diff] [blame] | 36 | ${host_name_dict}= Create Dictionary data=${mirror_filename} |
| 37 | Write Attribute ${NETWORK_MANAGER}config HostName data=${host_name_dict} |
| 38 | ... verify=${TRUE} expected_value=${mirror_filename} |
| 39 | |
| 40 | ${hostname} ${stderr} ${rc}= BMC Execute Command hostname |
| 41 | |
| 42 | Should Be Equal As Strings ${hostname} ${mirror_filename} |
| 43 | ... msg=The hostname interface ${mirror_filename} and command value ${hostname} do not match. |
George Keishing | dc17149 | 2018-05-11 09:32:17 -0500 | [diff] [blame] | 44 | |
| 45 | # File "hostname" should have synced to alt media space. |
| 46 | # Example output from "ls /media/alt/var/persist/etc/": |
| 47 | # group group- gshadow gshadow- hostname machine-id ssl systemd |
| 48 | |
| 49 | ${curr_hostname} ${stderr} ${rc}= BMC Execute Command |
| 50 | ... cat /media/alt/var/persist/etc/hostname |
| 51 | |
George Keishing | 299ccd3 | 2018-11-07 01:38:30 -0600 | [diff] [blame] | 52 | Should Be Equal As Strings ${curr_hostname} ${mirror_filename} |
George Keishing | dc17149 | 2018-05-11 09:32:17 -0500 | [diff] [blame] | 53 | ... msg=hostname primary file is not synced to the alt flash chip side. |
| 54 | |
| 55 | *** Keywords *** |
| 56 | |
| 57 | Test Teardown Execution |
| 58 | [Documentation] Do the post test teardown. |
| 59 | |
| 60 | FFDC On Test Case Fail |
George Keishing | 299ccd3 | 2018-11-07 01:38:30 -0600 | [diff] [blame] | 61 | |
| 62 | ${host_name_dict}= Create Dictionary data=${hostname} |
| 63 | Write Attribute ${NETWORK_MANAGER}config HostName data=${host_name_dict} |
| 64 | ... verify=${TRUE} expected_value=${hostname} |
George Keishing | dc17149 | 2018-05-11 09:32:17 -0500 | [diff] [blame] | 65 | |