xref: /openbmc/openbmc-test-automation/extended/test_bios_update.robot (revision 2b70ead659b432acb0c40a3d9267e05ddff851a4)
1*** Settings ***
2Documentation     Update the PNOR image on the host for
3...               hostboot CI purposes.
4
5Library           OperatingSystem
6Resource          ../lib/utils.robot
7Resource          ../lib/connection_client.robot
8Resource          ../lib/openbmc_ffdc.robot
9
10Test Setup        Start SOL Console Logging
11Test Teardown     FFDC On Test Case Fail
12Suite Teardown    Collect SOL Log
13
14*** Variables ***
15
16*** Test Cases ***
17
18Host BIOS Update And Boot
19    [Tags]    open-power
20    [Documentation]   Update PNOR image and verify that
21    ...               host boots normally.
22
23    Validate Parameters
24    Prepare BMC For Update
25    Update PNOR Image
26    Validate IPL
27
28*** Keywords ***
29
30Prepare BMC For Update
31    [Documentation]  Prepare system for PNOR update.
32
33    Initiate Power Off
34
35    Trigger Warm Reset
36    Check If BMC is Up  20 min  10 sec
37
38    Wait Until Keyword Succeeds
39    ...  20 min  10 sec  Verify BMC State  BMC_READY
40
41    Clear BMC Record Log
42
43
44Update PNOR Image
45    [Documentation]  Copy the PNOR image to the BMC /tmp dir and flash it.
46
47    Copy PNOR to BMC
48    ${pnor_path}  ${pnor_basename}=   Split Path    ${PNOR_IMAGE_PATH}
49    Flash PNOR   /tmp/${pnor_basename}
50    Wait Until Keyword Succeeds
51    ...  7 min    10 sec    Is PNOR Flash Done
52
53
54Validate IPL
55    [Documentation]  Power the host on, and validate the IPL.
56
57    Initiate Power On
58    Wait Until Keyword Succeeds
59    ...  10 min    30 sec   Is System State Host Booted
60
61
62Collect SOL Log
63    [Documentation]    Log FFDC if test suite fails and collect SOL log
64    ...                for debugging purposes.
65     ${sol_out}=    Stop SOL Console Logging
66     Create File    ${EXECDIR}${/}logs${/}SOL.log    ${sol_out}
67
68
69Validate Parameters
70    [Documentation]   Validate parameter and file existence.
71    Should Not Be Empty
72    ...   ${PNOR_IMAGE_PATH}  msg=PNOR image path not set
73
74    OperatingSystem.File Should Exist  ${PNOR_IMAGE_PATH}
75    ...   msg=${PNOR_IMAGE_PATH} File not found
76
77