+
+Bmp_Monitor_Precondition
+ [Arguments] ${session}
+ [Documentation] Verify example-bmp-monitor presence in bmp-monitors
+ &{mapping} BuiltIn.Create_Dictionary TOOL_IP=${TOOLS_SYSTEM_IP}
+ BuiltIn.Wait_Until_Keyword_Succeeds 6x 10s TemplatedRequests.Get_As_Json_Templated folder=${BGP_BMP_FEAT_DIR} mapping=${mapping} verify=True
+ ... session=${session}
+
+Bmp_Monitor_Postcondition
+ [Arguments] ${session}
+ [Documentation] Verifies if example-bmp-monitor data contains one peer.
+ ${routes_line} = CompareStream.Set_Variable_If_At_Least_Neon ${NEW_IPV4_ROUTES_LINE} ${OLD_IPV4_ROUTES_LINE}
+ &{mapping} BuiltIn.Create_Dictionary TOOL_IP=${TOOLS_SYSTEM_IP} ROUTES_LINE=${routes_line}
+ ${output} BuiltIn.Wait_Until_Keyword_Succeeds 10x 5s TemplatedRequests.Get_As_Json_Templated folder=${BGP_BMP_DIR} mapping=${mapping}
+ ... session=${session} verify=True
+ BuiltIn.Log ${output}
+
+Odl_To_Play_Template
+ [Arguments] ${totest} ${dir} ${remove}=True
+ ${announce_hex} = OperatingSystem.Get_File ${dir}/${totest}/announce_${totest}.hex
+ ${announce_hex} = String.Remove_String ${announce_hex} \n
+ ${withdraw_hex} = OperatingSystem.Get_File ${dir}/${totest}/withdraw_${totest}.hex
+ ${withdraw_hex} = String.Remove_String ${withdraw_hex} \n
+ BuiltIn.Run_Keyword_If '${remove}' == 'True' BgpRpcClient.play_clean
+ TemplatedRequests.Post_As_Xml_Templated ${dir}/${totest}/app mapping=${APP_PEER} session=${CONFIG_SESSION}
+ ${update} BuiltIn.Wait_Until_Keyword_Succeeds 3x 2s Get_Update_Message
+ Verify_Two_Hex_Messages_Are_Equal ${update} ${announce_hex}
+ BgpRpcClient.play_clean
+ Remove_Configured_Routes ${totest} ${dir}
+ ${update} BuiltIn.Wait_Until_Keyword_Succeeds 3x 2s Get_Update_Message
+ Verify_Two_Hex_Messages_Are_Equal ${update} ${withdraw_hex}
+ [Teardown] Remove_Configured_Routes ${totest} ${dir}
+
+Play_To_Odl_Template
+ [Arguments] ${totest} ${dir} ${ipv}=ipv4
+ ${as_path} = CompareStream.Set_Variable_If_At_Least_Neon ${NEW_AS_PATH} ${OLD_AS_PATH}
+ &{adj_rib_in} BuiltIn.Create_Dictionary PATH=peer/bgp:%2F%2F${TOOLS_SYSTEM_IP}/adj-rib-in BGP_RIB=${RIB_NAME} AS_PATH=${as_path}
+ &{effective_rib_in} BuiltIn.Create_Dictionary PATH=peer/bgp:%2F%2F${TOOLS_SYSTEM_IP}/effective-rib-in BGP_RIB=${RIB_NAME} AS_PATH=${as_path}
+ &{loc_rib} BuiltIn.Create_Dictionary PATH=loc-rib BGP_RIB=${RIB_NAME} AS_PATH=${as_path}
+ ${announce_hex} = OperatingSystem.Get_File ${dir}/${totest}/announce_${totest}.hex
+ ${withdraw_hex} = OperatingSystem.Get_File ${dir}/${totest}/withdraw_${totest}.hex
+ BgpRpcClient.play_clean
+ BgpRpcClient.play_send ${announce_hex}
+ BuiltIn.Wait_Until_Keyword_Succeeds 3x 2s TemplatedRequests.Get_As_Json_Templated ${dir}/${totest}/rib mapping=${adj_rib_in} session=${CONFIG_SESSION}
+ ... verify=True
+ BuiltIn.Wait_Until_Keyword_Succeeds 3x 2s TemplatedRequests.Get_As_Json_Templated ${dir}/${totest}/rib mapping=${effective_rib_in} session=${CONFIG_SESSION}
+ ... verify=True
+ BuiltIn.Wait_Until_Keyword_Succeeds 3x 2s TemplatedRequests.Get_As_Json_Templated ${dir}/${totest}/rib mapping=${loc_rib} session=${CONFIG_SESSION}
+ ... verify=True
+ BgpRpcClient.play_send ${withdraw_hex}
+ BuiltIn.Wait_Until_Keyword_Succeeds 3x 2s TemplatedRequests.Get_As_Json_Templated ${dir}/empty_routes/${ipv} mapping=${loc_rib} session=${CONFIG_SESSION}
+ ... verify=True
+ [Teardown] BgpRpcClient.play_send ${withdraw_hex}
+
+Play_To_Odl_Non_Removal_Template
+ [Arguments] ${totest} ${dir} ${ipv}=ipv4
+ ${announce_hex} = OperatingSystem.Get_File ${dir}/${totest}/announce_${totest}.hex
+ BgpRpcClient.play_clean
+ BgpRpcClient.play_send ${announce_hex}
+ ${as_path} = CompareStream.Set_Variable_If_At_Least_Neon ${NEW_AS_PATH} ${OLD_AS_PATH}
+ &{loc_rib} BuiltIn.Create_Dictionary PATH=loc-rib BGP_RIB=${RIB_NAME} AS_PATH=${as_path}
+ BuiltIn.Wait_Until_Keyword_Succeeds 3x 2s TemplatedRequests.Get_As_Json_Templated ${dir}/${totest}/rib mapping=${loc_rib} session=${CONFIG_SESSION}
+ ... verify=True
+
+Get_Update_Message
+ [Documentation] Returns hex update message.
+ ${update} = BgpRpcClient.play_get
+ BuiltIn.Should_Not_Be_Equal ${update} ${Empty}
+ [Return] ${update}
+
+Remove_Configured_Routes
+ [Arguments] ${totest} ${dir}
+ [Documentation] Removes the route if present.
+ BuiltIn.Run_Keyword_And_Ignore_Error TemplatedRequests.Delete_Templated ${dir}/${totest}/app mapping=${APP_PEER} session=${CONFIG_SESSION}
+
+Verify_Two_Hex_Messages_Are_Equal
+ [Arguments] ${hex_1} ${hex_2}
+ [Documentation] Verifies two hex messages are equal even in case, their arguments are misplaced.
+ ... Compares length of the hex messages and sums hex messages arguments as integers and compares results.
+ ${len_1} = BuiltIn.Get_Length ${hex_1}
+ ${len_2} = BuiltIn.Get_Length ${hex_2}
+ BuiltIn.Should_Be_Equal ${len_1} ${len_2}
+ ${sum_1} = BgpRpcClient.Sum_Hex_Message ${hex_1}
+ ${sum_2} = BgpRpcClient.Sum_Hex_Message ${hex_2}
+ BuiltIn.Should_Be_Equal ${sum_1} ${sum_2}
+
+Check BGP VPNv4 Nbr On ODL
+ [Arguments] ${dcgw_count} ${flag}=True ${start}=${START_VALUE}
+ [Documentation] Check all BGP VPNv4 neighbor on ODL
+ ${output} = KarafKeywords.Issue Command On Karaf Console ${DISPLAY_VPN4_ALL}
+ FOR ${index} IN RANGE ${start} ${dcgw_count}
+ BuiltIn.Run Keyword If ${flag}==True BuiltIn.Should Contain ${output} ${DCGW_IP_LIST[${index}]}
+ ... ELSE BuiltIn.Should Not Contain ${output} ${DCGW_IP_LIST[${index}]}
+ END