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 | |
Sushil Singh | 62cc669 | 2019-06-17 22:52:28 -0500 | [diff] [blame] | 5 | Resource ../../lib/openbmc_ffdc.robot |
| 6 | Resource ../../lib/bmc_network_utils.robot |
| 7 | Resource ../../lib/bmc_redfish_resource.robot |
| 8 | Library ../../lib/bmc_ssh_utils.py |
George Keishing | dc17149 | 2018-05-11 09:32:17 -0500 | [diff] [blame] | 9 | |
| 10 | Test Teardown Test Teardown Execution |
| 11 | |
| 12 | *** Test Cases *** |
| 13 | |
| 14 | Test BMC Alt Side Mirroring |
| 15 | [Documentation] Verify the modified file is synced to alt flash side. |
| 16 | [Tags] Test_BMC_Alt_Side_Mirroring |
| 17 | |
| 18 | # BMC file sync list. |
| 19 | # Example output from "cat /etc/synclist" file: |
| 20 | # /etc/dropbear/ |
| 21 | # /etc/group |
| 22 | # /etc/gshadow |
| 23 | # /etc/hostname |
| 24 | # /etc/machine-id |
| 25 | # /etc/passwd |
| 26 | # /etc/shadow |
| 27 | # /etc/ssl/ |
| 28 | # /etc/ssl/certs/nginx/ |
| 29 | # /etc/ssl/private/ |
| 30 | # /etc/systemd/network/ |
| 31 | |
| 32 | # Save off the original hostname. |
| 33 | ${orig_hostname} ${stderr} ${rc}= BMC Execute Command |
| 34 | ... cat /etc/hostname |
| 35 | Set Suite Variable ${hostname} ${orig_hostname} |
George Keishing | 299ccd3 | 2018-11-07 01:38:30 -0600 | [diff] [blame] | 36 | ${mirror_filename}= Set Variable mirror-filename |
George Keishing | dc17149 | 2018-05-11 09:32:17 -0500 | [diff] [blame] | 37 | |
Sushil Singh | 62cc669 | 2019-06-17 22:52:28 -0500 | [diff] [blame] | 38 | Redfish.Login |
| 39 | Configure Hostname ${mirror_filename} |
| 40 | ${curr_hostname} ${stderr} ${rc}= BMC Execute Command hostname |
George Keishing | 299ccd3 | 2018-11-07 01:38:30 -0600 | [diff] [blame] | 41 | |
Sushil Singh | 62cc669 | 2019-06-17 22:52:28 -0500 | [diff] [blame] | 42 | Should Be Equal As Strings ${curr_hostname} ${mirror_filename} |
| 43 | ... msg=The hostname interface ${mirror_filename} and command value ${curr_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 | |
George Keishing | e0a2d5e | 2019-07-23 02:53:58 -0500 | [diff] [blame^] | 49 | # Wait time for syncing to ALT side. |
| 50 | Sleep 2 |
| 51 | |
George Keishing | dc17149 | 2018-05-11 09:32:17 -0500 | [diff] [blame] | 52 | ${curr_hostname} ${stderr} ${rc}= BMC Execute Command |
| 53 | ... cat /media/alt/var/persist/etc/hostname |
| 54 | |
George Keishing | 299ccd3 | 2018-11-07 01:38:30 -0600 | [diff] [blame] | 55 | Should Be Equal As Strings ${curr_hostname} ${mirror_filename} |
George Keishing | dc17149 | 2018-05-11 09:32:17 -0500 | [diff] [blame] | 56 | ... msg=hostname primary file is not synced to the alt flash chip side. |
| 57 | |
| 58 | *** Keywords *** |
| 59 | |
| 60 | Test Teardown Execution |
| 61 | [Documentation] Do the post test teardown. |
| 62 | |
| 63 | FFDC On Test Case Fail |
George Keishing | 299ccd3 | 2018-11-07 01:38:30 -0600 | [diff] [blame] | 64 | |
Sushil Singh | 62cc669 | 2019-06-17 22:52:28 -0500 | [diff] [blame] | 65 | Redfish.Login |
| 66 | Configure Hostname ${hostname} |
George Keishing | dc17149 | 2018-05-11 09:32:17 -0500 | [diff] [blame] | 67 | |