From 2e6b027273479d6422a5f4b9ba881743d14a4be0 Mon Sep 17 00:00:00 2001 From: gvrangan Date: Tue, 2 Jun 2015 19:42:08 +0900 Subject: [PATCH] Add support to deploy Coordinator from test suites + Add a new TEST VTNC_LAUNCH to download ad launch Coordinator - Remove tags in test cases to enable them + VTN_C_LAUNCH to testplan to run first before the OF10 and OF13 + robot.tidy executed on all robot files + Excluded the topology test cases Change-Id: I43dcbffff5ba91fe99282f2b1b0d85c49a202f4b Signed-off-by: gvrangan (cherry picked from commit fabb56ba650a1c378cf58e0b5602e1818eefcafe) --- test/csit/libraries/VtnCoKeywords.txt | 157 +++++++++++++++++ .../VTN_C_LAUNCH/020__vtn_coordinator.robot | 10 ++ .../suites/vtn/VTN_C_LAUNCH/__init__.robot | 6 + .../vtn/VTN_C_OF10/020__vtn_coordinator.robot | 150 +++------------- .../vtn/VTN_C_OF10/030__vtn_coordinator.robot | 96 +++-------- .../vtn/VTN_C_OF10/040__vtn_coordinator.robot | 160 +++-------------- .../csit/suites/vtn/VTN_C_OF10/__init__.robot | 8 +- .../vtn/VTN_C_OF13/020__vtn_coordinator.robot | 150 +++------------- .../vtn/VTN_C_OF13/030__vtn_coordinator.robot | 84 ++------- .../vtn/VTN_C_OF13/040__vtn_coordinator.robot | 161 +++--------------- .../csit/suites/vtn/VTN_C_OF13/__init__.robot | 8 +- test/csit/testplans/vtn-coordinator.txt | 1 + 12 files changed, 323 insertions(+), 668 deletions(-) create mode 100644 test/csit/libraries/VtnCoKeywords.txt create mode 100644 test/csit/suites/vtn/VTN_C_LAUNCH/020__vtn_coordinator.robot create mode 100644 test/csit/suites/vtn/VTN_C_LAUNCH/__init__.robot diff --git a/test/csit/libraries/VtnCoKeywords.txt b/test/csit/libraries/VtnCoKeywords.txt new file mode 100644 index 00000000..e2529159 --- /dev/null +++ b/test/csit/libraries/VtnCoKeywords.txt @@ -0,0 +1,157 @@ +*** Settings *** +Library SSHLibrary +Library String +Library DateTime +Library RequestsLibrary +Library json +Library SSHLibrary +Library Collections +Library XML +Variables ../variables/Variables.py +Resource ./Utils.txt + +*** Variables *** +${VTNC_FILENAME} 'distribution.vtn-coordinator' + +*** Keywords *** +Get VtnCo + [Documentation] Download the VTN Coordinator from Controller VM + Log Download the VTN Coordinator bz2 file + SSHLibrary.Open_Connection ${CONTROLLER} + SSHLibrary.Login_With_Public_Key ${CONTROLLER_USER} ${USER_HOME}/.ssh/id_rsa any + SSHLibrary.Get_File ${WORKSPACE}/${BUNDLEFOLDER}/externalapps/*vtn-coordinator*-bin.tar.bz2 ${WORKSPACE}/${VTNC_FILENAME}-bin.tar.bz2 + SSHLibrary.Close_Connection + SSHLibrary.Open_Connection ${MININET} + SSHLibrary.Login_With_Public_Key ${MININET_USER} ${USER_HOME}/.ssh/id_rsa any + SSHLibrary.Put_File ${WORKSPACE}/${VTNC_FILENAME}-bin.tar.bz2 ${WORKSPACE} + SSHLibrary.Close_Connection + +Start SuiteVtnCo + [Documentation] Download and startup the VTN Coordinator. + Log Start the VTN Coordinator + Get VtnCo + ${vtnc_conn_id}= Open Connection ${MININET} prompt=${LINUX_PROMPT} timeout=30s + Set Suite Variable ${vtnc_conn_id} + Login With Public Key ${MININET_USER} ${USER_HOME}/.ssh/id_rsa any + Execute Command tar -C/ -jxvf ${WORKSPACE}/${VTNC_FILENAME}-bin.tar.bz2 + Execute Command /usr/local/vtn/sbin/db_setup + Execute Command /usr/local/vtn/bin/vtn_start + Execute Command /usr/local/vtn/bin/unc_dmctl status + Execute Command /usr/local/vtn/sbin/db_setup + Execute Command /usr/local/vtn/bin/vtn_start + Execute Command /usr/local/vtn/bin/unc_dmctl status + Execute Command exit + +Stop SuiteVtnCo + [Documentation] Exit the Launch Test + Log Stop the Launch Test + +Start SuiteVtnCoTest + [Documentation] Start the VTNCo Test + Create Session session http://${VTNC}:8083 headers=${VTNC_HEADERS} + +Stop SuiteVtnCoTest + [Documentation] Exit the VtnCo Test + Delete All Sessions + +Get Coordinator Version + [Documentation] Get API version for testing + ${resp} RequestsLibrary.Get session ${VTNWEBAPI}/api_version + Should Be Equal As Strings ${resp.status_code} 200 + +Add a Controller + [Arguments] ${ctrlname} ${ctrlip} + [Documentation] Create a controller + ${controllerinfo} Create Dictionary controller_id=${ctrlname} type=odc ipaddr=${CONTROLLER} version=1.0 auditstatus=enable + ${controllercreate} Create Dictionary controller=${controllerinfo} + ${controllercreate_json}= json.dumps ${controllercreate} + ${resp} RequestsLibrary.Post session ${VTNWEBAPI}/${CTRLS_CREATE} data=${controllercreate_json} + Should Be Equal As Strings ${resp.status_code} 201 + +Remove Controller + [Arguments] ${ctrlname} + [Documentation] Delete a Controller + ${resp} RequestsLibrary.Delete session ${VTNWEBAPI}/${CTRLS}/${ctrlname}.json + Should Be Equal As Strings ${resp.status_code} 204 + +Update Controller + [Arguments] ${ctrlname} ${ctrlip} ${desc} + [Documentation] Update controller + ${controllerinfo} Create Dictionary description=${desc} ipaddr=${ctrlip} version=1.0 auditstatus=enable + ${controllerupdate} Create Dictionary controller=${controllerinfo} + ${controllerupdate_json}= json.dumps ${controllerupdate} + ${resp} RequestsLibrary.Put session ${VTNWEBAPI}/${CTRLS}/${ctrlname}.json data=${controllerupdate_json} + Should Be Equal As Strings ${resp.status_code} 204 + +Check Controller Status + [Arguments] ${ctrlname} ${stat} + [Documentation] Get controller status + ${resp} RequestsLibrary.Get session ${VTNWEBAPI}/${CTRLS}/${ctrlname}.json + ${contents} To JSON ${resp.content} + ${controllerblock} Get From Dictionary ${contents} controller + ${status} Get From Dictionary ${controllerblock} operstatus + Should Be Equal As Strings ${status} ${stat} + +Add a VTN + [Arguments] ${vtnname} ${vtndescription} + [Documentation] Create VTN in Coordinator + ${vtninfo} Create Dictionary vtn_name=${vtnname} description=${vtndescription} + ${vtncreate} Create Dictionary vtn=${vtninfo} + ${vtncreate_json}= json.dumps ${vtncreate} + ${resp} RequestsLibrary.Post session ${VTNWEBAPI}/${VTNS_CREATE} data=${vtncreate_json} + Should Be Equal As Strings ${resp.status_code} 201 + +Delete a VTN + [Arguments] ${vtnname} + [Documentation] Delete a VTN Created + ${resp} RequestsLibrary.Delete session ${VTNWEBAPI}/${VTNS}/${vtnname}.json + Should Be Equal As Strings ${resp.status_code} 204 + +Create VBR in VTN + [Arguments] ${vtnname} ${vbrname} ${ctrlname} + [Documentation] Create VBR for VTN in Coordinator + ${vbrinfo} Create Dictionary vbr_name=${vbrname} controller_id=${ctrlname} domain_id=(DEFAULT) + ${vbrcreate} Create Dictionary vbridge=${vbrinfo} + ${vbrcreate_json}= json.dumps ${vbrcreate} + ${resp} RequestsLibrary.Post session ${VTNWEBAPI}/${VTNS}/${vtnname}/${VBRS_CREATE} data=${vbrcreate_json} + Should Be Equal As Strings ${resp.status_code} 201 + +Create VBRIF in VBR + [Arguments] ${vtnname} ${vbrname} ${vbrifname} ${ifdescription} ${retcode} + [Documentation] Create VBR Interface in VBR + ${vbrifinfo} Create Dictionary if_name=${vbrifname} description=${ifdescription} + ${vbrifcreate} Create Dictionary interface=${vbrifinfo} + ${vbrifcreate_json}= json.dumps ${vbrifcreate} + ${resp} RequestsLibrary.Post session ${VTNWEBAPI}/${VTNS}/${vtnname}/${VBRS}/${vbrname}/${VBRIFS_CREATE} data=${vbrifcreate_json} + Should Be Equal As Strings ${resp.status_code} ${retcode} + +Define Portmap for VBRIF + [Arguments] ${vtnname} ${vbrname} ${vbrifname} ${logical_port_id} + [Documentation] Map Interface to a logical port + ${logical_port_info} Create Dictionary logical_port_id=${logical_port_id} + ${portmapdefine} Create Dictionary portmap=${logical_port_info} + ${portmapdefine_json}= json.dumps ${portmapdefine} + ${resp} RequestsLibrary.Put session ${VTNWEBAPI}/${VTNS}/${vtnname}/${VBRS}/${vbrname}/${VBRIFS}/${vbrifname}/${PORTMAP_CREATE} data=${portmapdefine_json} + Should Be Equal As Strings ${resp.status_code} 204 + +Test Ping + [Arguments] ${host1} ${host2} + [Documentation] Ping hosts to check connectivity + Write ${host1} ping -c 5 ${host2} + ${result} Read Until mininet> + Should Contain ${result} 64 bytes + +Verify Switch + [Arguments] ${ctrlname} ${switch_id} + [Documentation] Get switch + ${resp} Get session ${VTNWEBAPI}/${CTRLS}/${ctrlname}/${SW}/${switch_id}.json + ${contents} To JSON ${resp.content} + ${switchblock} Get From Dictionary ${contents} switch + ${status} Get From Dictionary ${switchblock} switch_id + Should Be Equal As Strings ${status} ${switch_id} + +Verify SwitchPort + [Arguments] ${ctrlname} ${switch_id} + [Documentation] Get switch + ${resp} Get session ${VTNWEBAPI}/${CTRLS}/${ctrlname}/${SW}/${switch_id}/${PORTS} + Should Be Equal As Strings ${resp.status_code} 200 diff --git a/test/csit/suites/vtn/VTN_C_LAUNCH/020__vtn_coordinator.robot b/test/csit/suites/vtn/VTN_C_LAUNCH/020__vtn_coordinator.robot new file mode 100644 index 00000000..c96e1852 --- /dev/null +++ b/test/csit/suites/vtn/VTN_C_LAUNCH/020__vtn_coordinator.robot @@ -0,0 +1,10 @@ +*** Settings *** +Documentation Test suite for VTN Coordinator +Suite Setup Start SuiteVtnCoTest +Suite Teardown Stop SuiteVtnCoTest +Resource ../../../libraries/VtnCoKeywords.txt + +*** Test Cases *** +Test if VTNC is ready + [Documentation] Get Coordinator Version + BuiltIn.Wait_Until_Keyword_Succeeds 20 5 Get Coordinator Version diff --git a/test/csit/suites/vtn/VTN_C_LAUNCH/__init__.robot b/test/csit/suites/vtn/VTN_C_LAUNCH/__init__.robot new file mode 100644 index 00000000..f9e05d57 --- /dev/null +++ b/test/csit/suites/vtn/VTN_C_LAUNCH/__init__.robot @@ -0,0 +1,6 @@ +*** Settings *** +Documentation Test suite for VTNC Launch +Suite Setup Start SuiteVtnCo +Suite Teardown Stop SuiteVtnCo +Library SSHLibrary +Resource ../../../libraries/VtnCoKeywords.txt diff --git a/test/csit/suites/vtn/VTN_C_OF10/020__vtn_coordinator.robot b/test/csit/suites/vtn/VTN_C_OF10/020__vtn_coordinator.robot index 5fe4da43..9e39845b 100644 --- a/test/csit/suites/vtn/VTN_C_OF10/020__vtn_coordinator.robot +++ b/test/csit/suites/vtn/VTN_C_OF10/020__vtn_coordinator.robot @@ -1,156 +1,50 @@ *** Settings *** Documentation Test suite for VTN Coordinator -Suite Setup Create Session session http://${VTNC}:8083 headers=${VTNC_HEADERS} -Suite Teardown Delete All Sessions -Library SSHLibrary -Library Collections -Library ../../../libraries/RequestsLibrary.py -Library ../../../libraries/Common.py -Library ../../../libraries/Topology.py -Variables ../../../variables/Variables.py - - +Suite Setup Start SuiteVtnCoTest +Suite Teardown Stop SuiteVtnCoTest +Resource ../../../libraries/VtnCoKeywords.txt *** Test Cases *** Add a ODL Controller [Documentation] Add a Controller - [Tags] vtnc - Add a Controller odc_test ${CONTROLLER} - + Add a Controller odc_test ${CONTROLLER} Verify the Controller Status is up [Documentation] Check Controller status - [Tags] vtnc - Wait Until Keyword Succeeds 30s 2s Check Controller Status odc_test - + Wait Until Keyword Succeeds 30s 2s Check Controller Status odc_test up Add a Vtn Tenant1 - [Documentation] Create Vtn Tenant1 - [Tags] vtnc - Add a VTN Tenant1 VTN_TEST - + [Documentation] Create Vtn Tenant1 + Wait Until Keyword Succeeds 10s 5s Add a VTN Tenant1 VTN_TEST Create VBR in VTN Tenant1 - [Documentation] Create a VBR in Tenant1 as Vbridge1 - [Tags] vtnc - Create VBR in VTN Tenant1 Vbridge1 odc_test - + [Documentation] Create a VBR in Tenant1 as Vbridge1 + Create VBR in VTN Tenant1 Vbridge1 odc_test Create VBRIF in VBRIDGE Vbridge1 Interface1 - [Documentation] Create an interface to Vbridge1 - [Tags] vtnc - Create VBRIF in VBR Tenant1 Vbridge1 Interface1 Interface1 - + [Documentation] Create an interface to Vbridge1 + Create VBRIF in VBR Tenant1 Vbridge1 Interface1 Interface1 201 Create VBRIF in VBRIDGE Vbridge1 Interface2 - [Documentation] Create an interface to Vbridge1 - [Tags] vtnc - Create VBRIF in VBR Tenant1 Vbridge1 Interface2 Interface2 - + [Documentation] Create an interface to Vbridge1 + Create VBRIF in VBR Tenant1 Vbridge1 Interface2 Interface2 201 Define Portmap for Interface1 - [Documentation] Map Interface1 to a logical port - [Tags] vtnc - Define Portmap for VBRIF Tenant1 Vbridge1 Interface1 PP-OF:openflow:3-s3-eth1 - + [Documentation] Map Interface1 to a logical port + Define Portmap for VBRIF Tenant1 Vbridge1 Interface1 PP-OF:openflow:3-s3-eth1 Define Portmap for Interface2 - [Documentation] Map Interface2 to a logical port - [Tags] vtnc - Define Portmap for VBRIF Tenant1 Vbridge1 Interface2 PP-OF:openflow:2-s2-eth1 - + [Documentation] Map Interface2 to a logical port + Define Portmap for VBRIF Tenant1 Vbridge1 Interface2 PP-OF:openflow:2-s2-eth1 Test Ping for Configuration1 - [Documentation] ping between hosts in mininet - [Tags] vtnc - Wait Until Keyword Succeeds 30s 2s Test Ping h1 h3 - + [Documentation] ping between hosts in mininet + Wait Until Keyword Succeeds 30s 10s Test Ping h1 h3 Delete a VTN Tenant1 - [Documentation] Delete Vtn Tenant1 - [Tags] vtnc - Delete a VTN Tenant1 - + [Documentation] Delete Vtn Tenant1 + Delete a VTN Tenant1 Delete a Controller odc1 - [Documentation] Delete Controller odc1 - [Tags] vtnc + [Documentation] Delete Controller odc1 Remove Controller odc_test - - - -*** Keywords *** -Add a Controller - [Arguments] ${ctrlname} ${ctrlip} - [Documentation] Create a controller - ${controllerinfo} Create Dictionary controller_id ${ctrlname} type odc ipaddr ${CONTROLLER} version 1.0 auditstatus enable - ${controllercreate} Create Dictionary controller ${controllerinfo} - ${resp} PostJson session ${VTNWEBAPI}/${CTRLS_CREATE} data=${controllercreate} - Should Be Equal As Strings ${resp.status_code} 201 - - -Remove Controller - [Arguments] ${ctrlname} - [Documentation] Delete a Controller - ${resp} Delete session ${VTNWEBAPI}/${CTRLS}/${ctrlname}.json - Should Be Equal As Strings ${resp.status_code} 204 - - -Check Controller Status - [Arguments] ${ctrlname} - [Documentation] Get controller status - ${resp} Get session ${VTNWEBAPI}/${CTRLS}/${ctrlname}.json - ${contents} To JSON ${resp.content} - ${controllerblock} Get From Dictionary ${contents} controller - ${status} Get From Dictionary ${controllerblock} operstatus - Should Be Equal As Strings ${status} up - - -Add a VTN - [Arguments] ${vtnname} ${vtndescription} - [Documentation] Create VTN in Coordinator - ${vtninfo} Create Dictionary vtn_name ${vtnname} description ${vtndescription} - ${vtncreate} Create Dictionary vtn ${vtninfo} - ${resp} PostJson session ${VTNWEBAPI}/${VTNS_CREATE} data=${vtncreate} - Should Be Equal As Strings ${resp.status_code} 201 - - -Delete a VTN - [Arguments] ${vtnname} - [Documentation] Delete a VTN Created - ${resp} Delete session ${VTNWEBAPI}/${VTNS}/${vtnname}.json - Should Be Equal As Strings ${resp.status_code} 204 - - -Create VBR in VTN - [Arguments] ${vtnname} ${vbrname} ${ctrlname} - [Documentation] Create VBR for VTN in Coordinator - ${vbrinfo} Create Dictionary vbr_name ${vbrname} controller_id ${ctrlname} domain_id (DEFAULT) - ${vbrcreate} Create Dictionary vbridge ${vbrinfo} - ${resp} PostJson session ${VTNWEBAPI}/${VTNS}/${vtnname}/${VBRS_CREATE} data=${vbrcreate} - Should Be Equal As Strings ${resp.status_code} 201 - - -Create VBRIF in VBR - [Arguments] ${vtnname} ${vbrname} ${vbrifname} ${ifdescription} - [Documentation] Create VBR Interface in VBR - ${vbrifinfo} Create Dictionary if_name ${vbrifname} description ${ifdescription} - ${vbrifcreate} Create Dictionary interface ${vbrifinfo} - ${resp} PostJson session ${VTNWEBAPI}/${VTNS}/${vtnname}/${VBRS}/${vbrname}/${VBRIFS_CREATE} data=${vbrifcreate} - Should Be Equal As Strings ${resp.status_code} 201 - - -Define Portmap for VBRIF - [Arguments] ${vtnname} ${vbrname} ${vbrifname} ${logical_port_id} - [Documentation] Map Interface to a logical port - ${logical_port_info} Create Dictionary logical_port_id ${logical_port_id} - ${portmapdefine} Create Dictionary portmap ${logical_port_info} - ${resp} Put session ${VTNWEBAPI}/${VTNS}/${vtnname}/${VBRS}/${vbrname}/${VBRIFS}/${vbrifname}/${PORTMAP_CREATE} data=${portmapdefine} - Should Be Equal As Strings ${resp.status_code} 204 - -Test Ping - [Arguments] ${host1} ${host2} - [Documentation] Ping hosts to check connectivity - Write ${host1} ping -w 10 ${host2} - ${result} Read - Should Contain ${result} 64 bytes diff --git a/test/csit/suites/vtn/VTN_C_OF10/030__vtn_coordinator.robot b/test/csit/suites/vtn/VTN_C_OF10/030__vtn_coordinator.robot index e9c9d694..29689def 100644 --- a/test/csit/suites/vtn/VTN_C_OF10/030__vtn_coordinator.robot +++ b/test/csit/suites/vtn/VTN_C_OF10/030__vtn_coordinator.robot @@ -1,99 +1,51 @@ - *** Settings *** Documentation Test suite for VTN Coordinator -Suite Setup Create Session session http://${VTNC}:8083 headers=${VTNC_HEADERS} -Suite Teardown Delete All Sessions -Library SSHLibrary -Library Collections -Library ../../../libraries/RequestsLibrary.py -Library ../../../libraries/Common.py -Library ../../../libraries/Topology.py -Variables ../../../variables/Variables.py - +Suite Setup Start SuiteVtnCoTest +Suite Teardown Stop SuiteVtnCoTest +Resource ../../../libraries/VtnCoKeywords.txt *** Test Cases *** Add a ODL Controller [Documentation] Add a Controller odc1 - [Tags] vtnc - Add a Controller odc_test ${CONTROLLER} + [Tags] exclude + Add a Controller odc_test ${CONTROLLER} Verify the Controller Status is up [Documentation] Check Controller status - [Tags] vtnc - Wait Until Keyword Succeeds 30s 2s Check Controller Status odc_test up + [Tags] exclude + Wait Until Keyword Succeeds 30s 2s Check Controller Status odc_test up Verify switch1 [Documentation] Get switch1 - [Tags] vtnc - Wait Until Keyword Succeeds 30s 2s Verify Switch odc_test openflow:1 + [Tags] exclude + Wait Until Keyword Succeeds 30s 2s Verify Switch odc_test openflow:1 Verify switch2 [Documentation] Get switch2 - [Tags] vtnc - Wait Until Keyword Succeeds 30s 2s Verify Switch odc_test openflow:2 + [Tags] exclude + Wait Until Keyword Succeeds 30s 2s Verify Switch odc_test openflow:2 Verify switch3 [Documentation] Get switch3 - [Tags] vtnc - Wait Until Keyword Succeeds 30s 2s Verify Switch odc_test openflow:3 + [Tags] exclude + Wait Until Keyword Succeeds 30s 2s Verify Switch odc_test openflow:3 Verify switchPort switch1 - [Documentation] Get switchport/switch1 - [Tags] vtnc - Wait Until Keyword Succeeds 16s 2s Verify SwitchPort odc_test openflow:1 + [Documentation] Get switchport/switch1 + [Tags] exclude + Wait Until Keyword Succeeds 16s 2s Verify SwitchPort odc_test openflow:1 Verify switchPort switch2 - [Documentation] Get switchport/switch2 - [Tags] vtnc - Wait Until Keyword Succeeds 16s 2s Verify SwitchPort odc_test openflow:2 + [Documentation] Get switchport/switch2 + [Tags] exclude + Wait Until Keyword Succeeds 16s 2s Verify SwitchPort odc_test openflow:2 Verify switchPort switch3 - [Documentation] Get switchport/switch3 - [Tags] vtnc - Wait Until Keyword Succeeds 16s 2s Verify SwitchPort odc_test openflow:3 + [Documentation] Get switchport/switch3 + [Tags] exclude + Wait Until Keyword Succeeds 16s 2s Verify SwitchPort odc_test openflow:3 Delete a Controller - [Documentation] Delete Controller odc1 - [Tags] vtnc + [Documentation] Delete Controller odc1 + [Tags] exclude Remove Controller odc_test - - -*** Keywords *** -Add a Controller - [Arguments] ${ctrlname} ${ctrlip} - [Documentation] Create a controller - ${controllerinfo} Create Dictionary controller_id ${ctrlname} type odc ipaddr ${CONTROLLER} version 1.0 auditstatus enable - ${controllercreate} Create Dictionary controller ${controllerinfo} - ${resp} PostJson session ${VTNWEBAPI}/${CTRLS_CREATE} data=${controllercreate} - Should Be Equal As Strings ${resp.status_code} 201 - - -Remove Controller - [Arguments] ${ctrlname} - [Documentation] Delete a Controller - ${resp} Delete session ${VTNWEBAPI}/${CTRLS}/${ctrlname}.json - Should Be Equal As Strings ${resp.status_code} 204 - -Check Controller Status - [Arguments] ${ctrlname} ${stat} - [Documentation] Get controller status - ${resp} Get session ${VTNWEBAPI}/${CTRLS}/${ctrlname}.json - ${contents} To JSON ${resp.content} - ${controllerblock} Get From Dictionary ${contents} controller - ${status} Get From Dictionary ${controllerblock} operstatus - Should Be Equal As Strings ${status} ${stat} - -Verify Switch - [Arguments] ${ctrlname} ${switch_id} - [Documentation] Get switch - ${resp} Get session ${VTNWEBAPI}/${CTRLS}/${ctrlname}/${SW}/${switch_id}.json - ${contents} To JSON ${resp.content} - ${switchblock} Get From Dictionary ${contents} switch - ${status} Get From Dictionary ${switchblock} switch_id - Should Be Equal As Strings ${status} ${switch_id} - -Verify SwitchPort - [Arguments] ${ctrlname} ${switch_id} - [Documentation] Get switch - ${resp} Get session ${VTNWEBAPI}/${CTRLS}/${ctrlname}/${SW}/${switch_id}/${PORTS} - Should Be Equal As Strings ${resp.status_code} 200 diff --git a/test/csit/suites/vtn/VTN_C_OF10/040__vtn_coordinator.robot b/test/csit/suites/vtn/VTN_C_OF10/040__vtn_coordinator.robot index bc946f2a..b322e2a5 100644 --- a/test/csit/suites/vtn/VTN_C_OF10/040__vtn_coordinator.robot +++ b/test/csit/suites/vtn/VTN_C_OF10/040__vtn_coordinator.robot @@ -1,173 +1,67 @@ *** Settings *** Documentation Test suite for VTN Coordinator -Suite Setup Create Session session http://${VTNC}:8083 headers=${VTNC_HEADERS} -Suite Teardown Delete All Sessions -Library SSHLibrary -Library Collections -Library ../../../libraries/RequestsLibrary.py -Library ../../../libraries/Common.py -Library ../../../libraries/Topology.py -Variables ../../../variables/Variables.py - +Suite Setup Start SuiteVtnCoTest +Suite Teardown Stop SuiteVtnCoTest +Resource ../../../libraries/VtnCoKeywords.txt *** Test Cases *** Add a ODL Controller [Documentation] Add a Controller - [Tags] vtnc - Add a Controller odc_test ${CONTROLLER} + Add a Controller odc_test ${CONTROLLER} Verify the Controller Status is up [Documentation] Check Controller status - [Tags] vtnc - Wait Until Keyword Succeeds 30s 2s Check Controller Status odc_test up + Wait Until Keyword Succeeds 30s 2s Check Controller Status odc_test up Add a Vtn Tenant1 - [Documentation] Create Vtn Tenant1 - [Tags] vtnc - Add a VTN Tenant1 VTN_TEST + [Documentation] Create Vtn Tenant1 + Wait Until Keyword Succeeds 10s 5s Add a VTN Tenant1 VTN_TEST Create VBR in VTN Tenant1 - [Documentation] Create a VBR in Tenant1 as Vbridge1 - [Tags] vtnc - Create VBR in VTN Tenant1 Vbridge1 odc_test + [Documentation] Create a VBR in Tenant1 as Vbridge1 + Create VBR in VTN Tenant1 Vbridge1 odc_test Update controller ip invalid [Documentation] Update Controller ip to invalid - [Tags] vtnc - Update Controller odc_test 10.0.0.1 invalid_IP + Update Controller odc_test 10.0.0.1 invalid_IP Verify the Controller State is down [Documentation] Check Controller status - [Tags] vtnc - Wait Until Keyword Succeeds 40s 2s Check Controller Status odc_test down + Wait Until Keyword Succeeds 30s 5s Check Controller Status odc_test down Create VBRIF in VBRIDGE Vbridge1 Interface1 - [Documentation] Create an interface to Vbridge1 - [Tags] vtnc - Create VBRIF in VBR Tenant1 Vbridge1 Interface1 Interface1 + [Documentation] Create an interface to Vbridge1 + Create VBRIF in VBR Tenant1 Vbridge1 Interface1 Interface1 202 Create VBRIF in VBRIDGE Vbridge1 Interface2 - [Documentation] Create an interface to Vbridge1 - [Tags] vtnc - Create VBRIF in VBR Tenant1 Vbridge1 Interface2 Interface2 + [Documentation] Create an interface to Vbridge1 + Create VBRIF in VBR Tenant1 Vbridge1 Interface2 Interface2 202 Update controller ip valid [Documentation] Update Controller ip to valid - [Tags] vtnc - Update Controller odc_test ${CONTROLLER} valid_IP + Update Controller odc_test ${CONTROLLER} valid_IP Verify the Controller State is up [Documentation] Check Controller status - [Tags] vtnc - Wait Until Keyword Succeeds 40s 2s Check Controller Status odc_test up + Wait Until Keyword Succeeds 40s 2s Check Controller Status odc_test up Define Portmap for Interface1 - [Documentation] Map Interface1 to a logical port - [Tags] vtnc - Define Portmap for VBRIF Tenant1 Vbridge1 Interface1 PP-OF:openflow:2-s2-eth1 + [Documentation] Map Interface1 to a logical port + Wait Until Keyword Succeeds 10s 5s Define Portmap for VBRIF Tenant1 Vbridge1 Interface1 + ... PP-OF:openflow:2-s2-eth1 Define Portmap for Interface2 - [Documentation] Map Interface2 to a logical port - [Tags] vtnc - Define Portmap for VBRIF Tenant1 Vbridge1 Interface2 PP-OF:openflow:2-s2-eth2 + [Documentation] Map Interface2 to a logical port + Define Portmap for VBRIF Tenant1 Vbridge1 Interface2 PP-OF:openflow:2-s2-eth2 Test Ping for Configuration1 - [Documentation] ping between hosts in mininet - [Tags] vtnc - Wait Until Keyword Succeeds 40s 2s Test Ping h1 h2 + [Documentation] ping between hosts in mininet + Wait Until Keyword Succeeds 30s 10s Test Ping h1 h2 Delete a VTN Tenant1 - [Documentation] Delete Vtn Tenant1 - [Tags] vtnc - Delete a VTN Tenant1 + [Documentation] Delete Vtn Tenant1 + Delete a VTN Tenant1 Delete a Controller odc1 - [Documentation] Delete Controller odc1 - [Tags] vtnc + [Documentation] Delete Controller odc1 Remove Controller odc_test - - -*** Keywords *** -Add a Controller - [Arguments] ${ctrlname} ${ctrlip} - [Documentation] Create a controller - ${controllerinfo} Create Dictionary controller_id ${ctrlname} type odc ipaddr ${CONTROLLER} version 1.0 auditstatus enable - ${controllercreate} Create Dictionary controller ${controllerinfo} - ${resp} PostJson session ${VTNWEBAPI}/${CTRLS_CREATE} data=${controllercreate} - Should Be Equal As Strings ${resp.status_code} 201 - - -Remove Controller - [Arguments] ${ctrlname} - [Documentation] Delete a Controller - ${resp} Delete session ${VTNWEBAPI}/${CTRLS}/${ctrlname}.json - Should Be Equal As Strings ${resp.status_code} 204 - - -Update Controller - [Arguments] ${ctrlname} ${ctrlip} ${desc} - [Documentation] Update controller - ${controllerinfo} Create Dictionary description ${desc} ipaddr ${ctrlip} version 1.0 auditstatus enable - ${controllerupdate} Create Dictionary controller ${controllerinfo} - ${resp} Put session ${VTNWEBAPI}/${CTRLS}/${ctrlname}.json data=${controllerupdate} - Should Be Equal As Strings ${resp.status_code} 204 - - -Check Controller Status - [Arguments] ${ctrlname} ${stat} - [Documentation] Get controller status - ${resp} Get session ${VTNWEBAPI}/${CTRLS}/${ctrlname}.json - ${contents} To JSON ${resp.content} - ${controllerblock} Get From Dictionary ${contents} controller - ${status} Get From Dictionary ${controllerblock} operstatus - Should Be Equal As Strings ${status} ${stat} - - -Add a VTN - [Arguments] ${vtnname} ${vtndescription} - [Documentation] Create VTN in Coordinator - ${vtninfo} Create Dictionary vtn_name ${vtnname} description ${vtndescription} - ${vtncreate} Create Dictionary vtn ${vtninfo} - ${resp} PostJson session ${VTNWEBAPI}/${VTNS_CREATE} data=${vtncreate} - Should Be Equal As Strings ${resp.status_code} 201 - - -Delete a VTN - [Arguments] ${vtnname} - [Documentation] Delete a VTN Created - ${resp} Delete session ${VTNWEBAPI}/${VTNS}/${vtnname}.json - Should Be Equal As Strings ${resp.status_code} 204 - - -Create VBR in VTN - [Arguments] ${vtnname} ${vbrname} ${ctrlname} - [Documentation] Create VBR for VTN in Coordinator - ${vbrinfo} Create Dictionary vbr_name ${vbrname} controller_id ${ctrlname} domain_id (DEFAULT) - ${vbrcreate} Create Dictionary vbridge ${vbrinfo} - ${resp} PostJson session ${VTNWEBAPI}/${VTNS}/${vtnname}/${VBRS_CREATE} data=${vbrcreate} - Should Be Equal As Strings ${resp.status_code} 201 - - -Create VBRIF in VBR - [Arguments] ${vtnname} ${vbrname} ${vbrifname} ${ifdescription} - [Documentation] Create VBR Interface in VBR - ${vbrifinfo} Create Dictionary if_name ${vbrifname} description ${ifdescription} - ${vbrifcreate} Create Dictionary interface ${vbrifinfo} - ${resp} PostJson session ${VTNWEBAPI}/${VTNS}/${vtnname}/${VBRS}/${vbrname}/${VBRIFS_CREATE} data=${vbrifcreate} - Should Be Equal As Strings ${resp.status_code} 202 - - -Define Portmap for VBRIF - [Arguments] ${vtnname} ${vbrname} ${vbrifname} ${logical_port_id} - [Documentation] Map Interface to a logical port - ${logical_port_info} Create Dictionary logical_port_id ${logical_port_id} - ${portmapdefine} Create Dictionary portmap ${logical_port_info} - ${resp} Put session ${VTNWEBAPI}/${VTNS}/${vtnname}/${VBRS}/${vbrname}/${VBRIFS}/${vbrifname}/${PORTMAP_CREATE} data=${portmapdefine} - Should Be Equal As Strings ${resp.status_code} 204 - -Test Ping - [Arguments] ${host1} ${host2} - [Documentation] Ping hosts to check connectivity - Write ${host1} ping -w 10 ${host2} - ${result} Read - Should Contain ${result} 64 bytes diff --git a/test/csit/suites/vtn/VTN_C_OF10/__init__.robot b/test/csit/suites/vtn/VTN_C_OF10/__init__.robot index 8a8c1943..ef39fdc0 100644 --- a/test/csit/suites/vtn/VTN_C_OF10/__init__.robot +++ b/test/csit/suites/vtn/VTN_C_OF10/__init__.robot @@ -2,10 +2,10 @@ Documentation Test suite for AD-SAL NSF Suite Setup Start Suite Suite Teardown Stop Suite -Library SSHLibrary -Resource ../../../libraries/Utils.txt +Library SSHLibrary +Resource ../../../libraries/VtnCoKeywords.txt *** Variables *** -${start}= sudo mn --controller=remote,ip=${CONTROLLER} --topo tree,2 +${start} sudo mn --controller=remote,ip=${CONTROLLER} --topo tree,2 -** Keywords *** +*** Keywords *** diff --git a/test/csit/suites/vtn/VTN_C_OF13/020__vtn_coordinator.robot b/test/csit/suites/vtn/VTN_C_OF13/020__vtn_coordinator.robot index 9c968ce2..52c97df5 100644 --- a/test/csit/suites/vtn/VTN_C_OF13/020__vtn_coordinator.robot +++ b/test/csit/suites/vtn/VTN_C_OF13/020__vtn_coordinator.robot @@ -1,156 +1,50 @@ *** Settings *** Documentation Test suite for VTN Coordinator -Suite Setup Create Session session http://${VTNC}:8083 headers=${VTNC_HEADERS} -Suite Teardown Delete All Sessions -Library SSHLibrary -Library Collections -Library ../../../libraries/RequestsLibrary.py -Library ../../../libraries/Common.py -Library ../../../libraries/Topology.py -Variables ../../../variables/Variables.py - - +Suite Setup Start SuiteVtnCoTest +Suite Teardown Stop SuiteVtnCoTest +Resource ../../../libraries/VtnCoKeywords.txt *** Test Cases *** Add a ODL Controller [Documentation] Add a Controller - [Tags] vtnc - Add a Controller odc_test ${CONTROLLER} - + Add a Controller odc_test ${CONTROLLER} Verify the Controller Status is up [Documentation] Check Controller status - [Tags] vtnc - Wait Until Keyword Succeeds 30s 2s Check Controller Status odc_test up - + Wait Until Keyword Succeeds 30s 5s Check Controller Status odc_test up Add a Vtn Tenant1 - [Documentation] Create Vtn Tenant1 - [Tags] vtnc - Add a VTN Tenant1 VTN_TEST - + [Documentation] Create Vtn Tenant1 + Wait Until Keyword Succeeds 10s 5s Add a VTN Tenant1 VTN_TEST Create VBR in VTN Tenant1 - [Documentation] Create a VBR in Tenant1 as Vbridge1 - [Tags] vtnc - Create VBR in VTN Tenant1 Vbridge1 odc_test - + [Documentation] Create a VBR in Tenant1 as Vbridge1 + Create VBR in VTN Tenant1 Vbridge1 odc_test Create VBRIF in VBRIDGE Vbridge1 Interface1 - [Documentation] Create an interface to Vbridge1 - [Tags] vtnc - Create VBRIF in VBR Tenant1 Vbridge1 Interface1 Interface1 - + [Documentation] Create an interface to Vbridge1 + Create VBRIF in VBR Tenant1 Vbridge1 Interface1 Interface1 201 Create VBRIF in VBRIDGE Vbridge1 Interface2 - [Documentation] Create an interface to Vbridge1 - [Tags] vtnc - Create VBRIF in VBR Tenant1 Vbridge1 Interface2 Interface2 - + [Documentation] Create an interface to Vbridge1 + Create VBRIF in VBR Tenant1 Vbridge1 Interface2 Interface2 201 Define Portmap for Interface1 - [Documentation] Map Interface1 to a logical port - [Tags] vtnc - Define Portmap for VBRIF Tenant1 Vbridge1 Interface1 PP-OF:openflow:3-s3-eth1 - + [Documentation] Map Interface1 to a logical port + Define Portmap for VBRIF Tenant1 Vbridge1 Interface1 PP-OF:openflow:3-s3-eth1 Define Portmap for Interface2 - [Documentation] Map Interface2 to a logical port - [Tags] vtnc - Define Portmap for VBRIF Tenant1 Vbridge1 Interface2 PP-OF:openflow:2-s2-eth1 - + [Documentation] Map Interface2 to a logical port + Define Portmap for VBRIF Tenant1 Vbridge1 Interface2 PP-OF:openflow:2-s2-eth1 Test Ping for Configuration1 - [Documentation] ping between hosts in mininet - [Tags] vtnc - Wait Until Keyword Succeeds 30s 5s Test Ping h1 h3 - + [Documentation] ping between hosts in mininet + Wait Until Keyword Succeeds 30s 10s Test Ping h1 h3 Delete a VTN Tenant1 - [Documentation] Delete Vtn Tenant1 - [Tags] vtnc - Delete a VTN Tenant1 - + [Documentation] Delete Vtn Tenant1 + Delete a VTN Tenant1 Delete a Controller odc1 - [Documentation] Delete Controller odc1 - [Tags] vtnc + [Documentation] Delete Controller odc1 Remove Controller odc_test - - - -*** Keywords *** -Add a Controller - [Arguments] ${ctrlname} ${ctrlip} - [Documentation] Create a controller - ${controllerinfo} Create Dictionary controller_id ${ctrlname} type odc ipaddr ${CONTROLLER} version 1.0 auditstatus enable - ${controllercreate} Create Dictionary controller ${controllerinfo} - ${resp} PostJson session ${VTNWEBAPI}/${CTRLS_CREATE} data=${controllercreate} - Should Be Equal As Strings ${resp.status_code} 201 - - -Remove Controller - [Arguments] ${ctrlname} - [Documentation] Delete a Controller - ${resp} Delete session ${VTNWEBAPI}/${CTRLS}/${ctrlname}.json - Should Be Equal As Strings ${resp.status_code} 204 - - -Check Controller Status - [Arguments] ${ctrlname} ${stat} - [Documentation] Get controller status - ${resp} Get session ${VTNWEBAPI}/${CTRLS}/${ctrlname}.json - ${contents} To JSON ${resp.content} - ${controllerblock} Get From Dictionary ${contents} controller - ${status} Get From Dictionary ${controllerblock} operstatus - Should Be Equal As Strings ${status} ${stat} - - -Add a VTN - [Arguments] ${vtnname} ${vtndescription} - [Documentation] Create VTN in Coordinator - ${vtninfo} Create Dictionary vtn_name ${vtnname} description ${vtndescription} - ${vtncreate} Create Dictionary vtn ${vtninfo} - ${resp} PostJson session ${VTNWEBAPI}/${VTNS_CREATE} data=${vtncreate} - Should Be Equal As Strings ${resp.status_code} 201 - - -Delete a VTN - [Arguments] ${vtnname} - [Documentation] Delete a VTN Created - ${resp} Delete session ${VTNWEBAPI}/${VTNS}/${vtnname}.json - Should Be Equal As Strings ${resp.status_code} 204 - - -Create VBR in VTN - [Arguments] ${vtnname} ${vbrname} ${ctrlname} - [Documentation] Create VBR for VTN in Coordinator - ${vbrinfo} Create Dictionary vbr_name ${vbrname} controller_id ${ctrlname} domain_id (DEFAULT) - ${vbrcreate} Create Dictionary vbridge ${vbrinfo} - ${resp} PostJson session ${VTNWEBAPI}/${VTNS}/${vtnname}/${VBRS_CREATE} data=${vbrcreate} - Should Be Equal As Strings ${resp.status_code} 201 - - -Create VBRIF in VBR - [Arguments] ${vtnname} ${vbrname} ${vbrifname} ${ifdescription} - [Documentation] Create VBR Interface in VBR - ${vbrifinfo} Create Dictionary if_name ${vbrifname} description ${ifdescription} - ${vbrifcreate} Create Dictionary interface ${vbrifinfo} - ${resp} PostJson session ${VTNWEBAPI}/${VTNS}/${vtnname}/${VBRS}/${vbrname}/${VBRIFS_CREATE} data=${vbrifcreate} - Should Be Equal As Strings ${resp.status_code} 201 - - -Define Portmap for VBRIF - [Arguments] ${vtnname} ${vbrname} ${vbrifname} ${logical_port_id} - [Documentation] Map Interface to a logical port - ${logical_port_info} Create Dictionary logical_port_id ${logical_port_id} - ${portmapdefine} Create Dictionary portmap ${logical_port_info} - ${resp} Put session ${VTNWEBAPI}/${VTNS}/${vtnname}/${VBRS}/${vbrname}/${VBRIFS}/${vbrifname}/${PORTMAP_CREATE} data=${portmapdefine} - Should Be Equal As Strings ${resp.status_code} 204 - -Test Ping - [Arguments] ${host1} ${host2} - [Documentation] Ping hosts to check connectivity - Write ${host1} ping -w 10 ${host2} - ${result} Read - Should Contain ${result} 64 bytes diff --git a/test/csit/suites/vtn/VTN_C_OF13/030__vtn_coordinator.robot b/test/csit/suites/vtn/VTN_C_OF13/030__vtn_coordinator.robot index 032b4318..0b34dea9 100644 --- a/test/csit/suites/vtn/VTN_C_OF13/030__vtn_coordinator.robot +++ b/test/csit/suites/vtn/VTN_C_OF13/030__vtn_coordinator.robot @@ -1,99 +1,51 @@ - *** Settings *** Documentation Test suite for VTN Coordinator -Suite Setup Create Session session http://${VTNC}:8083 headers=${VTNC_HEADERS} -Suite Teardown Delete All Sessions -Library SSHLibrary -Library Collections -Library ../../../libraries/RequestsLibrary.py -Library ../../../libraries/Common.py -Library ../../../libraries/Topology.py -Variables ../../../variables/Variables.py - +Suite Setup Start SuiteVtnCoTest +Suite Teardown Stop SuiteVtnCoTest +Resource ../../../libraries/VtnCoKeywords.txt *** Test Cases *** Add a ODL Controller [Documentation] Add a Controller odc1 - [Tags] vtnc - Add a Controller odc_test ${CONTROLLER} + [Tags] exclude + Add a Controller odc_test ${CONTROLLER} Verify the Controller Status is up [Documentation] Check Controller status - [Tags] vtnc - Wait Until Keyword Succeeds 30s 2s Check Controller Status odc_test up + [Tags] exclude + Wait Until Keyword Succeeds 30s 2s Check Controller Status odc_test up Verify switch1 [Documentation] Get switch1 - [Tags] vtnc + [Tags] exclude Wait Until Keyword Succeeds 30s 2s Verify Switch odc_test 00:00:00:00:00:00:00:01 Verify switch2 [Documentation] Get switch2 - [Tags] vtnc + [Tags] exclude Wait Until Keyword Succeeds 30s 2s Verify Switch odc_test 00:00:00:00:00:00:00:02 Verify switch3 [Documentation] Get switch3 - [Tags] vtnc + [Tags] exclude Wait Until Keyword Succeeds 30s 2s Verify Switch odc_test 00:00:00:00:00:00:00:03 Verify switchPort switch1 - [Documentation] Get switchport/switch1 - [Tags] vtnc + [Documentation] Get switchport/switch1 + [Tags] exclude Wait Until Keyword Succeeds 30s 2s Verify SwitchPort odc_test 00:00:00:00:00:00:00:01 Verify switchPort switch2 - [Documentation] Get switchport/switch2 - [Tags] vtnc + [Documentation] Get switchport/switch2 + [Tags] exclude Wait Until Keyword Succeeds 30s 2s Verify SwitchPort odc_test 00:00:00:00:00:00:00:02 Verify switchPort switch3 - [Documentation] Get switchport/switch3 - [Tags] vtnc + [Documentation] Get switchport/switch3 + [Tags] exclude Wait Until Keyword Succeeds 30s 2s Verify SwitchPort odc_test 00:00:00:00:00:00:00:03 Delete a Controller - [Documentation] Delete Controller odc1 - [Tags] vtnc + [Documentation] Delete Controller odc1 + [Tags] exclude Remove Controller odc_test - - -*** Keywords *** -Add a Controller - [Arguments] ${ctrlname} ${ctrlip} - [Documentation] Create a controller - ${controllerinfo} Create Dictionary controller_id ${ctrlname} type odc ipaddr ${CONTROLLER} version 1.0 auditstatus enable - ${controllercreate} Create Dictionary controller ${controllerinfo} - ${resp} PostJson session ${VTNWEBAPI}/${CTRLS_CREATE} data=${controllercreate} - Should Be Equal As Strings ${resp.status_code} 201 - - -Remove Controller - [Arguments] ${ctrlname} - [Documentation] Delete a Controller - ${resp} Delete session ${VTNWEBAPI}/${CTRLS}/${ctrlname}.json - Should Be Equal As Strings ${resp.status_code} 204 - -Check Controller Status - [Arguments] ${ctrlname} ${stat} - [Documentation] Get controller status - ${resp} Get session ${VTNWEBAPI}/${CTRLS}/${ctrlname}.json - ${contents} To JSON ${resp.content} - ${controllerblock} Get From Dictionary ${contents} controller - ${status} Get From Dictionary ${controllerblock} operstatus - Should Be Equal As Strings ${status} ${stat} - -Verify Switch - [Arguments] ${ctrlname} ${switch_id} - [Documentation] Get switch - ${resp} Get session ${VTNWEBAPI}/${CTRLS}/${ctrlname}/${SW}/${switch_id}.json - ${contents} To JSON ${resp.content} - ${switchblock} Get From Dictionary ${contents} switch - ${status} Get From Dictionary ${switchblock} switch_id - Should Be Equal As Strings ${status} ${switch_id} - -Verify SwitchPort - [Arguments] ${ctrlname} ${switch_id} - [Documentation] Get switch - ${resp} Get session ${VTNWEBAPI}/${CTRLS}/${ctrlname}/${SW}/${switch_id}/${PORTS} - Should Be Equal As Strings ${resp.status_code} 200 diff --git a/test/csit/suites/vtn/VTN_C_OF13/040__vtn_coordinator.robot b/test/csit/suites/vtn/VTN_C_OF13/040__vtn_coordinator.robot index ddb8782c..16fcc7f2 100644 --- a/test/csit/suites/vtn/VTN_C_OF13/040__vtn_coordinator.robot +++ b/test/csit/suites/vtn/VTN_C_OF13/040__vtn_coordinator.robot @@ -1,173 +1,68 @@ *** Settings *** Documentation Test suite for VTN Coordinator -Suite Setup Create Session session http://${VTNC}:8083 headers=${VTNC_HEADERS} -Suite Teardown Delete All Sessions -Library SSHLibrary -Library Collections -Library ../../../libraries/RequestsLibrary.py -Library ../../../libraries/Common.py -Library ../../../libraries/Topology.py -Variables ../../../variables/Variables.py - +Suite Setup Start SuiteVtnCoTest +Suite Teardown Stop SuiteVtnCoTest +Resource ../../../libraries/VtnCoKeywords.txt *** Test Cases *** Add a ODL Controller [Documentation] Add a Controller - [Tags] vtnc - Add a Controller odc_test ${CONTROLLER} + Add a Controller odc_test ${CONTROLLER} Verify the Controller Status is up [Documentation] Check Controller status - [Tags] vtnc - Wait Until Keyword Succeeds 30s 2s Check Controller Status odc_test up + Wait Until Keyword Succeeds 10s 5s Check Controller Status odc_test up Add a Vtn Tenant1 - [Documentation] Create Vtn Tenant1 - [Tags] vtnc - Add a VTN Tenant1 VTN_TEST + [Documentation] Create Vtn Tenant1 + Add a VTN Tenant1 VTN_TEST Create VBR in VTN Tenant1 - [Documentation] Create a VBR in Tenant1 as Vbridge1 - [Tags] vtnc - Create VBR in VTN Tenant1 Vbridge1 odc_test + [Documentation] Create a VBR in Tenant1 as Vbridge1 + Create VBR in VTN Tenant1 Vbridge1 odc_test Update controller ip invalid [Documentation] Update Controller ip to invalid - [Tags] vtnc - Update Controller odc_test 10.0.0.1 invalid_IP + Update Controller odc_test 10.0.0.1 invalid_IP Verify the Controller State is down [Documentation] Check Controller status - [Tags] vtnc - Wait Until Keyword Succeeds 40s 2s Check Controller Status odc_test down + Wait Until Keyword Succeeds 40s 5s Check Controller Status odc_test down Create VBRIF in VBRIDGE Vbridge1 Interface1 - [Documentation] Create an interface to Vbridge1 - [Tags] vtnc - Create VBRIF in VBR Tenant1 Vbridge1 Interface1 Interface1 + [Documentation] Create an interface to Vbridge1 + Create VBRIF in VBR Tenant1 Vbridge1 Interface1 Interface1 202 Create VBRIF in VBRIDGE Vbridge1 Interface2 - [Documentation] Create an interface to Vbridge1 - [Tags] vtnc - Create VBRIF in VBR Tenant1 Vbridge1 Interface2 Interface2 + [Documentation] Create an interface to Vbridge1 + Create VBRIF in VBR Tenant1 Vbridge1 Interface2 Interface2 202 Update controller ip valid [Documentation] Update Controller ip to valid - [Tags] vtnc - Update Controller odc_test ${CONTROLLER} valid_IP + Update Controller odc_test ${CONTROLLER} valid_IP Verify the Controller State is up [Documentation] Check Controller status - [Tags] vtnc - Wait Until Keyword Succeeds 40s 2s Check Controller Status odc_test up + Wait Until Keyword Succeeds 40s 2s Check Controller Status odc_test up Define Portmap for Interface1 - [Documentation] Map Interface1 to a logical port - [Tags] vtnc - Define Portmap for VBRIF Tenant1 Vbridge1 Interface1 PP-OF:00:00:00:00:00:00:00:02-s2-eth1 + [Documentation] Map Interface1 to a logical port + Wait Until Keyword Succeeds 10s 5s Define Portmap for VBRIF Tenant1 Vbridge1 Interface1 + ... PP-OF:openflow:2-s2-eth1 Define Portmap for Interface2 - [Documentation] Map Interface2 to a logical port - [Tags] vtnc - Define Portmap for VBRIF Tenant1 Vbridge1 Interface2 PP-OF:00:00:00:00:00:00:00:02-s2-eth2 + [Documentation] Map Interface2 to a logical port + Wait Until Keyword Succeeds 10s 5s Define Portmap for VBRIF Tenant1 Vbridge1 Interface2 + ... PP-OF:openflow:2-s2-eth2 Test Ping for Configuration1 - [Documentation] ping between hosts in mininet - [Tags] vtnc - Wait Until Keyword Succeeds 30s 2s Test Ping h1 h2 + [Documentation] ping between hosts in mininet + Wait Until Keyword Succeeds 30s 10s Test Ping h1 h2 Delete a VTN Tenant1 - [Documentation] Delete Vtn Tenant1 - [Tags] vtnc - Delete a VTN Tenant1 + [Documentation] Delete Vtn Tenant1 + Delete a VTN Tenant1 Delete a Controller odc1 - [Documentation] Delete Controller odc1 - [Tags] vtnc + [Documentation] Delete Controller odc1 Remove Controller odc_test - - -*** Keywords *** -Add a Controller - [Arguments] ${ctrlname} ${ctrlip} - [Documentation] Create a controller - ${controllerinfo} Create Dictionary controller_id ${ctrlname} type odc ipaddr ${CONTROLLER} version 1.0 auditstatus enable - ${controllercreate} Create Dictionary controller ${controllerinfo} - ${resp} PostJson session ${VTNWEBAPI}/${CTRLS_CREATE} data=${controllercreate} - Should Be Equal As Strings ${resp.status_code} 201 - - -Remove Controller - [Arguments] ${ctrlname} - [Documentation] Delete a Controller - ${resp} Delete session ${VTNWEBAPI}/${CTRLS}/${ctrlname}.json - Should Be Equal As Strings ${resp.status_code} 204 - - -Update Controller - [Arguments] ${ctrlname} ${ctrlip} ${desc} - [Documentation] Update controller - ${controllerinfo} Create Dictionary description ${desc} ipaddr ${ctrlip} version 1.0 auditstatus enable - ${controllerupdate} Create Dictionary controller ${controllerinfo} - ${resp} Put session ${VTNWEBAPI}/${CTRLS}/${ctrlname}.json data=${controllerupdate} - Should Be Equal As Strings ${resp.status_code} 204 - - -Check Controller Status - [Arguments] ${ctrlname} ${stat} - [Documentation] Get controller status - ${resp} Get session ${VTNWEBAPI}/${CTRLS}/${ctrlname}.json - ${contents} To JSON ${resp.content} - ${controllerblock} Get From Dictionary ${contents} controller - ${status} Get From Dictionary ${controllerblock} operstatus - Should Be Equal As Strings ${status} ${stat} - - -Add a VTN - [Arguments] ${vtnname} ${vtndescription} - [Documentation] Create VTN in Coordinator - ${vtninfo} Create Dictionary vtn_name ${vtnname} description ${vtndescription} - ${vtncreate} Create Dictionary vtn ${vtninfo} - ${resp} PostJson session ${VTNWEBAPI}/${VTNS_CREATE} data=${vtncreate} - Should Be Equal As Strings ${resp.status_code} 201 - - -Delete a VTN - [Arguments] ${vtnname} - [Documentation] Delete a VTN Created - ${resp} Delete session ${VTNWEBAPI}/${VTNS}/${vtnname}.json - Should Be Equal As Strings ${resp.status_code} 204 - - -Create VBR in VTN - [Arguments] ${vtnname} ${vbrname} ${ctrlname} - [Documentation] Create VBR for VTN in Coordinator - ${vbrinfo} Create Dictionary vbr_name ${vbrname} controller_id ${ctrlname} domain_id (DEFAULT) - ${vbrcreate} Create Dictionary vbridge ${vbrinfo} - ${resp} PostJson session ${VTNWEBAPI}/${VTNS}/${vtnname}/${VBRS_CREATE} data=${vbrcreate} - Should Be Equal As Strings ${resp.status_code} 201 - - -Create VBRIF in VBR - [Arguments] ${vtnname} ${vbrname} ${vbrifname} ${ifdescription} - [Documentation] Create VBR Interface in VBR - ${vbrifinfo} Create Dictionary if_name ${vbrifname} description ${ifdescription} - ${vbrifcreate} Create Dictionary interface ${vbrifinfo} - ${resp} PostJson session ${VTNWEBAPI}/${VTNS}/${vtnname}/${VBRS}/${vbrname}/${VBRIFS_CREATE} data=${vbrifcreate} - Should Be Equal As Strings ${resp.status_code} 202 - - -Define Portmap for VBRIF - [Arguments] ${vtnname} ${vbrname} ${vbrifname} ${logical_port_id} - [Documentation] Map Interface to a logical port - ${logical_port_info} Create Dictionary logical_port_id ${logical_port_id} - ${portmapdefine} Create Dictionary portmap ${logical_port_info} - ${resp} Put session ${VTNWEBAPI}/${VTNS}/${vtnname}/${VBRS}/${vbrname}/${VBRIFS}/${vbrifname}/${PORTMAP_CREATE} data=${portmapdefine} - Should Be Equal As Strings ${resp.status_code} 204 - -Test Ping - [Arguments] ${host1} ${host2} - [Documentation] Ping hosts to check connectivity - Write ${host1} ping -w 10 ${host2} - ${result} Read - Should Contain ${result} 64 bytes diff --git a/test/csit/suites/vtn/VTN_C_OF13/__init__.robot b/test/csit/suites/vtn/VTN_C_OF13/__init__.robot index 36c2d662..3f5c459f 100644 --- a/test/csit/suites/vtn/VTN_C_OF13/__init__.robot +++ b/test/csit/suites/vtn/VTN_C_OF13/__init__.robot @@ -2,10 +2,10 @@ Documentation Test suite for AD-SAL NSF mininet OF13 Suite Setup Start Suite Suite Teardown Stop Suite -Library SSHLibrary -Resource ../../../libraries/Utils.txt +Library SSHLibrary +Resource ../../../libraries/VtnCoKeywords.txt *** Variables *** -${start}= sudo mn --controller=remote,ip=${CONTROLLER} --topo tree,2 --switch ovsk,protocols=OpenFlow13 +${start} sudo mn --controller=remote,ip=${CONTROLLER} --topo tree,2 --switch ovsk,protocols=OpenFlow13 -** Keywords *** +*** Keywords *** diff --git a/test/csit/testplans/vtn-coordinator.txt b/test/csit/testplans/vtn-coordinator.txt index d02aec9f..248bdbfe 100644 --- a/test/csit/testplans/vtn-coordinator.txt +++ b/test/csit/testplans/vtn-coordinator.txt @@ -1,4 +1,5 @@ # Place the suites in run order: +integration/test/csit/suites/vtn/VTN_C_LAUNCH integration/test/csit/suites/vtn/VTN_C_OF10 integration/test/csit/suites/vtn/VTN_C_OF13 -- 2.36.6