CSIT-219: Realocate resources for Honeycomb tests
[csit.git] / resources / libraries / robot / honeycomb / notifications.robot
1 # Copyright (c) 2016 Cisco and/or its affiliates.
2 # Licensed under the Apache License, Version 2.0 (the "License");
3 # you may not use this file except in compliance with the License.
4 # You may obtain a copy of the License at:
5 #
6 #     http://www.apache.org/licenses/LICENSE-2.0
7 #
8 # Unless required by applicable law or agreed to in writing, software
9 # distributed under the License is distributed on an "AS IS" BASIS,
10 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11 # See the License for the specific language governing permissions and
12 # limitations under the License.
13
14 *** Settings ***
15 | Library | resources.libraries.python.honeycomb.Notifications
16 | Variables | resources/test_data/honeycomb/netconf/hello.py
17 | Variables | resources/test_data/honeycomb/netconf/subscription.py
18 | Documentation | Keywords used to test Honeycomb notifications over Netconf.
19
20 *** Keywords ***
21 | Notification listener is established
22 | | [Documentation] | Connects to Honeycomb notification service.
23 | | ...
24 | | ... | *Arguments:*
25 | | ... | - node - information about a DUT node. Type: dict
26 | | ...
27 | | ... | *Example:*
28 | | ...
29 | | ... | \| Notification listener is established \| ${nodes['DUT1']} \|
30 | | [Arguments] | ${node}
31 | | Create session | ${node} | ${hello}
32 | | Add notification listener | ${subscription}
33
34 | Honeycomb should send interface state notification
35 | | [Documentation] | Reads notification from Honeycomb and verifies\
36 | | ... | notification type, interface name and interface admin-state.
37 | | ...
38 | | ... | *Arguments:*
39 | | ... | - interface - name of the affected interface. Type: string
40 | | ... | - state - expected state of interface, 'up' or 'down'. Type: string
41 | | ...
42 | | ... | *Example:*
43 | | ...
44 | | ... | \| Honeycomb should send interface state notification \
45 | | ... | \| GigabitEthernet0/8/0 \| up \|
46 | | [Arguments] | ${interface} | ${state}
47 | | ${reply}= | Get notification
48 | | Should contain | ${reply} | <interface-state-change
49 | | Should contain | ${reply} | <name>${interface}</name>
50 | | Should contain | ${reply} | <admin-status>${state}</admin-status>
51
52 | Honeycomb should send interface deleted notification
53 | | [Documentation] | Reads notification from Honeycomb and verifies\
54 | | ... | notification type and interface name.
55 | | ...
56 | | ... | *Arguments:*
57 | | ... | - interface - name of the deleted interface. Type: string
58 | | ...
59 | | ... | *Example:*
60 | | ...
61 | | ... | \| Honeycomb should send interface deleted notification \
62 | | ... | \| temp_interface \|
63 | | [Arguments] | ${interface}
64 | | ${reply}= | Get notification
65 | | Should contain | ${reply} | <interface-deleted
66 | | Should contain | ${reply} | <name>${interface}</name>