Add robot test files for VTN Coordinator features
authorKarthik.S <siva-karthik@hcl.com>
Thu, 6 Aug 2015 16:02:08 +0000 (21:32 +0530)
committerGerrit Code Review <gerrit@opendaylight.org>
Thu, 27 Aug 2015 19:08:18 +0000 (19:08 +0000)
     * Rename all robot test files with vtn features name
     * Modify test cases to reduce delay time of controller
     * Add Tags in some test cases to disable them
     * Fix error in VtnCoKeywords library file
     * Implemented the alternative solution discussed in Bug 4008

Change-Id: Ibd9dd634a2c9cd7880014966a8c8d62b5522a9bd
Signed-off-by: Karthik.S <siva-karthik@hcl.com>
test/csit/libraries/VtnCoKeywords.robot
test/csit/suites/vtn/VTN_C_OF10/020__vtn_vbrif_portmap.robot [moved from test/csit/suites/vtn/VTN_C_OF13/020__vtn_coordinator.robot with 80% similarity]
test/csit/suites/vtn/VTN_C_OF10/030__verify_switch.robot [moved from test/csit/suites/vtn/VTN_C_OF10/030__vtn_coordinator.robot with 55% similarity]
test/csit/suites/vtn/VTN_C_OF10/040__vtn_vbrif_audit.robot [moved from test/csit/suites/vtn/VTN_C_OF13/040__vtn_coordinator.robot with 77% similarity]
test/csit/suites/vtn/VTN_C_OF13/020__vtn_vbrif_portmap.robot [moved from test/csit/suites/vtn/VTN_C_OF10/020__vtn_coordinator.robot with 80% similarity]
test/csit/suites/vtn/VTN_C_OF13/030__verify_switch.robot [moved from test/csit/suites/vtn/VTN_C_OF13/030__vtn_coordinator.robot with 55% similarity]
test/csit/suites/vtn/VTN_C_OF13/040__vtn_vbrif_audit.robot [moved from test/csit/suites/vtn/VTN_C_OF10/040__vtn_coordinator.robot with 77% similarity]

index f476d810c5d30d05af7c0eb1697f7a950993a8ad..b63683e89e1ce9103e7f60b7a1e0d1a77e049bb8 100644 (file)
@@ -37,8 +37,12 @@ Start SuiteVtnCo
     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    sed -i 's/odcdrv_ping_interval = 30/odcdrv_ping_interval = 10/g' /usr/local/vtn/modules/odcdriver.conf
+    Execute Command    sed -i 's/physical_attributes_read_interval = 40/physical_attributes_read_interval = 15/g' /usr/local/vtn/modules/vtndrvintf.conf
     Execute Command    /usr/local/vtn/bin/vtn_start
     Execute Command    /usr/local/vtn/bin/unc_dmctl status
+    Execute Command    /usr/local/vtn/bin/drvodc_control loglevel trace
+    Execute Command    /usr/local/vtn/bin/lgcnw_control loglevel trace
     Execute Command    exit
 
 Stop SuiteVtnCo
@@ -61,7 +65,7 @@ Get Coordinator Version
 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
+    ${controllerinfo}    Create Dictionary    controller_id=${ctrlname}    type=odc    ipaddr=${CONTROLLER}    version=1.0
     ${controllercreate}    Create Dictionary    controller=${controllerinfo}
     ${controllercreate_json}=    json.dumps    ${controllercreate}
     ${resp}    RequestsLibrary.Post    session    ${VTNWEBAPI}/${CTRLS_CREATE}    data=${controllercreate_json}
@@ -76,12 +80,21 @@ Remove Controller
 Update Controller
     [Arguments]    ${ctrlname}    ${ctrlip}    ${desc}
     [Documentation]    Update controller
