Update Robot Framework format - step 3
[integration/test.git] / csit / suites / bgpcep / bgpfunct / 070_bgp_functional_l3vpn_mcast.robot
1 *** Settings ***
2 Documentation       Functional test for bgp - l3vpn-mutlicast
3 ...
4 ...                 Copyright (c) 2018 AT&T Intellectual Property. All rights reserved.
5 ...
6 ...                 This program and the accompanying materials are made available under the
7 ...                 terms of the Eclipse Public License v1.0 which accompanies this distbmution,
8 ...                 and is available at http://www.eclipse.org/legal/epl-v10.html
9 ...
10 ...                 This suite tests advertising l3vpn_mcast routes to odl. For advertising play.py is used,
11 ...                 and particular files are stored as *.hex files.
12 ...                 There are L3vpn-ipv4-multicast routes and L3vpn-ipv6-multicast routes tested.
13
14 Library             RequestsLibrary
15 Library             SSHLibrary
16 Library             String
17 Library             ../../../libraries/BgpRpcClient.py    ${TOOLS_SYSTEM_IP}
18 Resource            ../../../libraries/BGPcliKeywords.robot
19 Resource            ../../../libraries/BGPSpeaker.robot
20 Resource            ../../../libraries/BgpOperations.robot
21 Resource            ../../../libraries/SetupUtils.robot
22 Resource            ../../../libraries/SSHKeywords.robot
23 Resource            ../../../libraries/TemplatedRequests.robot
24 Resource            ../../../variables/Variables.robot
25
26 Suite Setup         Start_Suite
27 Suite Teardown      Stop_Suite
28 Test Setup          SetupUtils.Setup_Test_With_Logging_And_Without_Fast_Failing
29
30
31 *** Variables ***
32 ${HOLDTIME}                     180
33 ${CONFIG_SESSION}               config-session
34 ${L3VPN_MCAST_DIR}              ${CURDIR}/../../../variables/bgpfunctional/l3vpn_mcast
35 ${PLAY_SCRIPT}                  ${CURDIR}/../../../../tools/fastbgp/play.py
36 ${RIB_NAME}                     example-bgp-rib
37 &{L3VPN_MCAST_APP_PEER}         IP=${ODL_SYSTEM_IP}    BGP_RIB=${RIB_NAME}
38 &{L3VPN_MCAST_ODL_CONFIG}
39 ...                             IP=${TOOLS_SYSTEM_IP}
40 ...                             HOLDTIME=${HOLDTIME}
41 ...                             PEER_PORT=${BGP_TOOL_PORT}
42 ...                             INITIATE=false
43 ...                             BGP_RIB=${RIB_NAME}
44 ...                             PASSIVE_MODE=true
45
46
47 *** Test Cases ***
48 Configure_App_Peer
49     [Documentation]    Configures bgp application peer.
50     [Setup]    SetupUtils.Setup_Test_With_Logging_And_Without_Fast_Failing
51     TemplatedRequests.Put_As_Xml_Templated
52     ...    ${L3VPN_MCAST_DIR}/app_peer
53     ...    mapping=${L3VPN_MCAST_APP_PEER}
54     ...    session=${CONFIG_SESSION}
55
56 Reconfigure_ODL_To_Accept_Connection
57     [Documentation]    Configures BGP peer module with initiate-connection set to false.
58     [Setup]    SetupUtils.Setup_Test_With_Logging_And_Without_Fast_Failing
59     TemplatedRequests.Put_As_Xml_Templated
60     ...    ${L3VPN_MCAST_DIR}/bgp_peer
61     ...    mapping=${L3VPN_MCAST_ODL_CONFIG}
62     ...    session=${CONFIG_SESSION}
63
64 Start_Bgp_Peer
65     [Documentation]    Start Python speaker to connect to ODL. We need to do WUKS until odl really starts to accept incomming bgp connection. The failure happens if the incomming connection comes too quickly after configuring the peer in the previous test case.
66     [Setup]    SetupUtils.Setup_Test_With_Logging_And_Without_Fast_Failing
67     BuiltIn.Wait_Until_Keyword_Succeeds    3x    1s    Start Bgp Peer
68
69 Odl_To_Play_l3vpn_mcast
70     [Template]    Odl_To_Play_Template
71     l3vpn_mcast    ${L3VPN_MCAST_DIR}
72
73 Play_To_Odl_l3vpn_mcast
74     [Template]    Play_To_Odl_Template
75     l3vpn_mcast    ${L3VPN_MCAST_DIR}
76
77 Odl_To_Play_l3vpn_mcast_ipv6
78     [Template]    Odl_To_Play_Template
79     l3vpn_mcast_ipv6    ${L3VPN_MCAST_DIR}
80
81 Play_To_Odl_l3vpn_mcast_ipv6
82     [Template]    Play_To_Odl_Template
83     l3vpn_mcast_ipv6    ${L3VPN_MCAST_DIR}    ipv6
84
85 Kill_Talking_BGP_Speaker
86     [Documentation]    Abort the Python speaker
87     [Setup]    SetupUtils.Setup_Test_With_Logging_And_Without_Fast_Failing
88     BGPSpeaker.Kill_BGP_Speaker
89     BGPcliKeywords.Store_File_To_Workspace    play.py.out    l3vpn_mcast_play.log
90
91 Delete_Bgp_Peer_Configuration
92     [Documentation]    Revert the BGP configuration to the original state: without any configured peers.
93     [Setup]    SetupUtils.Setup_Test_With_Logging_And_Without_Fast_Failing
94     TemplatedRequests.Delete_Templated
95     ...    ${L3VPN_MCAST_DIR}/bgp_peer
96     ...    mapping=${L3VPN_MCAST_ODL_CONFIG}
97     ...    session=${CONFIG_SESSION}
98
99 Deconfigure_App_Peer
100     [Documentation]    Revert the BGP configuration to the original state: without application peer
101     [Setup]    SetupUtils.Setup_Test_With_Logging_And_Without_Fast_Failing
102     TemplatedRequests.Delete_Templated
103     ...    ${L3VPN_MCAST_DIR}/app_peer
104     ...    mapping=${L3VPN_MCAST_APP_PEER}
105     ...    session=${CONFIG_SESSION}
106
107
108 *** Keywords ***
109 Start_Suite
110     [Documentation]    Initialize SetupUtils. Suite setup keyword.
111     SetupUtils.Setup_Utils_For_Setup_And_Teardown
112     ${mininet_conn_id} =    SSHLibrary.Open Connection
113     ...    ${TOOLS_SYSTEM_IP}
114     ...    prompt=${DEFAULT_LINUX_PROMPT}
115     ...    timeout=6s
116     Builtin.Set Suite Variable    ${mininet_conn_id}
117     SSHKeywords.Flexible Mininet Login    ${TOOLS_SYSTEM_USER}
118     RequestsLibrary.Create Session    ${CONFIG_SESSION}    http://${ODL_SYSTEM_IP}:${RESTCONFPORT}    auth=${AUTH}
119     SSHLibrary.Put File    ${PLAY_SCRIPT}    .
120     SSHKeywords.Assure_Library_Ipaddr    target_dir=.
121
122 Stop_Suite
123     [Documentation]    Suite teardown keyword
124     SSHLibrary.Close_All_Connections
125     RequestsLibrary.Delete_All_Sessions
126
127 Start_Bgp_Peer
128     [Documentation]    Starts bgp peer and verifies that the peer runs.
129     BGPSpeaker.Start_BGP_Speaker
130     ...    --amount 0 --myip=${TOOLS_SYSTEM_IP} --myport=${BGP_TOOL_PORT} --peerip=${ODL_SYSTEM_IP} --peerport=${ODL_BGP_PORT} --debug --l3vpn_mcast --wfr 1
131     BGPcliKeywords.Read_And_Fail_If_Prompt_Is_Seen