hardware: bios_version rework without dmidecode
[validation.git] / tests / hardware / bios_version / bios_version_dell.robot
1 ##############################################################################
2 # Copyright (c) 2019 AT&T Intellectual Property.                             #
3 # Copyright (c) 2019 Nokia.                                                  #
4 #                                                                            #
5 # Licensed under the Apache License, Version 2.0 (the "License");            #
6 # you maynot use this file except in compliance with the License.            #
7 #                                                                            #
8 # You may obtain a copy of the License at                                    #
9 #       http://www.apache.org/licenses/LICENSE-2.0                           #
10 #                                                                            #
11 # Unless required by applicable law or agreed to in writing, software        #
12 # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT  #
13 # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.           #
14 # See the License for the specific language governing permissions and        #
15 # limitations under the License.                                             #
16 ##############################################################################
17
18
19 *** Settings ***
20 Documentation     Check BIOS and HW details
21 Library           SSHLibrary
22 Library           OperatingSystem
23 Suite Setup       Open Connection And Log In
24 Suite Teardown    Close All Connections
25
26 *** Variables ***
27 #${HOST}           localhost
28 #${USERNAME}       localadmin
29 #${SYSINFO}        PowerEdge R740xd
30 #${BIOS_REVISION}  1.3
31 #${BLK_DEV_REGEXP} ([sh]d[a-z]+|nvme)[0-9]+
32 ${SSH_KEYFILE}     /root/.ssh/id_rsa
33 ${LOG}             ${LOG_PATH}${/}${SUITE_NAME.replace(' ','_')}.log
34
35 *** Test Cases ***
36 Get HW Details
37         [Documentation]         Verify HW details
38         Start Command           cat /sys/class/dmi/id/product_name
39         ${stdout}=              Read Command Output
40         Append To File          ${LOG}  ${stdout}${\n}
41         Should Contain          ${stdout}               ${SYSINFO}
42
43 Verify BIOS Revision
44         [Documentation]         Verify BIOS Revision
45         Start Command           printf "BIOS Revision: %u.%u" $(sudo od -t u1 -j 20 -N 2 -A none /sys/firmware/dmi/tables/DMI)
46         ${stdout}=              Read Command Output
47         Append To File          ${LOG}  ${stdout}${\n}
48         Should Contain          ${stdout}               BIOS Revision: ${BIOS_REVISION}
49
50 Check NUMA and CPU
51         [Documentation]         NUMAs and CPU components
52         ${output}=              Execute Command         lscpu
53         Append To File          ${LOG}  ${output}${\n}
54         Should Match Regexp     ${output}               CPU\\(s\\):\\s+\\d+
55
56 Verify Block Devices
57         [Documentation]         Reads the sysfs filesystem
58         ${output}=              Execute Command         lsblk
59         Append To File          ${LOG}  ${output}${\n}
60         Should Match Regexp     ${output}               ${BLK_DEV_REGEXP}
61
62 *** Keywords ***
63 Open Connection And Log In
64         Open Connection         ${HOST}
65         Login With Public Key   ${USERNAME}  ${SSH_KEYFILE}