-    ${controllerinfo}    Create Dictionary    description=${desc}    ipaddr=${ctrlip}    version=1.0    auditstatus=enable
+    ${controllerinfo}    Create Dictionary    description=${desc}    ipaddr=${ctrlip}    version=1.0
     ${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
 
+Audit Controller
+    [Arguments]    ${ctrlname}
+    [Documentation]    Trigger Manual Audit
+    ${auditinfo}    Create Dictionary    force=false    real-network_audit=false
+    ${auditupdate}    Create Dictionary    audit=${auditinfo}
+    ${auditupdate_json}=    json.dumps    ${auditupdate}
+    ${resp}    RequestsLibrary.Put    session    ${VTNWEBAPI}/${CTRLS}/${ctrlname}/audit.json   data=${auditupdate_json}
+    Should Be Equal As Strings    ${resp.status_code}    204
+
 Check Controller Status
     [Arguments]    ${ctrlname}    ${stat}
     [Documentation]    Get controller status
@@ -121,7 +134,9 @@ Create VBRIF 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}
+    : For  ${i}  IN RANGE    1   5
+    \    ${resp}    RequestsLibrary.Post    session    ${VTNWEBAPI}/${VTNS}/${vtnname}/${VBRS}/${vbrname}/${VBRIFS_CREATE}    data=${vbrifcreate_json}
+    \    Exit For Loop If    '${resp.status_code}' == '${retcode}'
     Should Be Equal As Strings    ${resp.status_code}    ${retcode}
 
 Define Portmap for VBRIF
@@ -136,14 +151,14 @@ Define Portmap for VBRIF
 Test Ping
     [Arguments]    ${host1}    ${host2}
     [Documentation]    Ping hosts to check connectivity
-    Write    ${host1} ping -c 10 ${host2}
+    Write    ${host1} ping -c 4 ${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
+    ${resp}    RequestsLibrary.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
@@ -152,5 +167,5 @@ Verify Switch
 Verify SwitchPort
     [Arguments]    ${ctrlname}    ${switch_id}
     [Documentation]    Get switch
-    ${resp}    Get    session    ${VTNWEBAPI}/${CTRLS}/${ctrlname}/${SW}/${switch_id}/${PORTS}
+    ${resp}    RequestsLibrary.Get    session    ${VTNWEBAPI}/${CTRLS}/${ctrlname}/${SW}/${switch_id}/${PORTS}
     Should Be Equal As Strings    ${resp.status_code}    200
similarity index 80%
rename from test/csit/suites/vtn/VTN_C_OF13/020__vtn_coordinator.robot
rename to test/csit/suites/vtn/VTN_C_OF10/020__vtn_vbrif_portmap.robot
index 78e3ca6608b028c473928f11d29d506112c27758..73ca2453a6f37241d9c9c9b041037ef330c27946 100644 (file)
@@ -9,49 +9,45 @@ Add a ODL Controller
     [Documentation]    Add a Controller
     Add a Controller    odc_test    ${CONTROLLER}
 
-Verify the Controller Status is up
+Verify the Controller Status is waiting_audit
     [Documentation]    Check Controller status
-    [Tags]    exclude
-    Wait Until Keyword Succeeds    32s    2s    Check Controller Status    odc_test    up
+    # Ping starts after 12sec of completing audit and controller status become "UP"
+    Wait Until Keyword Succeeds    12s    2s   Check Controller Status    odc_test   waiting_audit
+
+Audit a controller
+    [Documentation]    Trigger update audit
+    Audit Controller    odc_test
 
 Add a Vtn Tenant1
     [Documentation]    Create Vtn Tenant1
-    [Tags]    exclude
     Add a VTN    Tenant1    VTN_TEST
 
 Create VBR in VTN Tenant1
     [Documentation]    Create a VBR in Tenant1 as Vbridge1
-    [Tags]    exclude
     Create VBR in VTN    Tenant1    Vbridge1    odc_test
 
 Create VBRIF in VBRIDGE Vbridge1 Interface1
     [Documentation]    Create an interface to Vbridge1
-    [Tags]    exclude
     Create VBRIF in VBR    Tenant1    Vbridge1    Interface1    Interface1    201
 
 Create VBRIF in VBRIDGE Vbridge1 Interface2
     [Documentation]    Create an interface to Vbridge1
-    [Tags]    exclude
     Create VBRIF in VBR    Tenant1    Vbridge1    Interface2    Interface2    201
 
 Define Portmap for Interface1
     [Documentation]    Map Interface1 to a logical port
-    [Tags]    exclude
     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]    exclude
     Define Portmap for VBRIF    Tenant1    Vbridge1    Interface2    PP-OF:openflow:2-s2-eth1
 
 Test Ping for Configuration1
     [Documentation]    ping between hosts in mininet
