Library Collections
Library UtilLibrary.py
Library ClusterStateLibrary.py
+Library ./HsfJson/hsf_json.py
Resource Utils.robot
*** Variables ***
[Arguments] ${controller_index_list} ${controller_index} ${uri} ${body} ${headers}=${HEADERS}
[Documentation] Send a PUT with the supplied ${uri} and ${body} to a ${controller_index}
... and check the data is replicated in all instances in ${controller_index_list}.
- ${expected_body}= To Json ${body}
+ ${expected_body}= Hsf Json ${body}
${resp} RequestsLibrary.Put Request controller${controller_index} ${uri} ${body} ${headers}
Should Be Equal As Strings ${resp.status_code} 200
: FOR ${i} IN @{controller_index_list}
\ ${data} Wait Until Keyword Succeeds 5s 1s Get Data From URI controller${i}
\ ... ${uri} ${headers}
\ Log ${data}
- \ ${received_body} To Json ${data}
- \ Should Be Equal ${received_body} ${expected_body}
+ \ ${received_body} Hsf Json ${data}
+ \ Should Be Equal ${expected_body} ${received_body}
Delete And Check At URI In Cluster
[Arguments] ${controller_index_list} ${controller_index} ${uri} ${headers}=${HEADERS}
${body} Replace String ${sample5} 61644 ${OVSDB_PORT}
Log ${body}
${dictionary}= Create Dictionary ${MININET}=1 ${OVSDBPORT}=4 ${BRIDGE}=1
- Put And Check At URI In Cluster Ovsdb ${controller_index_list} ${controller_index} ${SOUTHBOUND_CONFIG_API}%2Fbridge%2F${BRIDGE} ${body} ${HEADERS}
+ Put And Check At URI In Cluster ${controller_index_list} ${controller_index} ${SOUTHBOUND_CONFIG_API}%2Fbridge%2F${BRIDGE} ${body} ${HEADERS}
Wait Until Keyword Succeeds 5s 1s Check Item Occurrence At URI In Cluster ${controller_index_list} ${dictionary} ${OPERATIONAL_TOPO_API}
-
-Put And Check At URI In Cluster Ovsdb
- [Arguments] ${controller_index_list} ${controller_index} ${uri} ${body} ${headers}=${HEADERS}
- [Documentation] Send a PUT with the supplied ${uri} and ${body} to a ${controller_index}
- ... and check the data is replicated in all instances in ${controller_index_list}.
- ${expected_body}= To Json ${body}
- ${resp} RequestsLibrary.Put Request controller${controller_index} ${uri} ${body} ${headers}
- Should Be Equal As Strings ${resp.status_code} 200
- : FOR ${i} IN @{controller_index_list}
- \ ${data} Wait Until Keyword Succeeds 5s 1s Get Data From URI controller${i}
- \ ... ${uri} ${headers}
- \ Log ${data}
- \ ${received_body} To Json ${data}
- \ Check Expected And Received Body ${expected_body} ${received_body}
-
-Check Expected And Received Body
- [Arguments] ${expected_body} ${received_body}
- [Documentation] Checks whether the expected data and the actual received data are equal.
- Log ${expected_body}
- Log ${received_body}
- ${content1} Get From Dictionary ${expected_body} node
- Log ${content1}
- ${node1} Get From List ${content1} 0
- Log ${node1}
- ${expected_bridge_name} Get From Dictionary ${node1} ovsdb:bridge-name
- Log ${expected_bridge_name}
- ${expected_target_ips} Get From Dictionary ${node1} ovsdb:controller-entry
- Log ${expected_target_ips}
- Sort List ${expected_target_ips}
- Log ${expected_target_ips}
- ${content2} Get From Dictionary ${received_body} node
- Log ${content2}
- ${node2} Get From List ${content2} 0
- Log ${node2}
- ${received_bridge_name} Get From Dictionary ${node2} ovsdb:bridge-name
- Log ${received_bridge_name}
- ${received_target_ips} Get From Dictionary ${node2} ovsdb:controller-entry
- Log ${received_target_ips}
- Sort List ${received_target_ips}
- Log ${received_target_ips}
- Should Be Equal As Strings ${received_bridge_name} ${expected_bridge_name}
- Lists Should be Equal ${received_target_ips} ${expected_target_ips}