blob: 4eb10fe4db4b3022d2b6a47dfc929e9bacee7cda [file] [log] [blame]
Ashwini Chandrappafdfd7e32021-08-02 07:59:11 -05001*** Settings ***
2
meghagn12345f942dae2021-08-27 02:53:00 -05003Documentation Test OpenBMC GUI "Policies" sub-menu of "Security and Access" menu.
Ashwini Chandrappafdfd7e32021-08-02 07:59:11 -05004
5Resource ../../lib/gui_resource.robot
meghagn56eba262021-09-16 07:05:52 -05006Resource ../lib/ipmi_client.robot
meghagn2052fdd2021-12-07 02:42:31 -06007Resource ../lib/protocol_setting_utils.robot
8Resource ../lib/common_utils.robot
Ashwini Chandrappafdfd7e32021-08-02 07:59:11 -05009Suite Setup Launch Browser And Login GUI
10Suite Teardown Close Browser
11Test Setup Test Setup Execution
12
13
14*** Variables ***
15
meghagn12345f942dae2021-08-27 02:53:00 -050016${xpath_policies_heading} //h1[text()="Policies"]
17${xpath_bmc_ssh_toggle} //*[@data-test-id='policies-toggle-bmcShell']/following-sibling::label
meghagn56eba262021-09-16 07:05:52 -050018${xpath_network_ipmi_toggle} //*[@data-test-id='polices-toggle-networkIpmi']/following-sibling::label
Ashwini Chandrappafdfd7e32021-08-02 07:59:11 -050019
20
21*** Test Cases ***
22
Rahul Maheshwari142642d2021-08-24 00:00:15 -050023Verify Navigation To Policies Page
meghagn12345f942dae2021-08-27 02:53:00 -050024 [Documentation] Verify navigation to policies page.
Rahul Maheshwari142642d2021-08-24 00:00:15 -050025 [Tags] Verify_Navigation_To_Policies_Page
Ashwini Chandrappafdfd7e32021-08-02 07:59:11 -050026
Rahul Maheshwari142642d2021-08-24 00:00:15 -050027 Page Should Contain Element ${xpath_policies_heading}
Ashwini Chandrappafdfd7e32021-08-02 07:59:11 -050028
29
Rahul Maheshwari142642d2021-08-24 00:00:15 -050030Verify Existence Of All Sections In Policies Page
31 [Documentation] Verify existence of all sections in policies page.
32 [Tags] Verify_Existence_Of_All_Sections_In_Policies_Page
Ashwini Chandrappafdfd7e32021-08-02 07:59:11 -050033
34 Page Should Contain Network services
35 Page Should Contain BMC shell (via SSH)
36 Page Should Contain Network IPMI (out-of-band IPMI)
meghagn2052fdd2021-12-07 02:42:31 -060037
Ashwini Chandrappafdfd7e32021-08-02 07:59:11 -050038
Rahul Maheshwari142642d2021-08-24 00:00:15 -050039Verify Existence Of All Buttons In Policies Page
40 [Documentation] Verify existence of All Buttons in policies page.
41 [Tags] Verify_Existence_Of_All_Buttons_In_Policies_Page
Ashwini Chandrappafdfd7e32021-08-02 07:59:11 -050042
43 Page Should Contain Element ${xpath_bmc_ssh_toggle}
44 Page Should Contain Element ${xpath_network_ipmi_toggle}
45
46
meghagn12345f942dae2021-08-27 02:53:00 -050047Enable SSH Via GUI And Verify
meghagn2052fdd2021-12-07 02:42:31 -060048 [Documentation] Login to GUI Policies page,enable SSH toggle and
49 ... verify that SSH to BMC starts working after enabling SSH.
meghagn12345f942dae2021-08-27 02:53:00 -050050 [Tags] Enable_SSH_Via_GUI_And_Verify
meghagn12345f942dae2021-08-27 02:53:00 -050051
meghagn2052fdd2021-12-07 02:42:31 -060052 Set Policy Via GUI SSH Enabled
meghagn12345f942dae2021-08-27 02:53:00 -050053 Wait Until Keyword Succeeds 10 sec 5 sec Open Connection And Login
54
55
meghagn07db9622021-09-13 07:22:28 -050056Disable SSH Via GUI And Verify
meghagn2052fdd2021-12-07 02:42:31 -060057 [Documentation] Login to GUI Policies page,disable SSH and
58 ... verify that SSH to BMC stops working after disabling SSH.
meghagn07db9622021-09-13 07:22:28 -050059 [Tags] Disable_SSH_Via_GUI_And_Verify
meghagn2052fdd2021-12-07 02:42:31 -060060 [Teardown] Run Keywords Enable SSH Protocol ${True} AND
61 ... Wait Until Keyword Succeeds 30 sec 10 sec Open Connection And Login
meghagn07db9622021-09-13 07:22:28 -050062
meghagn2052fdd2021-12-07 02:42:31 -060063 Set Policy Via GUI SSH Disabled
meghagn07db9622021-09-13 07:22:28 -050064
65 ${status}= Run Keyword And Return Status
66 ... Open Connection And Login
67
68 Should Be Equal As Strings ${status} False
69 ... msg=SSH login still working after disabling SSH.
70
71
meghagn56eba262021-09-16 07:05:52 -050072Disable IPMI Via GUI And Verify
meghagn2052fdd2021-12-07 02:42:31 -060073 [Documentation] Login to GUI Policies page,disable IPMI and
George Keishingde7e0452022-02-01 07:04:41 -060074 ... verify that IPMI command does not work after disabling IPMI.
meghagn56eba262021-09-16 07:05:52 -050075 [Tags] Disable_IPMI_Via_GUI_And_Verify
meghagn56eba262021-09-16 07:05:52 -050076
meghagn2052fdd2021-12-07 02:42:31 -060077 Set Policy Via GUI IPMI Disabled
meghagn56eba262021-09-16 07:05:52 -050078
79 ${status}= Run Keyword And Return Status
80 ... Wait Until Keyword Succeeds 10 sec 5 sec Run IPMI Standard Command sel info
81
82 Should Be Equal As Strings ${status} False
83 ... msg=IPMI command is working after disabling IPMI.
84
85
meghagnb5c88b02021-09-14 00:32:27 -050086Enable IPMI Via GUI And Verify
meghagn2052fdd2021-12-07 02:42:31 -060087 [Documentation] Login to GUI Policies page,enable IPMI and
88 ... verify that IPMI command works after enabling IPMI.
meghagnb5c88b02021-09-14 00:32:27 -050089 [Tags] Enable_IPMI_Via_GUI_And_Verify
meghagnb5c88b02021-09-14 00:32:27 -050090
meghagn2052fdd2021-12-07 02:42:31 -060091 Set Policy Via GUI IPMI Enabled
meghagnb5c88b02021-09-14 00:32:27 -050092 Wait Until Keyword Succeeds 10 sec 5 sec Run IPMI Standard Command sel info
93
94
meghagn2052fdd2021-12-07 02:42:31 -060095Enable SSH Via GUI And Verify Persistency On BMC Reboot
96 [Documentation] Login to GUI Policies page,enable SSH and
97 ... verify persistency of SSH connection on BMC reboot.
98 [Tags] Enable_SSH_Via_GUI_And_Verify_Persistency_On_BMC_Reboot
99
100 Set Policy Via GUI SSH Enabled
101
102 Reboot BMC via GUI
103
104 Wait Until Keyword Succeeds 5 min 30 sec Open Connection And Login
105
106
107Enable IPMI Via GUI And Verify Persistency On BMC Reboot
108 [Documentation] Login to GUI Policies page,enable IPMI and
109 ... verify persistency of IPMI command work on BMC reboot.
110 [Tags] Enable_IPMI_Via_GUI_And_Verify_Persistency_On_BMC_Reboot
111
112 Set Policy Via GUI IPMI Enabled
113
114 Reboot BMC via GUI
115
116 Wait Until Keyword Succeeds 2 min 30 sec Run IPMI Standard Command sel info
117
118
Ashwini Chandrappafdfd7e32021-08-02 07:59:11 -0500119*** Keywords ***
120
121Test Setup Execution
122 [Documentation] Do test case setup tasks.
meghagn2052fdd2021-12-07 02:42:31 -0600123
Rahul Maheshwari142642d2021-08-24 00:00:15 -0500124 Click Element ${xpath_secuity_and_accesss_menu}
125 Click Element ${xpath_policies_sub_menu}
126 Wait Until Keyword Succeeds 30 sec 10 sec Location Should Contain policies
meghagn12345f942dae2021-08-27 02:53:00 -0500127
128
meghagn2052fdd2021-12-07 02:42:31 -0600129Set Policy Via GUI
130
131 [Documentation] Login to GUI Policies page and set policy.
132 [Arguments] ${policy} ${state}
133
134 # Description of argument(s):
135 # policy policy to be set(e.g. SSH, IPMI).
136 # state state to be set(e.g. Enable, Disable).
137
138 ${opposite_state_gui} ${opposite_state_redfish}= Run Keyword If
139 ... '${state}' == 'Enabled' Set Variable Disabled ${False}
140 ... ELSE IF '${state}' == 'Disabled' Set Variable Enabled ${True}
141
142 # Setting policy to an opposite value via Redfish.
143 Run Keyword If '${policy}' == 'SSH'
144 ... Enable SSH Protocol ${opposite_state_redfish}
145 ... ELSE IF '${policy}' == 'IPMI'
146 ... Enable IPMI Protocol ${opposite_state_redfish}
147
148 ${policy_toggle_button}= Run Keyword If '${policy}' == 'SSH'
149 ... Set variable ${xpath_bmc_ssh_toggle}
150 ... ELSE IF '${policy}' == 'IPMI'
151 ... Set variable ${xpath_network_ipmi_toggle}
152
153 Wait Until Keyword Succeeds 1 min 30 sec
154 ... Refresh GUI And Verify Element Value ${policy_toggle_button} ${opposite_state_gui}
155 Click Element ${policy_toggle_button}
156
157 # Wait for GUI to reflect policy status.
158 Wait Until Keyword Succeeds 1 min 30 sec
159 ... Refresh GUI And Verify Element Value ${policy_toggle_button} ${state}