-    [Tags]    exclude
-    Wait Until Keyword Succeeds    30s    10s    Test Ping    h1    h3
+    Wait Until Keyword Succeeds   10s    2s    Test Ping    h1    h3
 
 Delete a VTN Tenant1
     [Documentation]    Delete Vtn Tenant1
-    [Tags]    exclude
     Delete a VTN    Tenant1
 
 Delete a Controller odc1
similarity index 55%
rename from test/csit/suites/vtn/VTN_C_OF10/030__vtn_coordinator.robot
rename to test/csit/suites/vtn/VTN_C_OF10/030__verify_switch.robot
index c7c6dfeed45228271fcc327b392fd291139c56a9..2deae4c3ce8e5661bd838a73b16384da5e9d5418 100644 (file)
@@ -9,40 +9,40 @@ Add a ODL Controller
     [Documentation]    Add a Controller odc1
     Add a Controller    odc_test    ${CONTROLLER}
 
-Verify the Controller Status is up
+Verify the Controller Status is waiting_audit
     [Documentation]    Check Controller status
-    [Tags]    exclude
-    Wait Until Keyword Succeeds    30s    2s    Check Controller Status    odc_test    up
+    Wait Until Keyword Succeeds    12s    2s   Check Controller Status    odc_test   waiting_audit
+
+Audit a controller
+    [Documentation]    Trigger update audit
+    Audit Controller    odc_test
 
 Verify switch1
     [Documentation]    Get switch1
     [Tags]    exclude
-    Wait Until Keyword Succeeds    30s    2s    Verify Switch    odc_test    openflow:1
+    Verify Switch    odc_test    openflow:1
 
 Verify switch2
     [Documentation]    Get switch2
     [Tags]    exclude
-    Wait Until Keyword Succeeds    30s    2s    Verify Switch    odc_test    openflow:2
+    Verify Switch    odc_test    openflow:2
 
 Verify switch3
     [Documentation]    Get switch3
     [Tags]    exclude
-    Wait Until Keyword Succeeds    30s    2s    Verify Switch    odc_test    openflow:3
+    Verify Switch    odc_test    openflow:3
 
 Verify switchPort switch1
     [Documentation]    Get switchport/switch1
-    [Tags]    exclude
-    Wait Until Keyword Succeeds    16s    2s    Verify SwitchPort    odc_test    openflow:1
+    Verify SwitchPort    odc_test    openflow:1
 
 Verify switchPort switch2
     [Documentation]    Get switchport/switch2
-    [Tags]    exclude
-    Wait Until Keyword Succeeds    16s    2s    Verify SwitchPort    odc_test    openflow:2
+    Verify SwitchPort    odc_test    openflow:2
 
 Verify switchPort switch3
     [Documentation]    Get switchport/switch3
-    [Tags]    exclude
-    Wait Until Keyword Succeeds    16s    2s    Verify SwitchPort    odc_test    openflow:3
+    Verify SwitchPort    odc_test    openflow:3
 
 Delete a Controller
     [Documentation]    Delete Controller odc1
