blob: 1b10dabb9cf560dd1d3173f215bb9c3678d1978c [file] [log] [blame]
Ubuntuf45d1aa2020-02-06 07:01:44 +00001# Copyright 2018 Open Networking Foundation
mccd7e9502019-12-16 22:04:13 +00002#
3# Licensed under the Apache License, Version 2.0 (the "License");
4# you may not use this file except in compliance with the License.
5# You may obtain a copy of the License at
6#
7# http://www.apache.org/licenses/LICENSE-2.0
8#
9# Unless required by applicable law or agreed to in writing, software
10# distributed under the License is distributed on an "AS IS" BASIS,
11# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12# See the License for the specific language governing permissions and
13# limitations under the License.
14
15*** Settings ***
Ubuntuf45d1aa2020-02-06 07:01:44 +000016Documentation Provide the function to perform funtional tests for the Redfish device-management project
17Suite Setup Get IP AND PORT
mccd7e9502019-12-16 22:04:13 +000018Library Process
19Library OperatingSystem
Ubuntuf45d1aa2020-02-06 07:01:44 +000020Library BuiltIn
21Library String
22Library Collections
23
24*** Variables ***
25@{ADDR_LIST} 192.168.4.26:8888 192.168.4.27:8888
mccd7e9502019-12-16 22:04:13 +000026
27*** Test Cases ***
Ubuntuf45d1aa2020-02-06 07:01:44 +000028Add Device to Monitor
29 [Documentation] This test case excercises the API, SendDeviceList, which registers Redfish devices to monitor.
30 ${EXPECTED}= RUN sed -e '/^\\/\\//d' -e 's/ip1/${IP1}/g' -e 's/port1/${PORT1}/g' -e 's/ip2/${IP2}/g' -e 's/port2/${PORT2}/g' tests/add_device_to_monitor.expected
31 ${OUTPUT}= Run Process tests/add_device_to_monitor.tc ${IP1} ${PORT1} ${IP2} ${PORT2}
mccd7e9502019-12-16 22:04:13 +000032 Should Be Equal ${EXPECTED} ${OUTPUT.stdout}
33
Ubuntuf45d1aa2020-02-06 07:01:44 +000034Clear Subscribed Events
35 [Documentation] This test case excercises the API, ClearCurrentEventList, which clears all Redfish evets currently subscribed to.
36 ${EXPECTED}= RUN sed -e '/^\\/\\//d' -e 's/ip1/${IP1}/g' -e 's/port1/${PORT1}/g' tests/clear_all_subscribed_events.expected
37 ${OUTPUT}= Run Process tests/clear_all_subscribed_events.tc ${IP1} ${PORT1}
38 Should Be Equal ${EXPECTED} ${OUTPUT.stdout}
39
40Configure Data Polling Interval
41 [Documentation] This test case excercises the API, SetFrequency, which configures the interval of data polling.
42 ${EXPECTED}= RUN sed -e '/^\\/\\//d' -e 's/ip1/${IP1}/g' -e 's/port1/${PORT1}/g' tests/configure_data_polling_interval.expected
43 ${OUTPUT}= Run Process tests/configure_data_polling_interval.tc ${IP1} ${PORT1}
44 Should Be Equal ${EXPECTED} ${OUTPUT.stdout}
45
46Delete Monitored Device
47 [Documentation] This test case excercises the API, DeleteDeviceList, which deletes Redfish devices being monitored.
48 ${EXPECTED}= RUN sed -e '/^\\/\\//d' -e 's/ip1/${IP1}/g' -e 's/port1/${PORT1}/g' -e 's/ip2/${IP2}/g' -e 's/port2/${PORT2}/g' tests/delete_monitored_device.expected
49 ${OUTPUT}= Run Process tests/delete_monitored_device.tc ${IP1} ${PORT1} ${IP2} ${PORT2}
50 Should Be Equal ${EXPECTED} ${OUTPUT.stdout}
51
52List Devices monitored
53 [Documentation] This test case excercises the API, GetCurrentDevices, which lists all Redfish devices being monitored.
54 ${EXPECTED}= RUN sed -e '/^\\/\\//d' -e 's/ip1/${IP1}/g' -e 's/port1/${PORT1}/g' -e 's/ip2/${IP2}/g' -e 's/port2/${PORT2}/g' tests/list_device_monitored.expected
55 ${OUTPUT}= Run Process tests/list_device_monitored.tc ${IP1} ${PORT1} ${IP2} ${PORT2}
56 Should Be Equal ${EXPECTED} ${OUTPUT.stdout}
57
58List Subscribed Events
59 [Documentation] This test case excercises the API, GetCurrentEventList, which lists all Redfish evets currently subscribed to.
60 ${EXPECTED}= RUN sed -e '/^\\/\\//d' -e 's/ip1/${IP1}/g' -e 's/port1/${PORT1}/g' tests/list_subscribed_events.expected
61 ${OUTPUT}= Run Process tests/list_subscribed_events.tc ${IP1} ${PORT1}
62 Should Be Equal ${EXPECTED} ${OUTPUT.stdout}
63
64List Supported Events
65 [Documentation] This test case excercises the API, GetEventList, which lists all supported Redfish events.
66 ${EXPECTED}= RUN sed -e '/^\\/\\//d' -e 's/ip1/${IP1}/g' -e 's/port1/${PORT1}/g' tests/list_supported_events.expected
67 ${OUTPUT}= Run Process tests/list_supported_events.tc ${IP1} ${PORT1}
68 Should Be Equal ${EXPECTED} ${OUTPUT.stdout}
69
70Subscribe Events
71 [Documentation] This test case excercises the API, SubscribeGivenEvents, which subscribes to the specified events.
72 ${EXPECTED}= RUN sed -e '/^\\/\\//d' -e 's/ip1/${IP1}/g' -e 's/port1/${PORT1}/g' tests/subscribe_events.expected
73 ${OUTPUT}= Run Process tests/subscribe_events.tc ${IP1} ${PORT1}
74 Should Be Equal ${EXPECTED} ${OUTPUT.stdout}
75
76Unsubscribe Events
77 [Documentation] This test case excercises the API, UnsubscribeGivenEvents, which unsubscribes to the specified events.
78 ${EXPECTED}= RUN sed -e '/^\\/\\//d' -e 's/ip1/${IP1}/g' -e 's/port1/${PORT1}/g' tests/unsubscribe_events.expected
79 ${OUTPUT}= Run Process tests/unsubscribe_events.tc ${IP1} ${PORT1}
80 Should Be Equal ${EXPECTED} ${OUTPUT.stdout}
81
82Validate IP
83 [Documentation] This test case validates the format of IP, whcih is expected to be in the form of <ip>:<port>.
84 ${EXPECTED}= RUN sed -e '/^\\/\\//d' -e 's/ip1/${IP1}/g' -e 's/port1/${PORT1}/g' tests/validate_ip.expected
85 ${OUTPUT}= Run Process tests/validate_ip.tc ${IP1} ${PORT1}
86 Should Be Equal ${EXPECTED} ${OUTPUT.stdout}
87
88*** Keywords ***
89Get IP AND PORT
90 Sort List ${ADDR_LIST}
91 ${I1}= Fetch From LEFT ${ADDR_LIST}[0] :
92 Set Suite Variable ${IP1} ${I1}
93 ${P1}= Fetch From Right ${ADDR_LIST}[0] :
94 Set Suite Variable ${PORT1} ${P1}
95 ${I2}= Fetch From LEFT ${ADDR_LIST}[1] :
96 Set Suite Variable ${IP2} ${I2}
97 ${P2}= Fetch From Right ${ADDR_LIST}[1] :
98 Set Suite Variable ${PORT2} ${P2}