13aa424beSGeorge Keishing*** Settings ***
23aa424beSGeorge KeishingDocumentation      Keywords for system data information.
33aa424beSGeorge Keishing
4*a28061a0SGeorge KeishingResource           ../lib/os_utilities.robot
53aa424beSGeorge Keishing
63aa424beSGeorge Keishing*** Variables ***
73aa424beSGeorge Keishing
83aa424beSGeorge Keishing*** Keywords ***
93aa424beSGeorge KeishingGet PNOR Info
103aa424beSGeorge Keishing    [Documentation]  Get PNOR information.
113aa424beSGeorge Keishing    ${version}  ${stderr}=  Execute Command  pflash -r /dev/stdout -P VERSION
123aa424beSGeorge Keishing    ...  return_stderr=True
133aa424beSGeorge Keishing    Should Be Empty  ${stderr}
143aa424beSGeorge Keishing    Log  ${\n}version: ${version}  console=yes
153aa424beSGeorge Keishing    [Return]  ${version}
163aa424beSGeorge Keishing
173aa424beSGeorge KeishingGet Inventory
183aa424beSGeorge Keishing    [Documentation]  Get system inventory.
193aa424beSGeorge Keishing    ${inventory}  ${stderr}=  Execute Command  lshw -short  return_stderr=True
203aa424beSGeorge Keishing    Should Be Empty  ${stderr}
213aa424beSGeorge Keishing    Log  ${\n}inventory: ${inventory}  console=yes
223aa424beSGeorge Keishing    [Return]  ${inventory}
233aa424beSGeorge Keishing
243aa424beSGeorge KeishingGet Memory Count
253aa424beSGeorge Keishing    [Documentation]  Get Memory Count.
263aa424beSGeorge Keishing    ${memory_count}  ${stderr}=
273aa424beSGeorge Keishing    ...  Execute Command  lshw -short | grep memory | wc -l  return_stderr=True
283aa424beSGeorge Keishing    Should Be Empty  ${stderr}
293aa424beSGeorge Keishing    Log  ${\n}memory count: ${memory_count}  console=yes
303aa424beSGeorge Keishing    [Return]  ${memory_count}
313aa424beSGeorge Keishing
323aa424beSGeorge KeishingVerify Memory Count
333aa424beSGeorge Keishing    [Documentation]  Verify memory count.
343aa424beSGeorge Keishing    [Arguments]  ${expected_memory_count}
353aa424beSGeorge Keishing    ${memory_count}=  Get Memory Count
363aa424beSGeorge Keishing    Log  ${\n}memory count: ${memory_count}  console=yes
373aa424beSGeorge Keishing    Should Be Equal As Integers  ${memory_count}  ${expected_memory_count}
383aa424beSGeorge Keishing    ...  Error: memory count doesn't match expected count.
393aa424beSGeorge Keishing
403aa424beSGeorge KeishingGet Dimm Count
413aa424beSGeorge Keishing    [Documentation]  Get DIMM count.
423aa424beSGeorge Keishing    ${dimm_count}  ${stderr}=  Execute Command  lshw -short | grep DIMM | wc -l
433aa424beSGeorge Keishing    ...  return_stderr=True
443aa424beSGeorge Keishing    Should Be Empty  ${stderr}
453aa424beSGeorge Keishing    Log  ${\n}dimm_count: ${dimm_count}  console=yes
463aa424beSGeorge Keishing    [Return]  ${dimm_count}
473aa424beSGeorge Keishing
483aa424beSGeorge KeishingVerify Dimm Count
493aa424beSGeorge Keishing    [Documentation]  Verify DIMM count.
503aa424beSGeorge Keishing    [Arguments]  ${expected_dimm_count}
513aa424beSGeorge Keishing    ${dimm_count}=  Get Dimm Count
523aa424beSGeorge Keishing    Log  ${\n}dimm_count: ${dimm_count}  console=yes
533aa424beSGeorge Keishing    Should Be Equal As Integers  ${dimm_count}  ${expected_dimm_count}
543aa424beSGeorge Keishing    ...  msg=Error: dimm count doesn't match expected count.
553aa424beSGeorge Keishing
563aa424beSGeorge KeishingVerify Opal-Prd Installed
573aa424beSGeorge Keishing    [Documentation]  Check whether opal-prd.service is running on OS.
583aa424beSGeorge Keishing    ${output}  ${stderr}=  Execute Command  systemctl status opal-prd.service
593aa424beSGeorge Keishing    ...  return_stderr=True
603aa424beSGeorge Keishing    Should Be Empty  ${stderr}
613aa424beSGeorge Keishing    Log  ${\n}${output}  console=yes
623aa424beSGeorge Keishing    Should Not Contain  ${output}  could not be found
633aa424beSGeorge Keishing    ...  msg=Error: opal-prd.service is not installed.
643aa424beSGeorge Keishing
653aa424beSGeorge KeishingVerify No Gard Records
663aa424beSGeorge Keishing    [Documentation]  Verify no gard records are present on OS.
673aa424beSGeorge Keishing    ${output}  ${stderr}=  Execute Command  opal-gard list
683aa424beSGeorge Keishing    ...  return_stderr=True
693aa424beSGeorge Keishing    Should Be Empty  ${stderr}
703aa424beSGeorge Keishing    Should Contain  ${output}  No GARD entries to display
713aa424beSGeorge Keishing
723aa424beSGeorge KeishingVerify No Error Logs
733aa424beSGeorge Keishing    [Documentation]  Verify no error logs.
743aa424beSGeorge Keishing    ${output}  ${stderr}=  Execute Command  dmesg -xT -l emerg,alert,crit,err
753aa424beSGeorge Keishing    ...  return_stderr=True
763aa424beSGeorge Keishing    Should Be Empty  ${stderr}
773aa424beSGeorge Keishing    Should Be Empty  ${output}
78