Leonel Gonzalez | 854eb46 | 2017-05-05 16:30:49 -0500 | [diff] [blame] | 1 | *** Settings *** |
| 2 | Documentation Keywords for system data information. |
| 3 | |
| 4 | Resource ../syslib/utils_os.robot |
| 5 | |
| 6 | *** Variables *** |
| 7 | |
| 8 | *** Keywords *** |
| 9 | Get PNOR Info |
| 10 | [Documentation] Get PNOR information. |
| 11 | ${version} ${stderr}= Execute Command pflash -r /dev/stdout -P VERSION |
| 12 | ... return_stderr=True |
| 13 | Should Be Empty ${stderr} |
| 14 | Log ${\n}version: ${version} console=yes |
| 15 | [Return] ${version} |
| 16 | |
| 17 | Get Inventory |
| 18 | [Documentation] Get system inventory. |
| 19 | ${inventory} ${stderr}= Execute Command lshw -short return_stderr=True |
| 20 | Should Be Empty ${stderr} |
| 21 | Log ${\n}inventory: ${inventory} console=yes |
| 22 | [Return] ${inventory} |
| 23 | |
| 24 | Get Memory Count |
| 25 | [Documentation] Get Memory Count. |
| 26 | ${memory_count} ${stderr}= |
| 27 | ... Execute Command lshw -short | grep memory | wc -l return_stderr=True |
| 28 | Should Be Empty ${stderr} |
| 29 | Log ${\n}memory count: ${memory_count} console=yes |
| 30 | [Return] ${memory_count} |
| 31 | |
| 32 | Verify Memory Count |
| 33 | [Documentation] Verify memory count. |
| 34 | [Arguments] ${expected_memory_count} |
| 35 | ${memory_count}= Get Memory Count |
| 36 | Log ${\n}memory count: ${memory_count} console=yes |
| 37 | Should Be Equal As Integers ${memory_count} ${expected_memory_count} |
| 38 | ... Error: memory count doesn't match expected count. |
| 39 | |
| 40 | Get Dimm Count |
| 41 | [Documentation] Get DIMM count. |
| 42 | ${dimm_count} ${stderr}= Execute Command lshw -short | grep DIMM | wc -l |
| 43 | ... return_stderr=True |
| 44 | Should Be Empty ${stderr} |
| 45 | Log ${\n}dimm_count: ${dimm_count} console=yes |
| 46 | [Return] ${dimm_count} |
| 47 | |
| 48 | Verify Dimm Count |
| 49 | [Documentation] Verify DIMM count. |
| 50 | [Arguments] ${expected_dimm_count} |
| 51 | ${dimm_count}= Get Dimm Count |
| 52 | Log ${\n}dimm_count: ${dimm_count} console=yes |
| 53 | Should Be Equal As Integers ${dimm_count} ${expected_dimm_count} |
| 54 | ... msg=Error: dimm count doesn't match expected count. |
| 55 | |
| 56 | Verify Opal-Prd Installed |
| 57 | [Documentation] Check whether opal-prd.service is running on OS. |
| 58 | ${output} ${stderr}= Execute Command systemctl status opal-prd.service |
| 59 | ... return_stderr=True |
| 60 | Should Be Empty ${stderr} |
| 61 | Log ${\n}${output} console=yes |
| 62 | Should Not Contain ${output} could not be found |
| 63 | ... msg=Error: opal-prd.service is not installed. |