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 | |
| 34 | Page Should Contain Network services |
| 35 | Page Should Contain BMC shell (via SSH) |
| 36 | Page Should Contain Network IPMI (out-of-band IPMI) |
meghagn | 2052fdd | 2021-12-07 02:42:31 -0600 | [diff] [blame] | 37 | |
Ashwini Chandrappa | fdfd7e3 | 2021-08-02 07:59:11 -0500 | [diff] [blame] | 38 | |
Rahul Maheshwari | 142642d | 2021-08-24 00:00:15 -0500 | [diff] [blame] | 39 | Verify 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 Chandrappa | fdfd7e3 | 2021-08-02 07:59:11 -0500 | [diff] [blame] | 42 | |
| 43 | Page Should Contain Element ${xpath_bmc_ssh_toggle} |
| 44 | Page Should Contain Element ${xpath_network_ipmi_toggle} |
| 45 | |
| 46 | |
meghagn12345 | f942dae | 2021-08-27 02:53:00 -0500 | [diff] [blame] | 47 | Enable SSH Via GUI And Verify |
meghagn | 2052fdd | 2021-12-07 02:42:31 -0600 | [diff] [blame] | 48 | [Documentation] Login to GUI Policies page,enable SSH toggle and |
| 49 | ... verify that SSH to BMC starts working after enabling SSH. |
meghagn12345 | f942dae | 2021-08-27 02:53:00 -0500 | [diff] [blame] | 50 | [Tags] Enable_SSH_Via_GUI_And_Verify |
meghagn12345 | f942dae | 2021-08-27 02:53:00 -0500 | [diff] [blame] | 51 | |
meghagn | 2052fdd | 2021-12-07 02:42:31 -0600 | [diff] [blame] | 52 | Set Policy Via GUI SSH Enabled |
meghagn12345 | f942dae | 2021-08-27 02:53:00 -0500 | [diff] [blame] | 53 | Wait Until Keyword Succeeds 10 sec 5 sec Open Connection And Login |
| 54 | |
| 55 | |
meghagn | 07db962 | 2021-09-13 07:22:28 -0500 | [diff] [blame] | 56 | Disable SSH Via GUI And Verify |
meghagn | 2052fdd | 2021-12-07 02:42:31 -0600 | [diff] [blame] | 57 | [Documentation] Login to GUI Policies page,disable SSH and |
| 58 | ... verify that SSH to BMC stops working after disabling SSH. |
meghagn | 07db962 | 2021-09-13 07:22:28 -0500 | [diff] [blame] | 59 | [Tags] Disable_SSH_Via_GUI_And_Verify |
meghagn | 2052fdd | 2021-12-07 02:42:31 -0600 | [diff] [blame] | 60 | [Teardown] Run Keywords Enable SSH Protocol ${True} AND |
| 61 | ... Wait Until Keyword Succeeds 30 sec 10 sec Open Connection And Login |
meghagn | 07db962 | 2021-09-13 07:22:28 -0500 | [diff] [blame] | 62 | |
meghagn | 2052fdd | 2021-12-07 02:42:31 -0600 | [diff] [blame] | 63 | Set Policy Via GUI SSH Disabled |
meghagn | 07db962 | 2021-09-13 07:22:28 -0500 | [diff] [blame] | 64 | |
| 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 | |
meghagn | 56eba26 | 2021-09-16 07:05:52 -0500 | [diff] [blame] | 72 | Disable IPMI Via GUI And Verify |
meghagn | 2052fdd | 2021-12-07 02:42:31 -0600 | [diff] [blame] | 73 | [Documentation] Login to GUI Policies page,disable IPMI and |
George Keishing | de7e045 | 2022-02-01 07:04:41 -0600 | [diff] [blame] | 74 | ... verify that IPMI command does not work after disabling IPMI. |
meghagn | 56eba26 | 2021-09-16 07:05:52 -0500 | [diff] [blame] | 75 | [Tags] Disable_IPMI_Via_GUI_And_Verify |
meghagn | 56eba26 | 2021-09-16 07:05:52 -0500 | [diff] [blame] | 76 | |
meghagn | 2052fdd | 2021-12-07 02:42:31 -0600 | [diff] [blame] | 77 | Set Policy Via GUI IPMI Disabled |
meghagn | 56eba26 | 2021-09-16 07:05:52 -0500 | [diff] [blame] | 78 | |
| 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 | |
meghagn | b5c88b0 | 2021-09-14 00:32:27 -0500 | [diff] [blame] | 86 | Enable IPMI Via GUI And Verify |
meghagn | 2052fdd | 2021-12-07 02:42:31 -0600 | [diff] [blame] | 87 | [Documentation] Login to GUI Policies page,enable IPMI and |
| 88 | ... verify that IPMI command works after enabling IPMI. |
meghagn | b5c88b0 | 2021-09-14 00:32:27 -0500 | [diff] [blame] | 89 | [Tags] Enable_IPMI_Via_GUI_And_Verify |
meghagn | b5c88b0 | 2021-09-14 00:32:27 -0500 | [diff] [blame] | 90 | |
meghagn | 2052fdd | 2021-12-07 02:42:31 -0600 | [diff] [blame] | 91 | Set Policy Via GUI IPMI Enabled |
meghagn | b5c88b0 | 2021-09-14 00:32:27 -0500 | [diff] [blame] | 92 | Wait Until Keyword Succeeds 10 sec 5 sec Run IPMI Standard Command sel info |
| 93 | |
| 94 | |
meghagn | 2052fdd | 2021-12-07 02:42:31 -0600 | [diff] [blame] | 95 | Enable 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 | |
| 107 | Enable 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 Chandrappa | fdfd7e3 | 2021-08-02 07:59:11 -0500 | [diff] [blame] | 119 | *** Keywords *** |
| 120 | |
| 121 | Test Setup Execution |
| 122 | [Documentation] Do test case setup tasks. |
meghagn | 2052fdd | 2021-12-07 02:42:31 -0600 | [diff] [blame] | 123 | |
Rahul Maheshwari | 142642d | 2021-08-24 00:00:15 -0500 | [diff] [blame] | 124 | 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 |
meghagn12345 | f942dae | 2021-08-27 02:53:00 -0500 | [diff] [blame] | 127 | |
| 128 | |
meghagn | 2052fdd | 2021-12-07 02:42:31 -0600 | [diff] [blame] | 129 | Set 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} |