blob: 1d332ee5ce05085a8f0953ba25f214b4d571f5de [file] [log] [blame]
Sridevi Ramesh0c8c4ce2017-02-11 01:28:36 -06001*** Settings ***
2Documentation This module is for OS checkstop opertions.
3Resource ../../lib/rest_client.robot
4Resource ../../lib/utils.robot
5Library OperatingSystem
6
7*** Keywords ***
8
9Getscom Operations On OS
Sridevi Rameshea36b412017-03-09 04:08:02 -060010 [Documentation] Executes getscom command on OS with the given
11 ... input command.
Sridevi Ramesh0c8c4ce2017-02-11 01:28:36 -060012 [Arguments] ${input_cmd}
Sridevi Rameshea36b412017-03-09 04:08:02 -060013 # Description of arguments:
14 # input_cmd -l|--list-chips
Sridevi Ramesh0c8c4ce2017-02-11 01:28:36 -060015 # -c|--chip <chip-id> <addr>
16
17 ${output} ${stderr}= Execute Command getscom ${input_cmd}
18 ... return_stderr=True
19 Should Be Empty ${stderr}
20 [Return] ${output}
21
22Gard Operations On OS
Sridevi Rameshea36b412017-03-09 04:08:02 -060023 [Documentation] Executes opal-gard command on OS with the given
24 ... input command.
Sridevi Ramesh0c8c4ce2017-02-11 01:28:36 -060025 [Arguments] ${input_cmd}
Sridevi Rameshea36b412017-03-09 04:08:02 -060026 # Description of arguments:
27 # input_cmd list/clear all/show <gard_record_id>
Sridevi Ramesh0c8c4ce2017-02-11 01:28:36 -060028
29 ${output} ${stderr}= Execute Command opal-gard ${input_cmd}
30 ... return_stderr=True
31 Should Be Empty ${stderr}
32 [Return] ${output}
33
34Putscom Through OS
Sridevi Rameshea36b412017-03-09 04:08:02 -060035 [Documentation] Executes putscom command on OS with the given
36 ... input arguments.
37 [Arguments] ${chip_id} ${fru} ${address}
38 # Description of arguments:
39 # chip_id processor ID (e.g 00000000).
40 # fru FRU value (e.g. 2011400).
41 # address chip address (e.g 4000000000000000).
Sridevi Ramesh0c8c4ce2017-02-11 01:28:36 -060042
43 ${cmd}= Catenate putscom -c 0x${chip_id} 0x${fru} 0x${address}
44 Start Command ${cmd}
Sridevi Rameshea36b412017-03-09 04:08:02 -060045
46Get Cores Values From OS
47 [Documentation] Check if cores present on HOST OS & return core values.
48 ${cmd}= Catenate cat /sys/firmware/opal/msglog|grep -i chip|grep -i core
49 ${output}= Execute Command ${cmd}
50 Should Not Be Empty ${output}
51 [Return] ${output}
52
53Get ChipID From OS
54 [Documentation] Get chip ID values based on the input.
55 [Arguments] ${chip_type}
56 # Description of arguments:
57 # chip_type The chip type (Processor/Centaur).
58
59 ${cmd}= Catenate -l | grep -i ${chip_type} | cut -c1-8
60 ${chip_id}= Getscom Operations On OS ${cmd}
61 [Return] ${chip_id}