Resource ${CURDIR}/../../../libraries/TemplatedRequests.robot
Resource ${CURDIR}/../../../libraries/KarafKeywords.robot
Resource ${CURDIR}/../../../libraries/SSHKeywords.robot
-Library ${CURDIR}/../../../libraries/norm_json.py
Library ${CURDIR}/../../../libraries/BgpRpcClient.py ${TOOLS_SYSTEM_IP}
*** Variables ***
${CONFIG_SESSION} config-session
${EXARPCSCRIPT} ${CURDIR}/../../../../tools/exabgp_files/exarpc.py
${PEER_CHECK_URL} /restconf/operational/bgp-rib:bgp-rib/rib/example-bgp-rib/peer/bgp:%2F%2F
+${DEFAULT_BGPCEP_LOG_LEVEL} INFO
*** Test Cases ***
Configure_App_Peer
SSHKeywords.Virtual_Env_Install_Package exabgp==3.4.16
RequestsLibrary.Create_Session ${CONFIG_SESSION} http://${ODL_SYSTEM_IP}:${RESTCONFPORT} auth=${AUTH}
Upload_Config_Files
+ KarafKeywords.Set_Bgpcep_Log_Levels # ${DEFAULT_BGPCEP_LOG_LEVEL} is applied by default
Stop_Suite
[Documentation] Suite teardown keyword
${exp_update}= Get_Expected_Response_From_File ${exp_update_fn}
${rcv_update_dict}= BgpRpcClient.exa_get_update_message msg_only=${True}
${rcv_update}= BuiltIn.Evaluate json.dumps(${rcv_update_dict}) modules=json
- ${keys_with_bits}= BuiltIn.Create_List op
- ${received_json}= norm_json.Normalize_Json_Text ${rcv_update} keys_with_bits=${keys_with_bits}
- ${expected_json}= norm_json.Normalize_Json_Text ${exp_update} keys_with_bits=${keys_with_bits}
- BuiltIn.Log ${received_json}
- BuiltIn.Log ${expected_json}
- BuiltIn.Should_Be_Equal ${received_json} ${expected_json}
+ TemplatedRequests.Normalize_Jsons_And_Compare ${exp_update} ${rcv_update}
Verify_Reported_Data
[Arguments] ${url} ${exprspfile}
[Documentation] Verifies expected response
- ${keys_with_bits}= BuiltIn.Create_List op
${expected_rsp}= Get_Expected_Response_From_File ${exprspfile}
- ${expected_json}= norm_json.Normalize_Json_Text ${expected_rsp} keys_with_bits=${keys_with_bits}
${rsp}= RequestsLibrary.Get_Request ${CONFIG_SESSION} ${url}
- BuiltIn.Log ${rsp.content}
- ${received_json}= norm_json.Normalize_Json_Text ${rsp.content} keys_with_bits=${keys_with_bits}
- BuiltIn.Log ${received_json}
- BuiltIn.Log ${expected_json}
- BuiltIn.Should_Be_Equal ${received_json} ${expected_json}
+ TemplatedRequests.Normalize_Jsons_And_Compare ${expected_rsp} ${rsp.content}
Get_Expected_Response_From_File
[Arguments] ${exprspfile}