Sridevi Ramesh | 0c8c4ce | 2017-02-11 01:28:36 -0600 | [diff] [blame] | 1 | *** Settings *** |
| 2 | Documentation This module is for OS checkstop opertions. |
| 3 | Resource ../../lib/rest_client.robot |
| 4 | Resource ../../lib/utils.robot |
| 5 | Library OperatingSystem |
| 6 | |
| 7 | *** Keywords *** |
| 8 | |
| 9 | Getscom Operations On OS |
Sridevi Ramesh | ea36b41 | 2017-03-09 04:08:02 -0600 | [diff] [blame] | 10 | [Documentation] Executes getscom command on OS with the given |
| 11 | ... input command. |
Sridevi Ramesh | 0c8c4ce | 2017-02-11 01:28:36 -0600 | [diff] [blame] | 12 | [Arguments] ${input_cmd} |
Sridevi Ramesh | ea36b41 | 2017-03-09 04:08:02 -0600 | [diff] [blame] | 13 | # Description of arguments: |
| 14 | # input_cmd -l|--list-chips |
Sridevi Ramesh | 0c8c4ce | 2017-02-11 01:28:36 -0600 | [diff] [blame] | 15 | # -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 | |
| 22 | Gard Operations On OS |
Sridevi Ramesh | ea36b41 | 2017-03-09 04:08:02 -0600 | [diff] [blame] | 23 | [Documentation] Executes opal-gard command on OS with the given |
| 24 | ... input command. |
Sridevi Ramesh | 0c8c4ce | 2017-02-11 01:28:36 -0600 | [diff] [blame] | 25 | [Arguments] ${input_cmd} |
Sridevi Ramesh | ea36b41 | 2017-03-09 04:08:02 -0600 | [diff] [blame] | 26 | # Description of arguments: |
| 27 | # input_cmd list/clear all/show <gard_record_id> |
Sridevi Ramesh | 0c8c4ce | 2017-02-11 01:28:36 -0600 | [diff] [blame] | 28 | |
| 29 | ${output} ${stderr}= Execute Command opal-gard ${input_cmd} |
| 30 | ... return_stderr=True |
| 31 | Should Be Empty ${stderr} |
| 32 | [Return] ${output} |
| 33 | |
| 34 | Putscom Through OS |
Sridevi Ramesh | ea36b41 | 2017-03-09 04:08:02 -0600 | [diff] [blame] | 35 | [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 Ramesh | 0c8c4ce | 2017-02-11 01:28:36 -0600 | [diff] [blame] | 42 | |
| 43 | ${cmd}= Catenate putscom -c 0x${chip_id} 0x${fru} 0x${address} |
| 44 | Start Command ${cmd} |
Sridevi Ramesh | ea36b41 | 2017-03-09 04:08:02 -0600 | [diff] [blame] | 45 | |
| 46 | Get 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 | |
| 53 | Get 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} |