this change is based on https://trello.com/c/OVemHGUi/336-int-test-do-not-sort-bits-in-carbon
Change-Id: I1c47fa34f5bb9e23754b6f23bafeb4204609e739
Signed-off-by: Peter Gubka <pgubka@cisco.com>
Resource ${CURDIR}/../../../libraries/Utils.robot
Resource ${CURDIR}/../../../libraries/SetupUtils.robot
Resource ${CURDIR}/../../../libraries/ConfigViaRestconf.robot
+Resource ${CURDIR}/../../../libraries/CompareStream.robot
Library ${CURDIR}/../../../libraries/norm_json.py
*** Variables ***
Verify Flowspec Data
[Arguments] ${exprspfile}
[Documentation] Verify expected response
- ${keys_with_bits}= BuiltIn.Create_List op
+ ${keys_with_bits}= BuiltIn.Create_List
+ CompareStream.Run_Keyword_If_At_Most boron Collections.Append_To_List ${keys_with_bits} 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 session ${FLOWSPEC_URL}
${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}
+ ${received_json}= norm_json.Normalize_Json_Text ${rcv_update}
+ ${expected_json}= norm_json.Normalize_Json_Text ${exp_update}
BuiltIn.Log ${received_json}
BuiltIn.Log ${expected_json}
BuiltIn.Should_Be_Equal ${received_json} ${expected_json}
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}
+ ${expected_json}= norm_json.Normalize_Json_Text ${expected_rsp}
${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}
+ ${received_json}= norm_json.Normalize_Json_Text ${rsp.content}
BuiltIn.Log ${received_json}
BuiltIn.Log ${expected_json}
BuiltIn.Should_Be_Equal ${received_json} ${expected_json}
[Documentation] Verifies if loc-rib contains expected data
${rsp}= RequestsLibrary.Get_Request ${CONFIG_SESSION} ${LOC_RIB_URL} headers=${HEADERS}
Log ${rsp.content}
- ${keys_with_bits}= BuiltIn.Create_List op
- ${received_json}= norm_json.Normalize_Json_Text ${rsp.content} keys_with_bits=${keys_with_bits}
+ ${received_json}= norm_json.Normalize_Json_Text ${rsp.content}
BuiltIn.Log ${received_json}
- ${expected_json}= norm_json.Normalize_Json_Text ${exp_content} keys_with_bits=${keys_with_bits}
+ ${expected_json}= norm_json.Normalize_Json_Text ${exp_content}
BuiltIn.Log ${expected_json}
BuiltIn.Should_Be_Equal ${received_json} ${expected_json}
{
"protocol-ips": [
{
- "op": "equals end-of-list",
+ "op": "end-of-list equals",
"value": 6
}
]
{
"ports": [
{
- "op": "equals end-of-list",
+ "op": "end-of-list equals",
"value": 80
}
]
"value": 8080
},
{
- "op": "end-of-list less-than and-bit",
+ "op": "end-of-list and-bit less-than",
"value": 8088
}
]
{
"types": [
{
- "op": "equals end-of-list",
+ "op": "end-of-list equals",
"value": 0
}
]
{
"codes": [
{
- "op": "equals end-of-list",
+ "op": "end-of-list equals",
"value": 0
}
]
{
"tcp-flags": [
{
- "op": "match end-of-list",
+ "op": "end-of-list match",
"value": 32
}
]
"value": 400
},
{
- "op": "end-of-list less-than and-bit",
+ "op": "end-of-list and-bit less-than",
"value": 500
}
]
{
"dscps": [
{
- "op": "equals end-of-list",
+ "op": "end-of-list equals",
"value": 20
}
]
{
"fragments": [
{
- "op": "match end-of-list",
+ "op": "end-of-list match",
"value": "first"
}
]