similarity index 77%
rename from test/csit/suites/vtn/VTN_C_OF13/040__vtn_coordinator.robot
rename to test/csit/suites/vtn/VTN_C_OF10/040__vtn_vbrif_audit.robot
index ffcbb7f229504ad4ac357302c3b6bafb318cce03..586b9022d2f99a7142bb90515485a75fd2ced448 100644 (file)
@@ -9,19 +9,20 @@ Add a ODL Controller
     [Documentation]    Add a Controller
     Add a Controller    odc_test    ${CONTROLLER}
 
-Verify the Controller Status is up
+Verify the Controller Status is waiting_audit
     [Documentation]    Check Controller status
-    [Tags]    exclude
-    Wait Until Keyword Succeeds    32s    2s    Check Controller Status    odc_test    up
+    Wait Until Keyword Succeeds    12s    2s   Check Controller Status    odc_test   waiting_audit
+
+Audit a controller
+    [Documentation]    Trigger update audit
+    Audit Controller    odc_test
 
 Add a Vtn Tenant1
     [Documentation]    Create Vtn Tenant1
-    [Tags]    exclude
     Add a VTN    Tenant1    VTN_TEST
 
 Create VBR in VTN Tenant1
     [Documentation]    Create a VBR in Tenant1 as Vbridge1
-    [Tags]    exclude
     Create VBR in VTN    Tenant1    Vbridge1    odc_test
 
 Update controller ip invalid
@@ -32,7 +33,7 @@ Update controller ip invalid
 Verify the Controller State is down
     [Documentation]    Check Controller status
     [Tags]    exclude
-    Wait Until Keyword Succeeds    40s    5s    Check Controller Status    odc_test    down
+    Wait Until Keyword Succeeds    12s    2s   Check Controller Status    odc_test    down
 
 Create VBRIF in VBRIDGE Vbridge1 Interface1
     [Documentation]    Create an interface to Vbridge1
@@ -49,10 +50,15 @@ Update controller ip valid
     [Tags]    exclude
     Update Controller    odc_test    ${CONTROLLER}    valid_IP
 
-Verify the Controller State is up
+Verify the Controller State is in waiting_audit
     [Documentation]    Check Controller status
     [Tags]    exclude
-    Wait Until Keyword Succeeds    32s    2s    Check Controller Status    odc_test    up
+    Wait Until Keyword Succeeds    12s    2s   Check Controller Status    odc_test    waiting_audit
+
+Audit a controller manually
+    [Documentation]    Trigger update audit
+    [Tags]    exclude
+    Audit Controller    odc_test
 
 Define Portmap for Interface1
     [Documentation]    Map Interface1 to a logical port
@@ -67,11 +73,10 @@ Define Portmap for Interface2
 Test Ping for Configuration1
     [Documentation]    ping between hosts in mininet
     [Tags]    exclude
-    Wait Until Keyword Succeeds    30s    10s    Test Ping    h1    h2
+    Wait Until Keyword Succeeds    10s    2s    Test Ping    h1    h2
 
 Delete a VTN Tenant1
     [Documentation]    Delete Vtn Tenant1
-    [Tags]    exclude
     Delete a VTN    Tenant1
 
 Delete a Controller odc1
similarity index 80%
rename from test/csit/suites/vtn/VTN_C_OF10/020__vtn_coordinator.robot
rename to test/csit/suites/vtn/VTN_C_OF13/020__vtn_vbrif_portmap.robot
index 78e3ca6608b028c473928f11d29d506112c27758..adaa8d596690fc29b0a19bcd0dec67b75a28ac7c 100644 (file)
@@ -9,49 +9,44 @@ Add a ODL Controller
     [Documentation]    Add a Controller
     Add a Controller    odc_test    ${CONTROLLER}
 
-Verify the Controller Status is up
+Verify the Controller Status is waiting_audit
     [Documentation]    Check Controller status
