blob: dbb14456cb940dd22d7c9ab3d715c3d2078c72d5 [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
Ashwini Chandrappafdfd7e32021-08-02 07:59:11 -05007Suite Setup Launch Browser And Login GUI
8Suite Teardown Close Browser
9Test Setup Test Setup Execution
10
11
12*** Variables ***
13
meghagn12345f942dae2021-08-27 02:53:00 -050014${xpath_policies_heading} //h1[text()="Policies"]
15${xpath_bmc_ssh_toggle} //*[@data-test-id='policies-toggle-bmcShell']/following-sibling::label
meghagn56eba262021-09-16 07:05:52 -050016${xpath_network_ipmi_toggle} //*[@data-test-id='polices-toggle-networkIpmi']/following-sibling::label
Ashwini Chandrappafdfd7e32021-08-02 07:59:11 -050017
18
19*** Test Cases ***
20
Rahul Maheshwari142642d2021-08-24 00:00:15 -050021Verify Navigation To Policies Page
meghagn12345f942dae2021-08-27 02:53:00 -050022 [Documentation] Verify navigation to policies page.
Rahul Maheshwari142642d2021-08-24 00:00:15 -050023 [Tags] Verify_Navigation_To_Policies_Page
Ashwini Chandrappafdfd7e32021-08-02 07:59:11 -050024
Rahul Maheshwari142642d2021-08-24 00:00:15 -050025 Page Should Contain Element ${xpath_policies_heading}
Ashwini Chandrappafdfd7e32021-08-02 07:59:11 -050026
27
Rahul Maheshwari142642d2021-08-24 00:00:15 -050028Verify 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 Chandrappafdfd7e32021-08-02 07:59:11 -050031
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 Maheshwari142642d2021-08-24 00:00:15 -050037Verify 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 Chandrappafdfd7e32021-08-02 07:59:11 -050040
41 Page Should Contain Element ${xpath_bmc_ssh_toggle}
42 Page Should Contain Element ${xpath_network_ipmi_toggle}
43
44
meghagn12345f942dae2021-08-27 02:53:00 -050045Enable 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
meghagn07db9622021-09-13 07:22:28 -050070Disable 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
meghagn56eba262021-09-16 07:05:52 -050099Disable 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
Ashwini Chandrappafdfd7e32021-08-02 07:59:11 -0500129*** Keywords ***
130
131Test Setup Execution
132 [Documentation] Do test case setup tasks.
Rahul Maheshwari142642d2021-08-24 00:00:15 -0500133 Click Element ${xpath_secuity_and_accesss_menu}
134 Click Element ${xpath_policies_sub_menu}
135 Wait Until Keyword Succeeds 30 sec 10 sec Location Should Contain policies
meghagn12345f942dae2021-08-27 02:53:00 -0500136
137