blob: 7a6fb1fdf864983c4d49c96c14bb99faa51ab42e [file] [log] [blame]
Prashanth Katti1dcd5392017-05-12 04:35:53 -05001*** Settings ***
2Documentation Module for testing BMC via XCAT.
3
4Resource ../lib/xcat/resource.txt
5Resource ../lib/xcat/xcat_utils.robot
6
7Library OperatingSystem
Prashanth Katti477debc2017-05-19 03:01:04 -05008Library String
Prashanth Katti1dcd5392017-05-12 04:35:53 -05009
10Suite Setup Validate XCAT Setup
11
Prashanth Katti477debc2017-05-19 03:01:04 -050012*** Variables ***
13
14${poweron_flag} ON
15${poweroff_flag} OFF
16
Prashanth Katti1dcd5392017-05-12 04:35:53 -050017*** Test Cases ***
18
19Add BMC Nodes To XCAT
20 [Documentation] Connect and add BMC nodes.
21 [Tags] Add_BMC_Nodes_To_XCAT
22
Prashanth Katti477debc2017-05-19 03:01:04 -050023 # Add BMC nodes one by one and check whether it is successfully added.
24 : FOR ${bmc} IN @{BMC_LIST}
25 \ Add Nodes To XCAT ${bmc}
26 \ Validate Added Node ${bmc}
Prashanth Katti1dcd5392017-05-12 04:35:53 -050027
Prashanth Katti477debc2017-05-19 03:01:04 -050028Power On Via XCAT And Validate
29 [Documentation] Power on via XCAT and validate.
30 [Tags] Power_On_Via_XCAT_And_Validate
31
32 # Power on each BMC node and validate the power status.
33 : FOR ${bmc} IN @{BMC_LIST}
34 \ Power On Via XCAT ${bmc}
35 \ Validate Power Status Via XCAT ${bmc} ${poweron_flag}
36
37Power Off Via XCAT And Validate
38 [Documentation] Power off via XCAT and validate.
39 [Tags] Power_Off_Via_XCAT_And_Validate
40
41 # Power off each BMC node and validate the power status.
42 : FOR ${bmc} IN @{BMC_LIST}
43 \ Power Off Via XCAT ${bmc}
44 \ Validate Power Status Via XCAT ${bmc} ${poweroff_flag}
Prashanth Katti1dcd5392017-05-12 04:35:53 -050045
46*** Keywords ***
47
48Validate XCAT Setup
49 [Documentation] Validate XCAT setup.
50
51 Open Connection And Login To XCAT
52
53 # Check if XCAT is installed.
54 ${cmd_output}= Execute Command ${XCAT_DIR_PATH}/lsxcatd -v
55 Should Not Be Empty ${cmd_output} msg=XCAT not installed.
56
57 Log \n XCAT Version is: \n${cmd_output}
Prashanth Katti477debc2017-05-19 03:01:04 -050058
59 # Get all the BMC nodes from the config file.
60 ${nodes}= Get List Of BMC Nodes
61 # Make a list of BMC nodes.
62 @{BMC_LIST}= Split To Lines ${nodes}
63 Log To Console BMC nodes to be added:\n ${BMC_LIST}
64 Set Suite Variable @{BMC_LIST}
65
66Validate Power Status Via XCAT
67 [Documentation] Validate power status.
68 [Arguments] ${node} ${flag}=ON
69
70 ${status}= Get Power Status ${node}
71 Run Keyword If '${flag}' == 'ON'
72 ... Should Contain ${status} on msg=Host is off.
73 ... ELSE Should Contain ${status} off msg=Host is on.