blob: 22c189886706b48a822fd3812e00ff1b8c5513e6 [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
Prashanth Kattib974a742017-05-25 06:52:29 -050046Add Nodes To Group List
47 [Documentation] Add BMC nodes into group.
48 [Tags] Move_Added_Nodes_To_Group
49
50 # Add BMC nodes to group and validate.
51 : FOR ${bmc} IN @{BMC_LIST}
52 / Add Nodes To Group ${bmc} ${GROUP}
53 / Validate Node Added In Group ${bmc} ${GROUP}
54
Prashanth Katti1dcd5392017-05-12 04:35:53 -050055*** Keywords ***
56
57Validate XCAT Setup
58 [Documentation] Validate XCAT setup.
59
60 Open Connection And Login To XCAT
61
62 # Check if XCAT is installed.
63 ${cmd_output}= Execute Command ${XCAT_DIR_PATH}/lsxcatd -v
64 Should Not Be Empty ${cmd_output} msg=XCAT not installed.
65
66 Log \n XCAT Version is: \n${cmd_output}
Prashanth Katti477debc2017-05-19 03:01:04 -050067
68 # Get all the BMC nodes from the config file.
69 ${nodes}= Get List Of BMC Nodes
70 # Make a list of BMC nodes.
71 @{BMC_LIST}= Split To Lines ${nodes}
72 Log To Console BMC nodes to be added:\n ${BMC_LIST}
73 Set Suite Variable @{BMC_LIST}
74
75Validate Power Status Via XCAT
76 [Documentation] Validate power status.
77 [Arguments] ${node} ${flag}=ON
78
79 ${status}= Get Power Status ${node}
80 Run Keyword If '${flag}' == 'ON'
81 ... Should Contain ${status} on msg=Host is off.
82 ... ELSE Should Contain ${status} off msg=Host is on.