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 |
Ashwini Chandrappa | fdfd7e3 | 2021-08-02 07:59:11 -0500 | [diff] [blame] | 7 | Suite Setup Launch Browser And Login GUI |
| 8 | Suite Teardown Close Browser |
| 9 | Test Setup Test Setup Execution |
| 10 | |
| 11 | |
| 12 | *** Variables *** |
| 13 | |
meghagn12345 | f942dae | 2021-08-27 02:53:00 -0500 | [diff] [blame] | 14 | ${xpath_policies_heading} //h1[text()="Policies"] |
| 15 | ${xpath_bmc_ssh_toggle} //*[@data-test-id='policies-toggle-bmcShell']/following-sibling::label |
meghagn | 56eba26 | 2021-09-16 07:05:52 -0500 | [diff] [blame] | 16 | ${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] | 17 | |
| 18 | |
| 19 | *** Test Cases *** |
| 20 | |
Rahul Maheshwari | 142642d | 2021-08-24 00:00:15 -0500 | [diff] [blame] | 21 | Verify Navigation To Policies Page |
meghagn12345 | f942dae | 2021-08-27 02:53:00 -0500 | [diff] [blame] | 22 | [Documentation] Verify navigation to policies page. |
Rahul Maheshwari | 142642d | 2021-08-24 00:00:15 -0500 | [diff] [blame] | 23 | [Tags] Verify_Navigation_To_Policies_Page |
Ashwini Chandrappa | fdfd7e3 | 2021-08-02 07:59:11 -0500 | [diff] [blame] | 24 | |
Rahul Maheshwari | 142642d | 2021-08-24 00:00:15 -0500 | [diff] [blame] | 25 | Page Should Contain Element ${xpath_policies_heading} |
Ashwini Chandrappa | fdfd7e3 | 2021-08-02 07:59:11 -0500 | [diff] [blame] | 26 | |
| 27 | |
Rahul Maheshwari | 142642d | 2021-08-24 00:00:15 -0500 | [diff] [blame] | 28 | Verify Existence Of All Sections In Policies Page |
| 29 | [Documentation] Verify existence of all sections in policies page. |
| 30 | [Tags] Verify_Existence_Of_All_Sections_In_Policies_Page |
Ashwini Chandrappa | fdfd7e3 | 2021-08-02 07:59:11 -0500 | [diff] [blame] | 31 | |
| 32 | Page Should Contain Network services |
| 33 | Page Should Contain BMC shell (via SSH) |
| 34 | Page Should Contain Network IPMI (out-of-band IPMI) |
| 35 | |
| 36 | |
Rahul Maheshwari | 142642d | 2021-08-24 00:00:15 -0500 | [diff] [blame] | 37 | Verify Existence Of All Buttons In Policies Page |
| 38 | [Documentation] Verify existence of All Buttons in policies page. |
| 39 | [Tags] Verify_Existence_Of_All_Buttons_In_Policies_Page |
Ashwini Chandrappa | fdfd7e3 | 2021-08-02 07:59:11 -0500 | [diff] [blame] | 40 | |
| 41 | Page Should Contain Element ${xpath_bmc_ssh_toggle} |
| 42 | Page Should Contain Element ${xpath_network_ipmi_toggle} |
| 43 | |
| 44 | |
meghagn12345 | f942dae | 2021-08-27 02:53:00 -0500 | [diff] [blame] | 45 | Enable SSH Via GUI And Verify |
| 46 | [Documentation] Verify that SSH to BMC starts working after enabling SSH. |
| 47 | [Tags] Enable_SSH_Via_GUI_And_Verify |
| 48 | [Teardown] Run Keywords Redfish.Patch /redfish/v1/Managers/bmc/NetworkProtocol |
| 49 | ... body={"SSH":{"ProtocolEnabled":True}} valid_status_codes=[200, 204] AND |
| 50 | ... Wait Until Keyword Succeeds 30 sec 5 sec Open Connection And Login |
| 51 | |
| 52 | # Disable ssh via Redfish. |
| 53 | Redfish.Patch /redfish/v1/Managers/bmc/NetworkProtocol body={"SSH":{"ProtocolEnabled":False}} |
| 54 | ... valid_status_codes=[200, 204] |
| 55 | |
| 56 | # Wait for GUI to reflect disable SSH status. |
| 57 | Wait Until Keyword Succeeds 30 sec 10 sec |
| 58 | ... Refresh GUI And Verify Element Value ${xpath_bmc_ssh_toggle} Disabled |
| 59 | |
| 60 | # Enable ssh via GUI. |
| 61 | Click Element ${xpath_bmc_ssh_toggle} |
| 62 | |
| 63 | # Wait for GUI to reflect enable SSH status. |
| 64 | Wait Until Keyword Succeeds 30 sec 10 sec |
| 65 | ... Refresh GUI And Verify Element Value ${xpath_bmc_ssh_toggle} Enabled |
| 66 | |
| 67 | Wait Until Keyword Succeeds 10 sec 5 sec Open Connection And Login |
| 68 | |
| 69 | |
meghagn | 07db962 | 2021-09-13 07:22:28 -0500 | [diff] [blame] | 70 | Disable SSH Via GUI And Verify |
| 71 | [Documentation] Verify that SSH to BMC stops working after disabling SSH. |
| 72 | [Tags] Disable_SSH_Via_GUI_And_Verify |
| 73 | [Teardown] Run Keywords Redfish.Patch /redfish/v1/Managers/bmc/NetworkProtocol |
| 74 | ... body={"SSH":{"ProtocolEnabled":True}} valid_status_codes=[200, 204] AND |
| 75 | ... Wait Until Keyword Succeeds 30 sec 5 sec Open Connection And Login |
| 76 | |
| 77 | # Enable ssh via Redfish. |
| 78 | Redfish.Patch /redfish/v1/Managers/bmc/NetworkProtocol body={"SSH":{"ProtocolEnabled":True}} |
| 79 | ... valid_status_codes=[200, 204] |
| 80 | |
| 81 | # Wait for GUI to reflect enable SSH status. |
| 82 | Wait Until Keyword Succeeds 30 sec 10 sec |
| 83 | ... Refresh GUI And Verify Element Value ${xpath_bmc_ssh_toggle} Enabled |
| 84 | |
| 85 | # Disable ssh via GUI. |
| 86 | Click Element ${xpath_bmc_ssh_toggle} |
| 87 | |
| 88 | # Wait for GUI to reflect disable SSH status. |
| 89 | Wait Until Keyword Succeeds 30 sec 10 sec |
| 90 | ... Refresh GUI And Verify Element Value ${xpath_bmc_ssh_toggle} Disabled |
| 91 | |
| 92 | ${status}= Run Keyword And Return Status |
| 93 | ... Open Connection And Login |
| 94 | |
| 95 | Should Be Equal As Strings ${status} False |
| 96 | ... msg=SSH login still working after disabling SSH. |
| 97 | |
| 98 | |
meghagn | 56eba26 | 2021-09-16 07:05:52 -0500 | [diff] [blame] | 99 | Disable IPMI Via GUI And Verify |
| 100 | [Documentation] Verify that IPMI command doesnot work after disabling IPMI. |
| 101 | [Tags] Disable_IPMI_Via_GUI_And_Verify |
| 102 | [Teardown] Redfish.Patch /redfish/v1/Managers/bmc/NetworkProtocol |
| 103 | ... body={"IPMI":{"ProtocolEnabled":True}} valid_status_codes=[200, 204] |
| 104 | |
| 105 | # Due to github issue 2125 we are using click element instead of select checkbox. |
| 106 | # https://github.com/openbmc/openbmc-test-automation/issues/2125. |
| 107 | # Enable IPMI via Redfish. |
| 108 | Redfish.Patch /redfish/v1/Managers/bmc/NetworkProtocol body={"IPMI":{"ProtocolEnabled":True}} |
| 109 | ... valid_status_codes=[200, 204] |
| 110 | |
| 111 | # Wait for GUI to reflect enable IPMI status. |
| 112 | Wait Until Keyword Succeeds 30 sec 10 sec |
| 113 | ... Refresh GUI And Verify Element Value ${xpath_network_ipmi_toggle} Enabled |
| 114 | |
| 115 | # Disable IPMI via GUI. |
| 116 | Click Element ${xpath_network_ipmi_toggle} |
| 117 | |
| 118 | # Wait for GUI to reflect disable IPMI status. |
| 119 | Wait Until Keyword Succeeds 30 sec 10 sec |
| 120 | ... Refresh GUI And Verify Element Value ${xpath_network_ipmi_toggle} Disabled |
| 121 | |
| 122 | ${status}= Run Keyword And Return Status |
| 123 | ... Wait Until Keyword Succeeds 10 sec 5 sec Run IPMI Standard Command sel info |
| 124 | |
| 125 | Should Be Equal As Strings ${status} False |
| 126 | ... msg=IPMI command is working after disabling IPMI. |
| 127 | |
| 128 | |
meghagn | b5c88b0 | 2021-09-14 00:32:27 -0500 | [diff] [blame] | 129 | Enable IPMI Via GUI And Verify |
| 130 | [Documentation] Verify that IPMI command works after enabling IPMI. |
| 131 | [Tags] Enable_IPMI_Via_GUI_And_Verify |
| 132 | [Teardown] Redfish.Patch /redfish/v1/Managers/bmc/NetworkProtocol |
| 133 | ... body={"IPMI":{"ProtocolEnabled":True}} valid_status_codes=[200, 204] |
| 134 | |
| 135 | # Due to github issue 2125 we are using click element instead of select checkbox. |
| 136 | # https://github.com/openbmc/openbmc-test-automation/issues/2125. |
| 137 | # Disable ipmi via Redfish. |
| 138 | Redfish.Patch /redfish/v1/Managers/bmc/NetworkProtocol body={"IPMI":{"ProtocolEnabled":False}} |
| 139 | ... valid_status_codes=[200, 204] |
| 140 | |
| 141 | # Wait for GUI to reflect disable IPMI status. |
| 142 | Wait Until Keyword Succeeds 30 sec 10 sec |
| 143 | ... Refresh GUI And Verify Element Value ${xpath_network_ipmi_toggle} Disabled |
| 144 | |
| 145 | # Enable ipmi via GUI. |
| 146 | Click Element ${xpath_network_ipmi_toggle} |
| 147 | |
| 148 | # Wait for GUI to reflect enable IPMI status. |
| 149 | Wait Until Keyword Succeeds 30 sec 10 sec |
| 150 | ... Refresh GUI And Verify Element Value ${xpath_network_ipmi_toggle} Enabled |
| 151 | |
| 152 | Wait Until Keyword Succeeds 10 sec 5 sec Run IPMI Standard Command sel info |
| 153 | |
| 154 | |
Ashwini Chandrappa | fdfd7e3 | 2021-08-02 07:59:11 -0500 | [diff] [blame] | 155 | *** Keywords *** |
| 156 | |
| 157 | Test Setup Execution |
| 158 | [Documentation] Do test case setup tasks. |
Rahul Maheshwari | 142642d | 2021-08-24 00:00:15 -0500 | [diff] [blame] | 159 | Click Element ${xpath_secuity_and_accesss_menu} |
| 160 | Click Element ${xpath_policies_sub_menu} |
| 161 | Wait Until Keyword Succeeds 30 sec 10 sec Location Should Contain policies |
meghagn12345 | f942dae | 2021-08-27 02:53:00 -0500 | [diff] [blame] | 162 | |
| 163 | |