From 758f3a98a3a07224ccd41c6eca1e7b558fff6fef Mon Sep 17 00:00:00 2001 From: Srinivas Rachakonda Date: Wed, 12 Feb 2020 16:12:35 +0530 Subject: [PATCH] Moving vpn-instance yang from VPNMgr > NeutronVPN Vpn-instance and Vpn-interface Config Datastore are predominantly used by the neutron-VPN layer, but the datastore is defined in VPN manager. This review will take care of moving Vpn-instance and associated yang models to neutron-VPN layer. The second part of this change[1] will take care of moving VPN-interface DS to neutronvpn https://git.opendaylight.org/gerrit/c/netvirt/+/87418/ https://git.opendaylight.org/gerrit/c/netvirt/+/87445/ https://git.opendaylight.org/gerrit/c/integration/test/+/87613 Signed-off-by: Srinivas Rachakonda Change-Id: I054fc3f3104b792a2ad54206d273ec0c9c8eb37b --- .../vpnservice/020__configure_vpn.robot | 25 +++++++++++----- .../030__configure_2_switches.robot | 30 ++++++++++++------- csit/variables/netvirt/Modules.py | 2 ++ 3 files changed, 39 insertions(+), 18 deletions(-) diff --git a/csit/suites/vpnservice/020__configure_vpn.robot b/csit/suites/vpnservice/020__configure_vpn.robot index b41793caa4..15d1a02c60 100644 --- a/csit/suites/vpnservice/020__configure_vpn.robot +++ b/csit/suites/vpnservice/020__configure_vpn.robot @@ -7,6 +7,7 @@ Library String Library RequestsLibrary Variables ../../variables/Variables.py Library Collections +Resource CompareStream.robot *** Variables *** ${REST_CON} /restconf/config/ @@ -20,14 +21,16 @@ Create VPN Instance [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} @@ -55,13 +58,15 @@ Create VPN interface [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} @@ -76,25 +81,29 @@ Verify FIB entry after create 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 diff --git a/csit/suites/vpnservice/030__configure_2_switches.robot b/csit/suites/vpnservice/030__configure_2_switches.robot index afd48e7d5d..5890cef8eb 100644 --- a/csit/suites/vpnservice/030__configure_2_switches.robot +++ b/csit/suites/vpnservice/030__configure_2_switches.robot @@ -27,15 +27,18 @@ Veirfy The Switches 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 @@ -54,14 +57,17 @@ Verify ietf interfaces 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 @@ -98,13 +104,15 @@ Verify ping 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 @@ -122,13 +130,15 @@ Verify after deleting 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 diff --git a/csit/variables/netvirt/Modules.py b/csit/variables/netvirt/Modules.py index fda393e0c4..8c8b728ca0 100644 --- a/csit/variables/netvirt/Modules.py +++ b/csit/variables/netvirt/Modules.py @@ -13,6 +13,8 @@ netvirt_data_models = [ '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', -- 2.36.6