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
9Resource          ../lib/state_manager.robot
10
11Test Teardown     FFDC On Test Case Fail
12
13*** Variables ***
14
15*** Test Cases ***
16
17Host BIOS Update And Boot
18    [Tags]    open-power
19    [Documentation]   Update PNOR image and verify that
20    ...               host boots normally.
21
22    Validate Parameters
23    Prepare BMC For Update
24    Update PNOR Image
25
26*** Keywords ***
27
28Prepare BMC For Update
29    [Documentation]  Prepare system for PNOR update.
30
31    Initiate Power Off
32
33    Trigger Warm Reset
34    Check If BMC is Up  20 min  10 sec
35
36    Wait For 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