2 Documentation Test Suite for BFD tunnel monitoring
3 Suite Setup Genius Suite Setup
4 Suite Teardown BFD Suite Stop
5 Test Teardown Genius Test Teardown ${data_models}
6 Library OperatingSystem
8 Library RequestsLibrary
12 Variables ../../variables/genius/Modules.py
13 Resource ../../libraries/DataModels.robot
14 Resource ../../libraries/Genius.robot
15 Resource ../../libraries/KarafKeywords.robot
16 Resource ../../libraries/OVSDB.robot
17 Resource ../../libraries/Utils.robot
18 Resource ../../libraries/VpnOperations.robot
19 Resource ../../variables/Variables.robot
23 ${genius_config_dir} ${CURDIR}/../../variables/genius
27 ${TEP_SHOW_STATE} tep:show-state
28 ${TUNNEL_MONITOR_ON} Tunnel Monitoring (for VXLAN tunnels): On
29 ${DEFAULT_MONITORING_INTERVAL} Tunnel Monitoring Interval (for VXLAN tunnels): 1000
30 ${TUNNEL_MONITOR_OFF} Tunnel Monitoring (for VXLAN tunnels): Off
31 ${INTERVAL_5000} {"tunnel-monitor-interval":{"interval":5000}}
33 ${ENABLE_MONITORING} {"tunnel-monitor-params":{"enabled":true,"monitor-protocol":"odl-interface:tunnel-monitoring-type-bfd"}}
34 ${DISABLE_MONITORING} {"tunnel-monitor-params":{"enabled":"false","monitor-protocol":"odl-interface:tunnel-monitoring-type-bfd"}}
35 ${TUNNEL_MONI_PARAMS_TRUE} true
36 ${TUNNEL_MONI_PARAMS_FALSE} false
37 ${INTERFACE_DS_MONI_FALSE} "odl-interface:monitor-enabled": false
38 ${INTERFACE_DS_MONI_TRUE} "odl-interface:monitor-enabled": true
39 ${INTERFACE_DS_MONI_INT_1000} "odl-interface:monitor-interval": 1000
40 ${INTERFACE_DS_MONI_INT_5000} "odl-interface:monitor-interval": 5000
41 ${TUNNEL_MONI_PROTO} tunnel-monitoring-type-bfd
44 BFD_TC00 Create ITM between DPNs Verify_BFD_Enablement
45 [Documentation] Create ITM between DPNs Verify_BFD_Enablement
46 ${Dpn_id_1} Genius.Get Dpn Ids ${conn_id_1}
47 ${Dpn_id_2} Genius.Get Dpn Ids ${conn_id_2}
48 ${vlan}= Set Variable 0
49 ${gateway-ip}= Set Variable 0.0.0.0
50 Genius.Create Vteps ${Dpn_id_1} ${Dpn_id_2} ${TOOLS_SYSTEM_IP} ${TOOLS_SYSTEM_2_IP} ${vlan} ${gateway-ip}
51 Wait Until Keyword Succeeds 30s 5s Genius.Verify Tunnel Status as UP TZA
53 BFD_TC01 Verify by default BFD monitoring is enabled on Controller
54 [Documentation] Verify by default BFD monitoring is enabled on Controller
55 Wait Until Keyword Succeeds 10s 2s Verify Tunnel Monitoring Is On
56 Wait Until Keyword Succeeds 10s 2s Verify Config Ietf Interface Output ${INTERFACE_DS_MONI_TRUE} ${INTERFACE_DS_MONI_INT_1000} ${TUNNEL_MONI_PROTO}
58 BFD_TC02 Verify that BFD tunnel monitoring interval is set with appropriate default value i.e.,1000
59 [Documentation] This will verify BFD tunnel monitoring default interval
60 ${output}= Issue Command On Karaf Console ${TEP_SHOW}
61 Should Contain ${output} ${DEFAULT_MONITORING_INTERVAL}
62 Wait Until Keyword Succeeds 10s 2s Verify Config Ietf Interface Output ${INTERFACE_DS_MONI_TRUE} ${INTERFACE_DS_MONI_INT_1000} ${TUNNEL_MONI_PROTO}
64 BFD_TC04 Verify that in controller tunnel status is up when ITM tunnel interface is brought up.
65 [Documentation] Verify that in controller tunnel status is up when ITM tunnel interface is brought up.
66 Wait Until Keyword Succeeds 10s 2s Verify Tunnel Monitoring Is On
67 Wait Until Keyword Succeeds 10s 1s Genius.Verify Tunnel Status as UP TZA
68 Wait Until Keyword Succeeds 10s 2s Verify Config Ietf Interface Output ${INTERFACE_DS_MONI_TRUE} ${INTERFACE_DS_MONI_INT_1000} ${TUNNEL_MONI_PROTO}
70 BFD_TC05 Verify BFD tunnel monitoring interval can be changed.
71 [Documentation] Verify BFD tunnel monitoring interval can be changed.
72 ${oper_int} RequestsLibrary.Put Request session ${CONFIG_API}/itm-config:tunnel-monitor-interval/ data=${INTERVAL_5000}
73 ${Bfd_updated_value}= Create List 5000
74 Wait Until Keyword Succeeds 30s 10s Check For Elements At Uri ${OPERATIONAL_API}/itm-config:tunnel-monitor-interval/ ${Bfd_updated_value}
75 Wait Until Keyword Succeeds 30s 10s Check For Elements At Uri ${CONFIG_API}/itm-config:tunnel-monitor-interval/ ${Bfd_updated_value}
76 Wait Until Keyword Succeeds 10s 2s Verify Config Ietf Interface Output ${INTERFACE_DS_MONI_TRUE} ${INTERFACE_DS_MONI_INT_5000} ${TUNNEL_MONI_PROTO}
77 ${tun_name} Wait Until Keyword Succeeds 20 5 Ovs Tunnel Get ${TOOLS_SYSTEM_1_IP}
78 Wait Until Keyword Succeeds 20s 5 OVSDB.Verify Ovs-vsctl Output list interface ${tun_name} 5000 ovs_system=${TOOLS_SYSTEM_1_IP}
79 ${tun_name} Wait Until Keyword Succeeds 20 5 Ovs Tunnel Get ${TOOLS_SYSTEM_2_IP}
80 Wait Until Keyword Succeeds 20s 5 OVSDB.Verify Ovs-vsctl Output list interface ${tun_name} 5000 ovs_system=${TOOLS_SYSTEM_2_IP}
82 BFD_TC06 Verify that the tunnel state goes to UNKNOWN when DPN is disconnected
83 [Documentation] Verify that the tunnel state goes to UNKNOWN when DPN is disconnected
84 Issue Command On Karaf Console ${TEP_SHOW}
85 Issue Command On Karaf Console ${TEP_SHOW_STATE}
86 SSHLibrary.Switch Connection ${conn_id_1}
87 Execute Command sudo ovs-vsctl del-controller BR1
88 SSHLibrary.Switch Connection ${conn_id_2}
89 Execute Command sudo ovs-vsctl del-controller BR2
90 Issue Command On Karaf Console ${TEP_SHOW}
91 Issue Command On Karaf Console ${TEP_SHOW_STATE}
92 Wait Until Keyword Succeeds 10s 1s Verify Tunnel Status as UNKNOWN
93 Wait Until Keyword Succeeds 10s 2s Verify Config Ietf Interface Output ${INTERFACE_DS_MONI_TRUE} ${INTERFACE_DS_MONI_INT_5000} ${TUNNEL_MONI_PROTO}
94 SSHLibrary.Switch Connection ${conn_id_1}
95 Execute Command sudo ovs-vsctl set-controller BR1 tcp:${ODL_SYSTEM_IP}:${ODL_OF_PORT}
96 SSHLibrary.Switch Connection ${conn_id_2}
97 Execute Command sudo ovs-vsctl set-controller BR2 tcp:${ODL_SYSTEM_IP}:${ODL_OF_PORT}
98 Log "After connecting CSS with controller"
99 Issue Command On Karaf Console ${TEP_SHOW}
100 Issue Command On Karaf Console ${TEP_SHOW_STATE}
101 Wait Until Keyword Succeeds 10s 1s Genius.Verify Tunnel Status as UP TZA
102 Wait Until Keyword Succeeds 10s 2s Verify Config Ietf Interface Output ${INTERFACE_DS_MONI_TRUE} ${INTERFACE_DS_MONI_INT_5000} ${TUNNEL_MONI_PROTO}
104 BFD_TC07 Verify that BFD monitoring is disabled on Controller
105 [Documentation] Verify that BFD monitoring is disabled on Controller
106 ${resp} RequestsLibrary.Put Request session ${CONFIG_API}/itm-config:tunnel-monitor-params/ data=${DISABLE_MONITORING}
107 Should Be Equal As Strings ${resp.status_code} 201
108 Wait Until Keyword Succeeds 10s 2s Verify Tunnel Monitoring Params ${TUNNEL_MONI_PARAMS_FALSE}
109 ${output}= Issue Command On Karaf Console ${TEP_SHOW}
110 Should Contain ${output} ${TUNNEL_MONITOR_OFF}
111 Wait Until Keyword Succeeds 10s 2s Verify Config Ietf Interface Output ${INTERFACE_DS_MONI_FALSE} ${INTERFACE_DS_MONI_INT_5000} ${TUNNEL_MONI_PROTO}
112 Wait Until Keyword Succeeds 10s 1s Genius.Verify Tunnel Status as UP TZA
113 ${resp} RequestsLibrary.Put Request session ${CONFIG_API}/itm-config:tunnel-monitor-params/ data=${ENABLE_MONITORING}
114 Should Be Equal As Strings ${resp.status_code} 200
115 Wait Until Keyword Succeeds 10s 2s Verify Tunnel Monitoring Params ${TUNNEL_MONI_PARAMS_TRUE}
116 Wait Until Keyword Succeeds 10s 2s Verify Tunnel Monitoring Is On
117 Wait Until Keyword Succeeds 10s 2s Verify Config Ietf Interface Output ${INTERFACE_DS_MONI_TRUE} ${INTERFACE_DS_MONI_INT_5000} ${TUNNEL_MONI_PROTO}
120 Verify Config Ietf Interface Output
121 [Arguments] ${state} ${interval} ${proto}
122 ${int_resp} RequestsLibrary.Get Request session ${CONFIG_API}/ietf-interfaces:interfaces/
123 ${respjson} RequestsLibrary.To Json ${int_resp.content} pretty_print=True
125 Should Contain ${respjson} ${state}
126 Should Contain ${respjson} ${interval}
127 Should Contain ${respjson} ${proto}
130 [Arguments] ${tools_ip}
131 [Documentation] This keyword will return the tunnel name on OVS
132 ${list_interface} Utils.Run Command On Remote System ${tools_ip} sudo ovs-vsctl list interface
133 ${tun_line} ${tun_name} Should Match Regexp ${list_interface} name\\s+: "(tun.*)"
135 Should Not Be Empty ${tun_name}
138 Verify Tunnel Monitoring Params
140 @{checklist} create list ${flag}
141 Check For Elements At URI ${OPERATIONAL_API}/itm-config:tunnel-monitor-params/ ${checklist}