blob: 237902b4a0e04113dedace091fb828b5a716aada [file] [log] [blame]
George Keishingdc171492018-05-11 09:32:17 -05001*** Settings ***
2Documentation Test BMC file mirroring sync from primary flash chip to
3... alternate flash chip side.
4
5Resource ../lib/openbmc_ffdc.robot
6Library ../lib/bmc_ssh_utils.py
7
8Test Teardown Test Teardown Execution
9
10*** Test Cases ***
11
12Test 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 Keishing299ccd32018-11-07 01:38:30 -060034 ${mirror_filename}= Set Variable mirror-filename
George Keishingdc171492018-05-11 09:32:17 -050035
George Keishing299ccd32018-11-07 01:38:30 -060036 ${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 Keishingdc171492018-05-11 09:32:17 -050044
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 Keishing299ccd32018-11-07 01:38:30 -060052 Should Be Equal As Strings ${curr_hostname} ${mirror_filename}
George Keishingdc171492018-05-11 09:32:17 -050053 ... msg=hostname primary file is not synced to the alt flash chip side.
54
55*** Keywords ***
56
57Test Teardown Execution
58 [Documentation] Do the post test teardown.
59
60 FFDC On Test Case Fail
George Keishing299ccd32018-11-07 01:38:30 -060061
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 Keishingdc171492018-05-11 09:32:17 -050065