Library RequestsLibrary
Variables ../../variables/Variables.py
Library Collections
+Resource CompareStream.robot
*** Variables ***
${REST_CON} /restconf/config/
[Documentation] Creates VPN Instance through restconf
[Tags] Post
${body} OperatingSystem.Get File ${VPN_CONFIG_DIR}/vpn_instance.json
- ${resp} RequestsLibrary.Post Request session ${REST_CON}l3vpn:vpn-instances/ data=${body}
+ CompareStream.Run_Keyword_If_Less_Than_Magnesium ${resp} RequestsLibrary.Post Request session ${REST_CON}l3vpn:vpn-instances/ data=${body}
+ CompareStream.Run_Keyword_If_At_Least_Magnesium ${resp} RequestsLibrary.Post Request session ${REST_CON}l3vpn-instances-interfaces:vpn-instances/ data=${body}
Log ${resp.content}
Should Be Equal As Strings ${resp.status_code} 204
Verify VPN instance
[Documentation] Verifies the vpn instance is created
[Tags] Get
- ${resp} RequestsLibrary.Get Request session ${REST_CON}l3vpn:vpn-instances/vpn-instance/${vpn_inst_values[0]}/ headers=${ACCEPT_XML}
+ CompareStream.Run_Keyword_If_Less_Than_Magnesium ${resp} RequestsLibrary.Get Request session ${REST_CON}l3vpn:vpn-instances/vpn-instance/${vpn_inst_values[0]}/ headers=${ACCEPT_XML}
+ CompareStream.Run_Keyword_If_At_Least_Magnesium ${resp} RequestsLibrary.Get Request session ${REST_CON}l3vpn-instances-interfaces:vpn-instances/vpn-instance/${vpn_inst_values[0]}/ headers=${ACCEPT_XML}
Should Be Equal As Strings ${resp.status_code} 200
Log ${resp.content}
FOR ${value} IN @{vpn_inst_values}
[Documentation] Creates vpn interface for the corresponding ietf interface
[Tags] Post
${body} OperatingSystem.Get File ${VPN_CONFIG_DIR}/vm_vpninterface.json
- ${resp} RequestsLibrary.Post Request session ${REST_CON}l3vpn:vpn-interfaces/ data=${body}
+ CompareStream.Run_Keyword_If_Less_Than_Magnesium ${resp} RequestsLibrary.Post Request session ${REST_CON}l3vpn:vpn-interfaces/ data=${body}
+ CompareStream.Run_Keyword_If_At_Least_Magnesium ${resp} RequestsLibrary.Post Request session ${REST_CON}l3vpn-instances-interfaces:vpn-interfaces/ data=${body}
Should Be Equal As Strings ${resp.status_code} 204
Verify VPN interface
[Documentation] Verifies the vpn interface created
[Tags] Get
- ${resp} RequestsLibrary.Get Request session ${REST_CON}l3vpn:vpn-interfaces/ headers=${ACCEPT_XML}
+ CompareStream.Run_Keyword_If_Less_Than_Magnesium ${resp} RequestsLibrary.Get Request session ${REST_CON}l3vpn:vpn-interfaces/ headers=${ACCEPT_XML}
+ CompareStream.Run_Keyword_If_At_Least_Magnesium ${resp} RequestsLibrary.Get Request session ${REST_CON}l3vpn-instances-interfaces:vpn-interfaces/ headers=${ACCEPT_XML}
Should Be Equal As Strings ${resp.status_code} 200
Log ${resp.content}
FOR ${value} IN @{vm_vpnint_values}
Delete vm vpn interface
[Documentation] Deletes the vpn interface
[Tags] Delete
- ${resp} RequestsLibrary.Delete Request session ${REST_CON}l3vpn:vpn-interfaces/
+ CompareStream.Run_Keyword_If_Less_Than_Magnesium ${resp} RequestsLibrary.Delete Request session ${REST_CON}l3vpn:vpn-interfaces/
+ CompareStream.Run_Keyword_If_At_Least_Magnesium ${resp} RequestsLibrary.Delete Request session ${REST_CON}l3vpn-instances-interfaces:vpn-interfaces/
Should Be Equal As Strings ${resp.status_code} 200
Verify after deleteing vm vpn interface
[Documentation] Verifies vpn interface after delete
[Tags] Verify after delete
- ${resp} RequestsLibrary.Get Request session ${REST_CON}l3vpn:vpn-interfaces/ headers=${ACCEPT_XML}
+ CompareStream.Run_Keyword_If_Less_Than_Magnesium ${resp} RequestsLibrary.Get Request session ${REST_CON}l3vpn:vpn-interfaces/ headers=${ACCEPT_XML}
+ CompareStream.Run_Keyword_If_At_Least_Magnesium ${resp} RequestsLibrary.Get Request session ${REST_CON}l3vpn-instances-interfaces:vpn-interfaces/ headers=${ACCEPT_XML}
Should Be Equal As Strings ${resp.status_code} 404
Delete VPN Instance
[Documentation] Deletes the VPN Instance
[Tags] Delete
- ${resp} RequestsLibrary.Delete Request session ${REST_CON}l3vpn:vpn-instances/vpn-instance/${vpn_inst_values[0]}/
+ CompareStream.Run_Keyword_If_Less_Than_Magnesium ${resp} RequestsLibrary.Delete Request session ${REST_CON}l3vpn:vpn-instances/vpn-instance/${vpn_inst_values[0]}/
+ CompareStream.Run_Keyword_If_At_Least_Magnesium ${resp} RequestsLibrary.Delete Requestt session ${REST_CON}l3vpn-instances-interfaces:vpn-instances/vpn-instance/${vpn_inst_values[0]}/
Should Be Equal As Strings ${resp.status_code} 200
Verify after deleting the vpn instance
[Documentation] Verifies after deleting the vpn instance
[Tags] Verfiy after delete
- ${resp} RequestsLibrary.Get Request session ${REST_CON}l3vpn:vpn-instances/vpn-instance/${vpn_inst_values[0]}/ headers=${ACCEPT_XML}
+ CompareStream.Run_Keyword_If_Less_Than_Magnesium ${resp} RequestsLibrary.Post Request session ${REST_CON}l3vpn:vpn-instances/vpn-instance/${vpn_inst_values[0]}/ headers=${ACCEPT_XML}
+ CompareStream.Run_Keyword_If_At_Least_Magnesium ${resp} RequestsLibrary.Post Request session ${REST_CON}l3vpn-instances-interfaces:vpn-instances/vpn-instance/${vpn_inst_values[0]}/ headers=${ACCEPT_XML}
Should Be Equal As Strings ${resp.status_code} 404
Delete vm ietf interface
Create VPN Instances
[Documentation] Creates VPN Instances through restconf
[Tags] Post
- ${resp} RequestsLibrary.Post Request session ${REST_CON}/l3vpn:vpn-instances/ data=${vpn_instances}
+ CompareStream.Run_Keyword_If_Less_Than_Magnesium ${resp} RequestsLibrary.Post Request session ${REST_CON}/l3vpn:vpn-instances/ data=${vpn_instances}
+ CompareStream.Run_Keyword_If_At_Least_Magnesium ${resp} RequestsLibrary.Post Request session ${REST_CON}/l3vpn-instances-interfaces:vpn-instances/ data=${vpn_instances}
Log ${resp.content}
Should Be Equal As Strings ${resp.status_code} 204
Verify VPN instances
[Documentation] Verifies the vpn instances in the datastores
[Tags] Get
- Wait Until Keyword Succeeds 5s 1s Check For Elements At URI ${REST_CON}/l3vpn:vpn-instances/ ${vpn_inst_values}
- Wait Until Keyword Succeeds 5s 1s Check For Elements At URI ${REST_OPER}/l3vpn:vpn-instances/ ${vpn_inst_values}
+ CompareStream.Run_Keyword_If_Less_Than_Magnesium Wait Until Keyword Succeeds 5s 1s Check For Elements At URI ${REST_CON}/l3vpn:vpn-instances/ ${vpn_inst_values}
+ CompareStream.Run_Keyword_If_Less_Than_Magnesium Wait Until Keyword Succeeds 5s 1s Check For Elements At URI ${REST_OPER}/l3vpn:vpn-instances/ ${vpn_inst_values}
+ CompareStream.Run_Keyword_If_At_Least_Magnesium Wait Until Keyword Succeeds 5s 1s Check For Elements At URI ${REST_CON}/l3vpn-instances-interfaces:vpn-instances/ ${vpn_inst_values}
+ CompareStream.Run_Keyword_If_At_Least_Magnesium Wait Until Keyword Succeeds 5s 1s Check For Elements At URI ${REST_OPER}/l3vpn-instances-interfaces:vpn-instances/ ${vpn_inst_values}
Create ietf interfaces
[Documentation] Creates ietf interfaces through the restconf
Create VPN interfaces
[Documentation] Creates vpn interface for the corresponding ietf interface
[Tags] Post
- ${resp} RequestsLibrary.Post Request session ${REST_CON}/l3vpn:vpn-interfaces/ data=${vpn_interfaces}
+ CompareStream.Run_Keyword_If_Less_Than_Magnesium ${resp} RequestsLibrary.Post Request session ${REST_CON}/l3vpn:vpn-interfaces/ data=${vpn_instances}
+ CompareStream.Run_Keyword_If_At_Least_Magnesium ${resp} RequestsLibrary.Post Request session ${REST_CON}/l3vpn-instances-interfaces:vpn-interfaces/ data=${vpn_instances}
Should Be Equal As Strings ${resp.status_code} 204
Verify VPN interfaces
[Documentation] Verifies the vpn interfaces created in datastores
[Tags] Get
- Wait Until Keyword Succeeds 3s 1s Check For Elements At URI ${REST_CON}/l3vpn:vpn-interfaces/ ${vpn_int_values}
- Wait Until Keyword Succeeds 3s 1s Check For Elements At URI ${REST_OPER}/l3vpn:vpn-interfaces/ ${vpn_int_values}
+ CompareStream.Run_Keyword_If_Less_Than_Magnesium Wait Until Keyword Succeeds 3s 1s Check For Elements At URI ${REST_CON}/l3vpn:vpn-interfaces/ ${vpn_int_values}
+ CompareStream.Run_Keyword_If_Less_Than_Magnesium Wait Until Keyword Succeeds 3s 1s Check For Elements At URI ${REST_OPER}/l3vpn:vpn-interfaces/ ${vpn_int_values}
+ CompareStream.Run_Keyword_If_At_Least_Magnesium Wait Until Keyword Succeeds 3s 1s Check For Elements At URI ${REST_CON}/l3vpn-instances-interfaces:vpn-interfaces/ ${vpn_int_values}
+ CompareStream.Run_Keyword_If_At_Least_Magnesium Wait Until Keyword Succeeds 3s 1s Check For Elements At URI ${REST_OPER}/l3vpn-instances-interfaces:vpn-interfaces/ ${vpn_int_values}
Verify FIB entries after create
[Documentation] Verifies the fib entries in the operational DS for the corresponding vpn interfaces
Delete vpn interfaces
[Documentation] Deletes the vpn interfaces
[Tags] Delete
- ${resp} RequestsLibrary.Delete Request session ${REST_CON}/l3vpn:vpn-interfaces/
+ CompareStream.Run_Keyword_If_Less_Than_Magnesium ${resp} RequestsLibrary.Delete Request session ${REST_CON}/l3vpn:vpn-interfaces/
+ CompareStream.Run_Keyword_If_At_Least_Magnesium ${resp} RequestsLibrary.Delete Request session ${REST_CON}/l3vpn-instances-interfaces:vpn-interfaces/
Should Be Equal As Strings ${resp.status_code} 200
Verify after deleting vpn interfaces
[Documentation] Verifies if vpn interfaces are deleted
[Tags] Verify after delete
- ${resp} RequestsLibrary.get Request session ${REST_CON}/l3vpn:vpn-interfaces/ headers=${ACCEPT_XML}
+ CompareStream.Run_Keyword_If_Less_Than_Magnesium ${resp} RequestsLibrary.get Request session ${REST_CON}/l3vpn:vpn-interfaces/ headers=${ACCEPT_XML}
+ CompareStream.Run_Keyword_If_At_Least_Magnesium ${resp} RequestsLibrary.get Request session ${REST_CON}/l3vpn-instances-interfaces:vpn-interfaces/ headers=${ACCEPT_XML}
Should Be Equal As Strings ${resp.status_code} 404
Delete ietf interfaces
Delete VPN Instances
[Documentation] Deletes the VPN Instances
[Tags] Delete
- ${resp} RequestsLibrary.Delete Request session ${REST_CON}/l3vpn:vpn-instances/
+ CompareStream.Run_Keyword_If_Less_Than_Magnesium ${resp} RequestsLibrary.Delete Request session ${REST_CON}/l3vpn:vpn-instances/
+ CompareStream.Run_Keyword_If_At_Least_Magnesium ${resp} RequestsLibrary.Delete Request session ${REST_CON}/l3vpn-instances-interfaces:vpn-instances/
Should Be Equal As Strings ${resp.status_code} 200
Verify after deleting the vpn instances
[Documentation] Verifies after deleting the vpn instances
[Tags] Verfiy after delete
- ${resp} RequestsLibrary.get Request session ${REST_CON}/l3vpn:vpn-instances/ headers=${ACCEPT_XML}
+ CompareStream.Run_Keyword_If_Less_Than_Magnesium ${resp} RequestsLibrary.get Request session ${REST_CON}/l3vpn:vpn-instances/ headers=${ACCEPT_XML}
+ CompareStream.Run_Keyword_If_At_Least_Magnesium ${resp} RequestsLibrary.get Request session ${REST_CON}/l3vpn-instances-interfaces:vpn-instances/ headers=${ACCEPT_XML}
Should Be Equal As Strings ${resp.status_code} 404
Verify FIB entries after delete
'config/itm:transport-zones',
'config/l3vpn:vpn-instances',
'config/l3vpn:vpn-interfaces',
+ 'config/l3vpn-instances-interfaces:vpn-instances',
+ 'config/l3vpn-instances-interfaces:vpn-interfaces',
'config/network-topology:network-topology/topology/ovsdb:1',
'config/neutron:neutron',
'config/neutronvpn:networkMaps',