creating Normalize_Jsons_With_Bits_And_Compare to TemplatedRequests
[integration/test.git] / csit / suites / bgpcep / bgpfunct / 010_bgp_functional_l3vpn.robot
index 7915da19c37e4e910fd8a38be714bc39edc86871..3a80c8ea0045448041a510312c2f0abac705d0b3 100644 (file)
@@ -21,7 +21,6 @@ Resource          ${CURDIR}/../../../libraries/SetupUtils.robot
 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 ***
@@ -41,6 +40,7 @@ ${L3VPN_URL}      /restconf/operational/bgp-rib:bgp-rib/rib/example-bgp-rib/loc-
 ${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
@@ -94,6 +94,7 @@ Start_Suite
     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
@@ -172,25 +173,14 @@ Verify_Tool_Received_Update
     ${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}