-    [Tags]    exclude
-    Wait Until Keyword Succeeds    32s    2s    Check Controller Status    odc_test    up
+    Wait Until Keyword Succeeds    12s    2s   Check Controller Status    odc_test   waiting_audit
+
+Audit a controller
+    [Documentation]    Trigger update audit
+    Audit Controller    odc_test
 
 Add a Vtn Tenant1
     [Documentation]    Create Vtn Tenant1
-    [Tags]    exclude
     Add a VTN    Tenant1    VTN_TEST
 
 Create VBR in VTN Tenant1
     [Documentation]    Create a VBR in Tenant1 as Vbridge1
-    [Tags]    exclude
     Create VBR in VTN    Tenant1    Vbridge1    odc_test
 
 Create VBRIF in VBRIDGE Vbridge1 Interface1
     [Documentation]    Create an interface to Vbridge1
-    [Tags]    exclude
     Create VBRIF in VBR    Tenant1    Vbridge1    Interface1    Interface1    201
 
 Create VBRIF in VBRIDGE Vbridge1 Interface2
     [Documentation]    Create an interface to Vbridge1
-    [Tags]    exclude
     Create VBRIF in VBR    Tenant1    Vbridge1    Interface2    Interface2    201
 
 Define Portmap for Interface1
     [Documentation]    Map Interface1 to a logical port
-    [Tags]    exclude
     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]    exclude
     Define Portmap for VBRIF    Tenant1    Vbridge1    Interface2    PP-OF:openflow:2-s2-eth1
 
 Test Ping for Configuration1
     [Documentation]    ping between hosts in mininet
-    [Tags]    exclude
-    Wait Until Keyword Succeeds    30s    10s    Test Ping    h1    h3
+    Wait Until Keyword Succeeds   10s    2s    Test Ping    h1    h3
 
 Delete a VTN Tenant1
     [Documentation]    Delete Vtn Tenant1
-    [Tags]    exclude
     Delete a VTN    Tenant1
 
 Delete a Controller odc1
similarity index 55%
rename from test/csit/suites/vtn/VTN_C_OF13/030__vtn_coordinator.robot
rename to test/csit/suites/vtn/VTN_C_OF13/030__verify_switch.robot
index c7c6dfeed45228271fcc327b392fd291139c56a9..2deae4c3ce8e5661bd838a73b16384da5e9d5418 100644 (file)
@@ -9,40 +9,40 @@ Add a ODL Controller
     [Documentation]    Add a Controller odc1
     Add a Controller    odc_test    ${CONTROLLER}
 
-Verify the Controller Status is up
+Verify the Controller Status is waiting_audit
     [Documentation]    Check Controller status
-    [Tags]    exclude
-    Wait Until Keyword Succeeds    30s    2s    Check Controller Status    odc_test    up
+    Wait Until Keyword Succeeds    12s    2s   Check Controller Status    odc_test   waiting_audit
+
+Audit a controller
+    [Documentation]    Trigger update audit
+    Audit Controller    odc_test
 
 Verify switch1
     [Documentation]    Get switch1
     [Tags]    exclude
-    Wait Until Keyword Succeeds    30s    2s    Verify Switch    odc_test    openflow:1
+    Verify Switch    odc_test    openflow:1
 
 Verify switch2
     [Documentation]    Get switch2
     [Tags]    exclude
-    Wait Until Keyword Succeeds    30s    2s    Verify Switch    odc_test    openflow:2
+    Verify Switch    odc_test    openflow:2
 
 Verify switch3
     [Documentation]    Get switch3
     [Tags]    exclude
-    Wait Until Keyword Succeeds    30s    2s    Verify Switch    odc_test    openflow:3
+    Verify Switch    odc_test    openflow:3
 
 Verify switchPort switch1
     [Documentation]    Get switchport/switch1
-    [Tags]    exclude
-    Wait Until Keyword Succeeds    16s    2s    Verify SwitchPort    odc_test    openflow:1
+    Verify SwitchPort    odc_test    openflow:1
 
 Verify switchPort switch2
     [Documentation]    Get switchport/switch2
