Ashwini Chandrappa | fdfd7e3 | 2021-08-02 07:59:11 -0500 | [diff] [blame] | 1 | *** Settings *** |
| 2 | |
meghagn12345 | f942dae | 2021-08-27 02:53:00 -0500 | [diff] [blame] | 3 | Documentation Test OpenBMC GUI "Policies" sub-menu of "Security and Access" menu. |
Ashwini Chandrappa | fdfd7e3 | 2021-08-02 07:59:11 -0500 | [diff] [blame] | 4 | |
| 5 | Resource ../../lib/gui_resource.robot |
meghagn | 56eba26 | 2021-09-16 07:05:52 -0500 | [diff] [blame] | 6 | Resource ../lib/ipmi_client.robot |
meghagn | 2052fdd | 2021-12-07 02:42:31 -0600 | [diff] [blame] | 7 | Resource ../lib/protocol_setting_utils.robot |
| 8 | Resource ../lib/common_utils.robot |
Ashwini Chandrappa | fdfd7e3 | 2021-08-02 07:59:11 -0500 | [diff] [blame] | 9 | Suite Setup Launch Browser And Login GUI |
| 10 | Suite Teardown Close Browser |
| 11 | Test Setup Test Setup Execution |
| 12 | |
| 13 | |
| 14 | *** Variables *** |
| 15 | |
meghagn12345 | f942dae | 2021-08-27 02:53:00 -0500 | [diff] [blame] | 16 | ${xpath_policies_heading} //h1[text()="Policies"] |
| 17 | ${xpath_bmc_ssh_toggle} //*[@data-test-id='policies-toggle-bmcShell']/following-sibling::label |
meghagn | 56eba26 | 2021-09-16 07:05:52 -0500 | [diff] [blame] | 18 | ${xpath_network_ipmi_toggle} //*[@data-test-id='polices-toggle-networkIpmi']/following-sibling::label |
Ashwini Chandrappa | fdfd7e3 | 2021-08-02 07:59:11 -0500 | [diff] [blame] | 19 | |
| 20 | |
| 21 | *** Test Cases *** |
| 22 | |
Rahul Maheshwari | 142642d | 2021-08-24 00:00:15 -0500 | [diff] [blame] | 23 | Verify Navigation To Policies Page |
meghagn12345 | f942dae | 2021-08-27 02:53:00 -0500 | [diff] [blame] | 24 | [Documentation] Verify navigation to policies page. |
Rahul Maheshwari | 142642d | 2021-08-24 00:00:15 -0500 | [diff] [blame] | 25 | [Tags] Verify_Navigation_To_Policies_Page |
Ashwini Chandrappa | fdfd7e3 | 2021-08-02 07:59:11 -0500 | [diff] [blame] | 26 | |
Rahul Maheshwari | 142642d | 2021-08-24 00:00:15 -0500 | [diff] [blame] | 27 | Page Should Contain Element ${xpath_policies_heading} |
Ashwini Chandrappa | fdfd7e3 | 2021-08-02 07:59:11 -0500 | [diff] [blame] | 28 | |
| 29 | |
Rahul Maheshwari | 142642d | 2021-08-24 00:00:15 -0500 | [diff] [blame] | 30 | Verify 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 Chandrappa | fdfd7e3 | 2021-08-02 07:59:11 -0500 | [diff] [blame] | 33 | |
Ashwini Chandrappa | fdfd7e3 | 2021-08-02 07:59:11 -0500 | [diff] [blame] | 34 | Page Should Contain BMC shell (via SSH) |
| 35 | Page Should Contain Network IPMI (out-of-band IPMI) |
rramyasr-in | 03f4237 | 2022-06-16 11:51:11 -0500 | [diff] [blame] | 36 | 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 |
meghagn | 2052fdd | 2021-12-07 02:42:31 -0600 | [diff] [blame] | 42 | |
Ashwini Chandrappa | fdfd7e3 | 2021-08-02 07:59:11 -0500 | [diff] [blame] | 43 | |
Rahul Maheshwari | 142642d | 2021-08-24 00:00:15 -0500 | [diff] [blame] | 44 | Verify 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 Chandrappa | fdfd7e3 | 2021-08-02 07:59:11 -0500 | [diff] [blame] | 47 | |
| 48 | Page Should Contain Element ${xpath_bmc_ssh_toggle} |
| 49 | Page Should Contain Element ${xpath_network_ipmi_toggle} |
| 50 | |
| 51 | |
meghagn12345 | f942dae | 2021-08-27 02:53:00 -0500 | [diff] [blame] | 52 | Enable SSH Via GUI And Verify |
meghagn | 2052fdd | 2021-12-07 02:42:31 -0600 | [diff] [blame] | 53 | [Documentation] Login to GUI Policies page,enable SSH toggle and |
| 54 | ... verify that SSH to BMC starts working after enabling SSH. |
meghagn12345 | f942dae | 2021-08-27 02:53:00 -0500 | [diff] [blame] | 55 | [Tags] Enable_SSH_Via_GUI_And_Verify |
meghagn12345 | f942dae | 2021-08-27 02:53:00 -0500 | [diff] [blame] | 56 | |
meghagn | 2052fdd | 2021-12-07 02:42:31 -0600 | [diff] [blame] | 57 | Set Policy Via GUI SSH Enabled |
meghagn12345 | f942dae | 2021-08-27 02:53:00 -0500 | [diff] [blame] | 58 | Wait Until Keyword Succeeds 10 sec 5 sec Open Connection And Login |
| 59 | |
| 60 | |
meghagn | 07db962 | 2021-09-13 07:22:28 -0500 | [diff] [blame] | 61 | Disable SSH Via GUI And Verify |
meghagn | 2052fdd | 2021-12-07 02:42:31 -0600 | [diff] [blame] | 62 | [Documentation] Login to GUI Policies page,disable SSH and |
| 63 | ... verify that SSH to BMC stops working after disabling SSH. |
meghagn | 07db962 | 2021-09-13 07:22:28 -0500 | [diff] [blame] | 64 | [Tags] Disable_SSH_Via_GUI_And_Verify |
meghagn | 2052fdd | 2021-12-07 02:42:31 -0600 | [diff] [blame] | 65 | [Teardown] Run Keywords Enable SSH Protocol ${True} AND |
| 66 | ... Wait Until Keyword Succeeds 30 sec 10 sec Open Connection And Login |
meghagn | 07db962 | 2021-09-13 07:22:28 -0500 | [diff] [blame] | 67 | |
meghagn | 2052fdd | 2021-12-07 02:42:31 -0600 | [diff] [blame] | 68 | Set Policy Via GUI SSH Disabled |
meghagn | 07db962 | 2021-09-13 07:22:28 -0500 | [diff] [blame] | 69 | |
| 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 | |
meghagn | 56eba26 | 2021-09-16 07:05:52 -0500 | [diff] [blame] | 77 | Disable IPMI Via GUI And Verify |
meghagn | 2052fdd | 2021-12-07 02:42:31 -0600 | [diff] [blame] | 78 | [Documentation] Login to GUI Policies page,disable IPMI and |
George Keishing | de7e045 | 2022-02-01 07:04:41 -0600 | [diff] [blame] | 79 | ... verify that IPMI command does not work after disabling IPMI. |
meghagn | 56eba26 | 2021-09-16 07:05:52 -0500 | [diff] [blame] | 80 | [Tags] Disable_IPMI_Via_GUI_And_Verify |
meghagn | 56eba26 | 2021-09-16 07:05:52 -0500 | [diff] [blame] | 81 | |
meghagn | 2052fdd | 2021-12-07 02:42:31 -0600 | [diff] [blame] | 82 | Set Policy Via GUI IPMI Disabled |
meghagn | 56eba26 | 2021-09-16 07:05:52 -0500 | [diff] [blame] | 83 | |
| 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 | |
meghagn | b5c88b0 | 2021-09-14 00:32:27 -0500 | [diff] [blame] | 91 | Enable IPMI Via GUI And Verify |
meghagn | 2052fdd | 2021-12-07 02:42:31 -0600 | [diff] [blame] | 92 | [Documentation] Login to GUI Policies page,enable IPMI and |
| 93 | ... verify that IPMI command works after enabling IPMI. |
meghagn | b5c88b0 | 2021-09-14 00:32:27 -0500 | [diff] [blame] | 94 | [Tags] Enable_IPMI_Via_GUI_And_Verify |
meghagn | b5c88b0 | 2021-09-14 00:32:27 -0500 | [diff] [blame] | 95 | |
meghagn | 2052fdd | 2021-12-07 02:42:31 -0600 | [diff] [blame] | 96 | Set Policy Via GUI IPMI Enabled |
meghagn | b5c88b0 | 2021-09-14 00:32:27 -0500 | [diff] [blame] | 97 | Wait Until Keyword Succeeds 10 sec 5 sec Run IPMI Standard Command sel info |
| 98 | |
| 99 | |
meghagn | 2052fdd | 2021-12-07 02:42:31 -0600 | [diff] [blame] | 100 | Enable 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 | |
| 112 | Enable 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 Chandrappa | fdfd7e3 | 2021-08-02 07:59:11 -0500 | [diff] [blame] | 124 | *** Keywords *** |
| 125 | |
| 126 | Test Setup Execution |
| 127 | [Documentation] Do test case setup tasks. |
meghagn | 2052fdd | 2021-12-07 02:42:31 -0600 | [diff] [blame] | 128 | |
Rahul Maheshwari | 142642d | 2021-08-24 00:00:15 -0500 | [diff] [blame] | 129 | 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 |
meghagn12345 | f942dae | 2021-08-27 02:53:00 -0500 | [diff] [blame] | 132 | |
| 133 | |
meghagn | 2052fdd | 2021-12-07 02:42:31 -0600 | [diff] [blame] | 134 | Set 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} |