blob: eef48d866205a5412d44e7644e31fa6bc5f89c81 [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
Ashwini Chandrappafdfd7e32021-08-02 07:59:11 -050034 Page Should Contain BMC shell (via SSH)
35 Page Should Contain Network IPMI (out-of-band IPMI)
rramyasr-in03f42372022-06-16 11:51:11 -050036 Page Should Contain Host TPM
37 Page Should Contain VirtualTPM
38 Page Should Contain RTAD
39 Page Should Contain USB firmware update policy
40 Page Should Contain Secure version lock-in
41 Page Should Contain Host USB enablement
meghagn2052fdd2021-12-07 02:42:31 -060042
Ashwini Chandrappafdfd7e32021-08-02 07:59:11 -050043
Rahul Maheshwari142642d2021-08-24 00:00:15 -050044Verify Existence Of All Buttons In Policies Page
45 [Documentation] Verify existence of All Buttons in policies page.
46 [Tags] Verify_Existence_Of_All_Buttons_In_Policies_Page
Ashwini Chandrappafdfd7e32021-08-02 07:59:11 -050047
48 Page Should Contain Element ${xpath_bmc_ssh_toggle}
49 Page Should Contain Element ${xpath_network_ipmi_toggle}
50
51
meghagn12345f942dae2021-08-27 02:53:00 -050052Enable SSH Via GUI And Verify
meghagn2052fdd2021-12-07 02:42:31 -060053 [Documentation] Login to GUI Policies page,enable SSH toggle and
54 ... verify that SSH to BMC starts working after enabling SSH.
meghagn12345f942dae2021-08-27 02:53:00 -050055 [Tags] Enable_SSH_Via_GUI_And_Verify
meghagn12345f942dae2021-08-27 02:53:00 -050056
meghagn2052fdd2021-12-07 02:42:31 -060057 Set Policy Via GUI SSH Enabled
meghagn12345f942dae2021-08-27 02:53:00 -050058 Wait Until Keyword Succeeds 10 sec 5 sec Open Connection And Login
59
60
meghagn07db9622021-09-13 07:22:28 -050061Disable SSH Via GUI And Verify
meghagn2052fdd2021-12-07 02:42:31 -060062 [Documentation] Login to GUI Policies page,disable SSH and
63 ... verify that SSH to BMC stops working after disabling SSH.
meghagn07db9622021-09-13 07:22:28 -050064 [Tags] Disable_SSH_Via_GUI_And_Verify
meghagn2052fdd2021-12-07 02:42:31 -060065 [Teardown] Run Keywords Enable SSH Protocol ${True} AND
66 ... Wait Until Keyword Succeeds 30 sec 10 sec Open Connection And Login
meghagn07db9622021-09-13 07:22:28 -050067
meghagn2052fdd2021-12-07 02:42:31 -060068 Set Policy Via GUI SSH Disabled
meghagn07db9622021-09-13 07:22:28 -050069
70 ${status}= Run Keyword And Return Status
71 ... Open Connection And Login
72
73 Should Be Equal As Strings ${status} False
74 ... msg=SSH login still working after disabling SSH.
75
76
meghagn56eba262021-09-16 07:05:52 -050077Disable IPMI Via GUI And Verify
meghagn2052fdd2021-12-07 02:42:31 -060078 [Documentation] Login to GUI Policies page,disable IPMI and
George Keishingde7e0452022-02-01 07:04:41 -060079 ... verify that IPMI command does not work after disabling IPMI.
meghagn56eba262021-09-16 07:05:52 -050080 [Tags] Disable_IPMI_Via_GUI_And_Verify
meghagn56eba262021-09-16 07:05:52 -050081
meghagn2052fdd2021-12-07 02:42:31 -060082 Set Policy Via GUI IPMI Disabled
meghagn56eba262021-09-16 07:05:52 -050083
84 ${status}= Run Keyword And Return Status
85 ... Wait Until Keyword Succeeds 10 sec 5 sec Run IPMI Standard Command sel info
86
87 Should Be Equal As Strings ${status} False
88 ... msg=IPMI command is working after disabling IPMI.
89
90
meghagnb5c88b02021-09-14 00:32:27 -050091Enable IPMI Via GUI And Verify
meghagn2052fdd2021-12-07 02:42:31 -060092 [Documentation] Login to GUI Policies page,enable IPMI and
93 ... verify that IPMI command works after enabling IPMI.
meghagnb5c88b02021-09-14 00:32:27 -050094 [Tags] Enable_IPMI_Via_GUI_And_Verify
meghagnb5c88b02021-09-14 00:32:27 -050095
meghagn2052fdd2021-12-07 02:42:31 -060096 Set Policy Via GUI IPMI Enabled
meghagnb5c88b02021-09-14 00:32:27 -050097 Wait Until Keyword Succeeds 10 sec 5 sec Run IPMI Standard Command sel info
98
99
meghagn2052fdd2021-12-07 02:42:31 -0600100Enable SSH Via GUI And Verify Persistency On BMC Reboot
101 [Documentation] Login to GUI Policies page,enable SSH and
102 ... verify persistency of SSH connection on BMC reboot.
103 [Tags] Enable_SSH_Via_GUI_And_Verify_Persistency_On_BMC_Reboot
104
105 Set Policy Via GUI SSH Enabled
106
107 Reboot BMC via GUI
108
109 Wait Until Keyword Succeeds 5 min 30 sec Open Connection And Login
110
111
112Enable IPMI Via GUI And Verify Persistency On BMC Reboot
113 [Documentation] Login to GUI Policies page,enable IPMI and
114 ... verify persistency of IPMI command work on BMC reboot.
115 [Tags] Enable_IPMI_Via_GUI_And_Verify_Persistency_On_BMC_Reboot
116
117 Set Policy Via GUI IPMI Enabled
118
119 Reboot BMC via GUI
120
121 Wait Until Keyword Succeeds 2 min 30 sec Run IPMI Standard Command sel info
122
123
Ashwini Chandrappafdfd7e32021-08-02 07:59:11 -0500124*** Keywords ***
125
126Test Setup Execution
127 [Documentation] Do test case setup tasks.
meghagn2052fdd2021-12-07 02:42:31 -0600128
Rahul Maheshwari142642d2021-08-24 00:00:15 -0500129 Click Element ${xpath_secuity_and_accesss_menu}
130 Click Element ${xpath_policies_sub_menu}
131 Wait Until Keyword Succeeds 30 sec 10 sec Location Should Contain policies
meghagn12345f942dae2021-08-27 02:53:00 -0500132
133
meghagn2052fdd2021-12-07 02:42:31 -0600134Set Policy Via GUI
135
136 [Documentation] Login to GUI Policies page and set policy.
137 [Arguments] ${policy} ${state}
138
139 # Description of argument(s):
140 # policy policy to be set(e.g. SSH, IPMI).
141 # state state to be set(e.g. Enable, Disable).
142
143 ${opposite_state_gui} ${opposite_state_redfish}= Run Keyword If
144 ... '${state}' == 'Enabled' Set Variable Disabled ${False}
145 ... ELSE IF '${state}' == 'Disabled' Set Variable Enabled ${True}
146
147 # Setting policy to an opposite value via Redfish.
148 Run Keyword If '${policy}' == 'SSH'
149 ... Enable SSH Protocol ${opposite_state_redfish}
150 ... ELSE IF '${policy}' == 'IPMI'
151 ... Enable IPMI Protocol ${opposite_state_redfish}
152
153 ${policy_toggle_button}= Run Keyword If '${policy}' == 'SSH'
154 ... Set variable ${xpath_bmc_ssh_toggle}
155 ... ELSE IF '${policy}' == 'IPMI'
156 ... Set variable ${xpath_network_ipmi_toggle}
157
158 Wait Until Keyword Succeeds 1 min 30 sec
159 ... Refresh GUI And Verify Element Value ${policy_toggle_button} ${opposite_state_gui}
160 Click Element ${policy_toggle_button}
161
162 # Wait for GUI to reflect policy status.
163 Wait Until Keyword Succeeds 1 min 30 sec
164 ... Refresh GUI And Verify Element Value ${policy_toggle_button} ${state}