-    [Tags]    exclude
-    Wait Until Keyword Succeeds    16s    2s    Verify SwitchPort    odc_test    openflow:2
+    Verify SwitchPort    odc_test    openflow:2
 
 Verify switchPort switch3
     [Documentation]    Get switchport/switch3
-    [Tags]    exclude
-    Wait Until Keyword Succeeds    16s    2s    Verify SwitchPort    odc_test    openflow:3
+    Verify SwitchPort    odc_test    openflow:3
 
 Delete a Controller
     [Documentation]    Delete Controller odc1
similarity index 77%
rename from test/csit/suites/vtn/VTN_C_OF10/040__vtn_coordinator.robot
rename to test/csit/suites/vtn/VTN_C_OF13/040__vtn_vbrif_audit.robot
index ffcbb7f229504ad4ac357302c3b6bafb318cce03..586b9022d2f99a7142bb90515485a75fd2ced448 100644 (file)
@@ -9,19 +9,20 @@ Add a ODL Controller
     [Documentation]    Add a Controller
     Add a Controller    odc_test    ${CONTROLLER}
 
-Verify the Controller Status is up
+Verify the Controller Status is waiting_audit
     [Documentation]    Check Controller status
-    [Tags]    exclude
-    Wait Until Keyword Succeeds    32s    2s    Check Controller Status    odc_test    up
+    Wait Until Keyword Succeeds    12s    2s   Check Controller Status    odc_test   waiting_audit
+
+Audit a controller
+    [Documentation]    Trigger update audit
+    Audit Controller    odc_test
 
 Add a Vtn Tenant1
     [Documentation]    Create Vtn Tenant1
-    [Tags]    exclude
     Add a VTN    Tenant1    VTN_TEST
 
 Create VBR in VTN Tenant1
     [Documentation]    Create a VBR in Tenant1 as Vbridge1
-    [Tags]    exclude
     Create VBR in VTN    Tenant1    Vbridge1    odc_test
 
 Update controller ip invalid
@@ -32,7 +33,7 @@ Update controller ip invalid
 Verify the Controller State is down
     [Documentation]    Check Controller status
     [Tags]    exclude
-    Wait Until Keyword Succeeds    40s    5s    Check Controller Status    odc_test    down
+    Wait Until Keyword Succeeds    12s    2s   Check Controller Status    odc_test    down
 
 Create VBRIF in VBRIDGE Vbridge1 Interface1
     [Documentation]    Create an interface to Vbridge1
@@ -49,10 +50,15 @@ Update controller ip valid
     [Tags]    exclude
     Update Controller    odc_test    ${CONTROLLER}    valid_IP
 
-Verify the Controller State is up
+Verify the Controller State is in waiting_audit
     [Documentation]    Check Controller status
     [Tags]    exclude
-    Wait Until Keyword Succeeds    32s    2s    Check Controller Status    odc_test    up
+    Wait Until Keyword Succeeds    12s    2s   Check Controller Status    odc_test    waiting_audit
+
+Audit a controller manually
+    [Documentation]    Trigger update audit
+    [Tags]    exclude
+    Audit Controller    odc_test
 
 Define Portmap for Interface1
     [Documentation]    Map Interface1 to a logical port
@@ -67,11 +73,10 @@ Define Portmap for Interface2
 Test Ping for Configuration1
     [Documentation]    ping between hosts in mininet
     [Tags]    exclude
-    Wait Until Keyword Succeeds    30s    10s    Test Ping    h1    h2
+    Wait Until Keyword Succeeds    10s    2s    Test Ping    h1    h2
 
 Delete a VTN Tenant1
     [Documentation]    Delete Vtn Tenant1
-    [Tags]    exclude
     Delete a VTN    Tenant1
 
 Delete a Controller odc1