1*3aa424beSGeorge Keishing*** Settings ***
2*3aa424beSGeorge KeishingDocumentation      Keywords for system data information.
3*3aa424beSGeorge Keishing
4*3aa424beSGeorge KeishingResource           ../syslib/utils_os.robot
5*3aa424beSGeorge Keishing
6*3aa424beSGeorge Keishing*** Variables ***
7*3aa424beSGeorge Keishing
8*3aa424beSGeorge Keishing*** Keywords ***
9*3aa424beSGeorge KeishingGet PNOR Info
10*3aa424beSGeorge Keishing    [Documentation]  Get PNOR information.
11*3aa424beSGeorge Keishing    ${version}  ${stderr}=  Execute Command  pflash -r /dev/stdout -P VERSION
12*3aa424beSGeorge Keishing    ...  return_stderr=True
13*3aa424beSGeorge Keishing    Should Be Empty  ${stderr}
14*3aa424beSGeorge Keishing    Log  ${\n}version: ${version}  console=yes
15*3aa424beSGeorge Keishing    [Return]  ${version}
16*3aa424beSGeorge Keishing
17*3aa424beSGeorge KeishingGet Inventory
18*3aa424beSGeorge Keishing    [Documentation]  Get system inventory.
19*3aa424beSGeorge Keishing    ${inventory}  ${stderr}=  Execute Command  lshw -short  return_stderr=True
20*3aa424beSGeorge Keishing    Should Be Empty  ${stderr}
21*3aa424beSGeorge Keishing    Log  ${\n}inventory: ${inventory}  console=yes
22*3aa424beSGeorge Keishing    [Return]  ${inventory}
23*3aa424beSGeorge Keishing
24*3aa424beSGeorge KeishingGet Memory Count
25*3aa424beSGeorge Keishing    [Documentation]  Get Memory Count.
26*3aa424beSGeorge Keishing    ${memory_count}  ${stderr}=
27*3aa424beSGeorge Keishing    ...  Execute Command  lshw -short | grep memory | wc -l  return_stderr=True
28*3aa424beSGeorge Keishing    Should Be Empty  ${stderr}
29*3aa424beSGeorge Keishing    Log  ${\n}memory count: ${memory_count}  console=yes
30*3aa424beSGeorge Keishing    [Return]  ${memory_count}
31*3aa424beSGeorge Keishing
32*3aa424beSGeorge KeishingVerify Memory Count
33*3aa424beSGeorge Keishing    [Documentation]  Verify memory count.
34*3aa424beSGeorge Keishing    [Arguments]  ${expected_memory_count}
35*3aa424beSGeorge Keishing    ${memory_count}=  Get Memory Count
36*3aa424beSGeorge Keishing    Log  ${\n}memory count: ${memory_count}  console=yes
37*3aa424beSGeorge Keishing    Should Be Equal As Integers  ${memory_count}  ${expected_memory_count}
38*3aa424beSGeorge Keishing    ...  Error: memory count doesn't match expected count.
39*3aa424beSGeorge Keishing
40*3aa424beSGeorge KeishingGet Dimm Count
41*3aa424beSGeorge Keishing    [Documentation]  Get DIMM count.
42*3aa424beSGeorge Keishing    ${dimm_count}  ${stderr}=  Execute Command  lshw -short | grep DIMM | wc -l
43*3aa424beSGeorge Keishing    ...  return_stderr=True
44*3aa424beSGeorge Keishing    Should Be Empty  ${stderr}
45*3aa424beSGeorge Keishing    Log  ${\n}dimm_count: ${dimm_count}  console=yes
46*3aa424beSGeorge Keishing    [Return]  ${dimm_count}
47*3aa424beSGeorge Keishing
48*3aa424beSGeorge KeishingVerify Dimm Count
49*3aa424beSGeorge Keishing    [Documentation]  Verify DIMM count.
50*3aa424beSGeorge Keishing    [Arguments]  ${expected_dimm_count}
51*3aa424beSGeorge Keishing    ${dimm_count}=  Get Dimm Count
52*3aa424beSGeorge Keishing    Log  ${\n}dimm_count: ${dimm_count}  console=yes
53*3aa424beSGeorge Keishing    Should Be Equal As Integers  ${dimm_count}  ${expected_dimm_count}
54*3aa424beSGeorge Keishing    ...  msg=Error: dimm count doesn't match expected count.
55*3aa424beSGeorge Keishing
56*3aa424beSGeorge KeishingVerify Opal-Prd Installed
57*3aa424beSGeorge Keishing    [Documentation]  Check whether opal-prd.service is running on OS.
58*3aa424beSGeorge Keishing    ${output}  ${stderr}=  Execute Command  systemctl status opal-prd.service
59*3aa424beSGeorge Keishing    ...  return_stderr=True
60*3aa424beSGeorge Keishing    Should Be Empty  ${stderr}
61*3aa424beSGeorge Keishing    Log  ${\n}${output}  console=yes
62*3aa424beSGeorge Keishing    Should Not Contain  ${output}  could not be found
63*3aa424beSGeorge Keishing    ...  msg=Error: opal-prd.service is not installed.
64*3aa424beSGeorge Keishing
65*3aa424beSGeorge KeishingVerify No Gard Records
66*3aa424beSGeorge Keishing    [Documentation]  Verify no gard records are present on OS.
67*3aa424beSGeorge Keishing    ${output}  ${stderr}=  Execute Command  opal-gard list
68*3aa424beSGeorge Keishing    ...  return_stderr=True
69*3aa424beSGeorge Keishing    Should Be Empty  ${stderr}
70*3aa424beSGeorge Keishing    Should Contain  ${output}  No GARD entries to display
71*3aa424beSGeorge Keishing
72*3aa424beSGeorge KeishingVerify No Error Logs
73*3aa424beSGeorge Keishing    [Documentation]  Verify no error logs.
74*3aa424beSGeorge Keishing    ${output}  ${stderr}=  Execute Command  dmesg -xT -l emerg,alert,crit,err
75*3aa424beSGeorge Keishing    ...  return_stderr=True
76*3aa424beSGeorge Keishing    Should Be Empty  ${stderr}
77*3aa424beSGeorge Keishing    Should Be Empty  ${output}
78