blob: 5bb44f2b2e5810bc5bec2be303c3481c7618c069 [file] [log] [blame]
Chris Austenb29d2e82016-06-07 12:25:35 -05001*** Settings ***
George Keishingf58c4862017-03-28 13:01:03 -05002Documentation Test Error callout association.
Chris Austenb29d2e82016-06-07 12:25:35 -05003
George Keishingf58c4862017-03-28 13:01:03 -05004Resource ../lib/connection_client.robot
5Resource ../lib/openbmc_ffdc.robot
6Resource ../lib/utils.robot
7Resource ../lib/state_manager.robot
Chris Austenb29d2e82016-06-07 12:25:35 -05008
George Keishingf58c4862017-03-28 13:01:03 -05009Suite Setup Run Keywords Verify callout-test AND
10... Boot Host AND
11... Clear Existing Error Logs
12Test Setup Open Connection And Log In
13Test Teardown Close All Connections
14Suite Teardown Clear Existing Error Logs
George Keishingd434c512016-10-07 06:46:29 -050015
Chris Austenb29d2e82016-06-07 12:25:35 -050016*** Test Cases ***
17
George Keishingf58c4862017-03-28 13:01:03 -050018Create Test Error Callout And Verify
19 [Documentation] Create error log callout and verify via REST.
20 [Tags] Create_Test_Error_Callout_And_Verify
Chris Austenb29d2e82016-06-07 12:25:35 -050021
George Keishingf58c4862017-03-28 13:01:03 -050022 Create Test Error With Callout
23 Verify Test Error Log And Callout
Chris Austenb29d2e82016-06-07 12:25:35 -050024
Chris Austenb29d2e82016-06-07 12:25:35 -050025
26*** Keywords ***
27
George Keishingf58c4862017-03-28 13:01:03 -050028Verify callout-test
29 [Documentation] Verify existence of prerequisite callout-test.
Chris Austenb29d2e82016-06-07 12:25:35 -050030
George Keishingd434c512016-10-07 06:46:29 -050031 Open Connection And Log In
George Keishingf58c4862017-03-28 13:01:03 -050032 ${out} ${stderr}= Execute Command which callout-test return_stderr=True
33 Should Be Empty ${stderr}
34 Should Contain ${out} callout-test
35
36Clear Existing Error Logs
37 [Documentation] If error log isn't empty, restart the logging service on
38 ... the BMC
39
40 ${resp}= OpenBMC Get Request ${BMC_LOGGING_ENTRY}${1}
41 Return From Keyword If ${resp.status_code} == ${HTTP_NOT_FOUND}
42 Execute Command On BMC
43 ... systemctl restart xyz.openbmc_project.Logging.service
44 Sleep 10s reason=Wait for logging service to restart properly.
45 ${resp}= OpenBMC Get Request ${BMC_LOGGING_ENTRY}${1}
46 Should Be Equal As Strings ${resp.status_code} ${HTTP_NOT_FOUND}
47
48
49Create Test Error With Callout
50 [Documentation] Generate test error log with callout for CPU0.
51
52 # Test error log entry example:
53 # "/xyz/openbmc_project/logging/entry/4": {
54 # "AdditionalData": [
55 # "CALLOUT_DEVICE_PATH_TEST=/sys/devices/platform/fsi-master/slave@00:00",
56 # "CALLOUT_ERRNO_TEST=0",
57 # "DEV_ADDR=0x0DEADEAD"
58 # ],
59 # "Id": 4,
60 # "Message": "example.xyz.openbmc_project.Example.Elog.TestCallout",
61 # "Resolved": 0,
62 # "Severity": "xyz.openbmc_project.Logging.Entry.Level.Error",
63 # "Timestamp": 1487747332528,
64 # "associations": [
65 # [
66 # "callout",
67 # "fault",
68 # "/xyz/openbmc_project/inventory/system/chassis/motherboard/cpu0"
69 # ]
70 # ]
71 # },
72 # "/xyz/openbmc_project/logging/entry/4/callout": {
73 # "endpoints": [
74 # "/xyz/openbmc_project/inventory/system/chassis/motherboard/cpu0"
75 # ]
76 # },
77
78 Execute Command On BMC
79 ... callout-test /sys/devices/platform/fsi-master/slave@00:00
80
81Verify Test Error Log And Callout
82 [Documentation] Verify test error log entries.
83 ${content}= Read Attribute ${BMC_LOGGING_ENTRY}${1} Message
84 Should Be Equal ${content}
85 ... example.xyz.openbmc_project.Example.Elog.TestCallout
86 ${content}= Read Attribute ${BMC_LOGGING_ENTRY}${1} Severity
87 Should Be Equal ${content}
88 ... xyz.openbmc_project.Logging.Entry.Level.Error
89 ${content}= Read Attribute ${BMC_LOGGING_ENTRY}${1}/callout endpoints
90 Should Be Equal ${content[0]}
91 ... /xyz/openbmc_project/inventory/system/chassis/motherboard/cpu0
92
93Boot Host
94 [Documentation] Boot the host if current state is "Off".
95 ${current_state}= Get Host State
96 Run Keyword If '${current_state}' == 'Off'
97 ... Initiate Host Boot
98
99 Wait Until Keyword Succeeds
100 ... 10 min 10 sec Is OS Starting