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