GIT restructure - Adding project folders and features
authorLuis Gomez <ecelgp@gmail.com>
Sun, 30 Nov 2014 06:04:54 +0000 (22:04 -0800)
committerLuis Gomez <ecelgp@gmail.com>
Sun, 30 Nov 2014 06:16:29 +0000 (22:16 -0800)
Change-Id: I71a881ba17efc63ec15e5e48d8ffda46165db9d2
Signed-off-by: Luis Gomez <ecelgp@gmail.com>
120 files changed:
test/csit/libraries/Utils.txt
test/csit/suites/aaa/AAA/010_Credential_Authentication.txt [new file with mode: 0644]
test/csit/suites/aaa/AAA/020_Identity_Management.txt [new file with mode: 0644]
test/csit/suites/controller/AD_SAL_Apps_OF10/010__host_tracker.txt [new file with mode: 0644]
test/csit/suites/controller/AD_SAL_Apps_OF10/020__static_route.txt [new file with mode: 0644]
test/csit/suites/controller/AD_SAL_Apps_OF10/030__subnet_gateway.txt [new file with mode: 0644]
test/csit/suites/controller/AD_SAL_Apps_OF10/__init__.txt [new file with mode: 0644]
test/csit/suites/controller/AD_SAL_Apps_OF13/010__host_tracker.txt [new file with mode: 0644]
test/csit/suites/controller/AD_SAL_Apps_OF13/020__static_route.txt [new file with mode: 0644]
test/csit/suites/controller/AD_SAL_Apps_OF13/030__subnet_gateway.txt [new file with mode: 0644]
test/csit/suites/controller/AD_SAL_Apps_OF13/__init__.txt [new file with mode: 0644]
test/csit/suites/controller/AD_SAL_NSF_OF10/010__switch_manager.txt [new file with mode: 0644]
test/csit/suites/controller/AD_SAL_NSF_OF10/020__topology_manager.txt [new file with mode: 0644]
test/csit/suites/controller/AD_SAL_NSF_OF10/030__statistics_manager.txt [new file with mode: 0644]
test/csit/suites/controller/AD_SAL_NSF_OF10/040__flow_programmer.txt [new file with mode: 0644]
test/csit/suites/controller/AD_SAL_NSF_OF10/__init__.txt [new file with mode: 0644]
test/csit/suites/controller/AD_SAL_NSF_OF13/010__switch_manager.txt [new file with mode: 0644]
test/csit/suites/controller/AD_SAL_NSF_OF13/020__topology_manager.txt [new file with mode: 0644]
test/csit/suites/controller/AD_SAL_NSF_OF13/030__statistics_manager.txt [new file with mode: 0644]
test/csit/suites/controller/AD_SAL_NSF_OF13/040__flow_programmer.txt [new file with mode: 0644]
test/csit/suites/controller/AD_SAL_NSF_OF13/__init__.txt [new file with mode: 0644]
test/csit/suites/controller/Inventory_Scalability_OF10/010__restconf_inventory.txt [new file with mode: 0644]
test/csit/suites/controller/Inventory_Scalability_OF10/020__restconf_topology.txt [new file with mode: 0644]
test/csit/suites/controller/Inventory_Scalability_OF10/030__switch_manager.txt [new file with mode: 0644]
test/csit/suites/controller/Inventory_Scalability_OF10/040__statistics_manager.txt [new file with mode: 0644]
test/csit/suites/controller/Inventory_Scalability_OF10/050__topology_manager.txt [new file with mode: 0644]
test/csit/suites/controller/Inventory_Scalability_OF10/__init__.txt [new file with mode: 0644]
test/csit/suites/controller/Inventory_Scalability_OF13/010__restconf_inventory.txt [new file with mode: 0644]
test/csit/suites/controller/Inventory_Scalability_OF13/020__restconf_topology.txt [new file with mode: 0644]
test/csit/suites/controller/Inventory_Scalability_OF13/030__switch_manager.txt [new file with mode: 0644]
test/csit/suites/controller/Inventory_Scalability_OF13/040__statistics_manager.txt [new file with mode: 0644]
test/csit/suites/controller/Inventory_Scalability_OF13/050__topology_manager.txt [new file with mode: 0644]
test/csit/suites/controller/Inventory_Scalability_OF13/__init__.txt [new file with mode: 0644]
test/csit/suites/controller/MD_SAL_Cluster_Datastore/001_start_cluster.txt [new file with mode: 0644]
test/csit/suites/controller/MD_SAL_Cluster_Datastore/010_crud_on_leader.txt [new file with mode: 0644]
test/csit/suites/controller/MD_SAL_Cluster_Datastore/020_crud_on_any_follower.txt [new file with mode: 0644]
test/csit/suites/controller/MD_SAL_Cluster_Datastore/030_failover_crud_on_new_leader.txt [new file with mode: 0644]
test/csit/suites/controller/MD_SAL_Cluster_Datastore/040_failover_read_from_follower.txt [new file with mode: 0644]
test/csit/suites/controller/MD_SAL_Cluster_Datastore/050_failover_crud_on_any_follower.txt [new file with mode: 0644]
test/csit/suites/controller/MD_SAL_Cluster_Datastore/060_failover_read_from_new_leader.txt [new file with mode: 0644]
test/csit/suites/controller/MD_SAL_Cluster_Datastore/130_recovery_restart_leader.txt [new file with mode: 0644]
test/csit/suites/controller/MD_SAL_Cluster_Datastore/140_recovery_restart_follower.txt [new file with mode: 0644]
test/csit/suites/controller/MD_SAL_Cluster_Datastore/__init__.txt [new file with mode: 0644]
test/csit/suites/controller/MD_SAL_Cluster_Longevity/010__longevity.txt [new file with mode: 0644]
test/csit/suites/controller/MD_SAL_Cluster_Longevity/__init__.txt [new file with mode: 0644]
test/csit/suites/controller/MD_SAL_Cluster_Routed_RPC/001_start_cluster.txt [new file with mode: 0644]
test/csit/suites/controller/MD_SAL_Cluster_Routed_RPC/023_routed_rpc_crud_test.txt [new file with mode: 0644]
test/csit/suites/controller/MD_SAL_Cluster_Routed_RPC/024_routed_rpc_crud_test.txt [new file with mode: 0644]
test/csit/suites/controller/MD_SAL_NSF_OF10/010__restconf_inventory.txt [new file with mode: 0644]
test/csit/suites/controller/MD_SAL_NSF_OF10/020__restconf_topology.txt [new file with mode: 0644]
test/csit/suites/controller/MD_SAL_NSF_OF10/030__restconf_statistics.txt [new file with mode: 0644]
test/csit/suites/controller/MD_SAL_NSF_OF10/040__restconf_frm.txt [new file with mode: 0644]
test/csit/suites/controller/MD_SAL_NSF_OF10/__init__.txt [new file with mode: 0644]
test/csit/suites/controller/MD_SAL_NSF_OF13/010__restconf_inventory.txt [new file with mode: 0644]
test/csit/suites/controller/MD_SAL_NSF_OF13/020__restconf_topology.txt [new file with mode: 0644]
test/csit/suites/controller/MD_SAL_NSF_OF13/030__restconf_statistics.txt [new file with mode: 0644]
test/csit/suites/controller/MD_SAL_NSF_OF13/040__restconf_frm.txt [new file with mode: 0644]
test/csit/suites/controller/MD_SAL_NSF_OF13/__init__.txt [new file with mode: 0644]
test/csit/suites/controller/NETCONF/010__netconf_inventory.txt [new file with mode: 0644]
test/csit/suites/l2switch/Address_Tracking_OF13/010__restconf_inv_addresses.txt [new file with mode: 0644]
test/csit/suites/l2switch/Address_Tracking_OF13/__init__.txt [new file with mode: 0644]
test/csit/suites/l2switch/Flow_Programming_OF13/010__restconf_inv_flows.txt [new file with mode: 0644]
test/csit/suites/l2switch/Flow_Programming_OF13/__init__.txt [new file with mode: 0644]
test/csit/suites/l2switch/Host_Tracking_OF13/010__restconf_topo_nodes.txt [new file with mode: 0644]
test/csit/suites/l2switch/Host_Tracking_OF13/__init__.txt [new file with mode: 0644]
test/csit/suites/l2switch/Inventory_Scalability_OF13/010__restconf_inventory.txt [new file with mode: 0644]
test/csit/suites/l2switch/Inventory_Scalability_OF13/020__restconf_topology.txt [new file with mode: 0644]
test/csit/suites/l2switch/Inventory_Scalability_OF13/030__ping_test.txt [new file with mode: 0644]
test/csit/suites/l2switch/Inventory_Scalability_OF13/__init__.txt [new file with mode: 0644]
test/csit/suites/l2switch/Loop_Removal_OF13/010__loop_of_3.txt [new file with mode: 0644]
test/csit/suites/l2switch/Loop_Removal_OF13/020__ping.txt [new file with mode: 0644]
test/csit/suites/l2switch/Loop_Removal_OF13/__init__.txt [new file with mode: 0644]
test/csit/suites/l2switch/topologies/customtopo.py [new file with mode: 0755]
test/csit/suites/openflowplugin/Flows_OF13/300__dst_ip.txt [new file with mode: 0644]
test/csit/suites/openflowplugin/Flows_OF13/301__src_ip.txt [new file with mode: 0644]
test/csit/suites/openflowplugin/Flows_OF13/302__dst_mac.txt [new file with mode: 0644]
test/csit/suites/openflowplugin/Flows_OF13/304__eth_ip_port.txt [new file with mode: 0644]
test/csit/suites/openflowplugin/Flows_OF13/305__ttl.txt [new file with mode: 0644]
test/csit/suites/openflowplugin/Flows_OF13/306__eth_ip_qos.txt [new file with mode: 0644]
test/csit/suites/openflowplugin/Flows_OF13/307__eth_ip_qos_port_tcpport.txt [new file with mode: 0644]
test/csit/suites/openflowplugin/Flows_OF13/308__eth_ip_qos_port_tcpport_mpls.txt [new file with mode: 0644]
test/csit/suites/openflowplugin/Flows_OF13/309__eth_ip_qos_sctp.txt [new file with mode: 0644]
test/csit/suites/openflowplugin/Flows_OF13/310__eth_ip_qos_icmp.txt [new file with mode: 0644]
test/csit/suites/openflowplugin/Flows_OF13/311__eth_arp.txt [new file with mode: 0644]
test/csit/suites/openflowplugin/Flows_OF13/312__eth_arp_transport.txt [new file with mode: 0644]
test/csit/suites/openflowplugin/Flows_OF13/313__eth_arp_transport_hardware.txt [new file with mode: 0644]
test/csit/suites/openflowplugin/Flows_OF13/314__eth_vlan.txt [new file with mode: 0644]
test/csit/suites/openflowplugin/Flows_OF13/315__timeout_vlan_pcp_vlan.txt [new file with mode: 0644]
test/csit/suites/openflowplugin/Flows_OF13/316__eth_mpls_tc_bos.txt [new file with mode: 0644]
test/csit/suites/openflowplugin/Flows_OF13/317__eth_ipv6.txt [new file with mode: 0644]
test/csit/suites/openflowplugin/Flows_OF13/318__metadata.txt [new file with mode: 0644]
test/csit/suites/openflowplugin/Flows_OF13/319__metadata_mask.txt [new file with mode: 0644]
test/csit/suites/openflowplugin/Flows_OF13/320__ipv6_meta_qos_udp.txt [new file with mode: 0644]
test/csit/suites/openflowplugin/Flows_OF13/321__ipv6_meta_qos_tcp.txt [new file with mode: 0644]
test/csit/suites/openflowplugin/Flows_OF13/322__ipv6_flow.txt [new file with mode: 0644]
test/csit/suites/openflowplugin/Flows_OF13/323__tunnel.txt [new file with mode: 0644]
test/csit/suites/openflowplugin/Flows_OF13/324__ipv6_flow_label.txt [new file with mode: 0644]
test/csit/suites/openflowplugin/Flows_OF13/__init__.txt [new file with mode: 0644]
test/csit/suites/openflowplugin/Flows_Stats_OF13/010__SM_add_upd_del_flows.txt [new file with mode: 0644]
test/csit/suites/openflowplugin/Flows_Stats_OF13/__init__.txt [new file with mode: 0644]
test/csit/suites/openflowplugin/Switch_Qualification/010_OpenFlow_Connection.txt [new file with mode: 0644]
test/csit/suites/openflowplugin/Switch_Qualification/020_OpenFlow_Actions.txt [new file with mode: 0644]
test/csit/suites/ovsdb/Bridge_Domain_OF10/010__bridge_domain.txt [new file with mode: 0644]
test/csit/suites/ovsdb/Bridge_Domain_OF10/__init__.txt [new file with mode: 0644]
test/csit/suites/ovsdb/Bridge_Domain_OF13/010__bridge_domain.txt [new file with mode: 0644]
test/csit/suites/ovsdb/Bridge_Domain_OF13/__init__.txt [new file with mode: 0644]
test/csit/suites/ovsdb/OpenStack/010__networks.txt [new file with mode: 0644]
test/csit/suites/ovsdb/OpenStack/020__subnets.txt [new file with mode: 0644]
test/csit/suites/ovsdb/OpenStack/030__ports.txt [new file with mode: 0644]
test/csit/suites/ovsdb/OpenStack/__init__.txt [new file with mode: 0644]
test/csit/suites/vtn/VTN_OF10/010__vtn_manager.txt [new file with mode: 0644]
test/csit/suites/vtn/VTN_OF10/020__vtn_coordinator.txt [new file with mode: 0644]
test/csit/suites/vtn/VTN_OF10/030__vtn_coordinator.txt [new file with mode: 0644]
test/csit/suites/vtn/VTN_OF10/040__vtn_coordinator.txt [new file with mode: 0644]
test/csit/suites/vtn/VTN_OF10/__init__.txt [new file with mode: 0644]
test/csit/suites/vtn/VTN_OF13/010__vtn_manager.txt [new file with mode: 0644]
test/csit/suites/vtn/VTN_OF13/020__vtn_coordinator.txt [new file with mode: 0644]
test/csit/suites/vtn/VTN_OF13/030__vtn_coordinator.txt [new file with mode: 0644]
test/csit/suites/vtn/VTN_OF13/040__vtn_coordinator.txt [new file with mode: 0644]
test/csit/suites/vtn/VTN_OF13/__init__.txt [new file with mode: 0644]

index 7bc26cadb8f75dcda5c4a6555fbb2329eb729455..6d711a2598277eb24f61b1d082d9bd77fd0c39b4 100644 (file)
@@ -13,6 +13,7 @@ Start Suite
     Open Connection    ${MININET}    prompt=>    timeout=30s
     Login With Public Key    ${MININET_USER}    ${USER_HOME}/.ssh/id_rsa    any
     Write    sudo ovs-vsctl set-manager ptcp:6644
+    Read Until    >
     Write    sudo mn -c
     Read Until    >
     Write    ${start}
diff --git a/test/csit/suites/aaa/AAA/010_Credential_Authentication.txt b/test/csit/suites/aaa/AAA/010_Credential_Authentication.txt
new file mode 100644 (file)
index 0000000..dadfed0
--- /dev/null
@@ -0,0 +1,83 @@
+*** Settings ***
+Documentation     AAA System Tests
+Suite Setup       Credential Authentication Suite Setup
+Suite Teardown    Credential Authentication Suite Teardown
+Library           Collections
+Library           OperatingSystem
+Library           String
+Library           HttpLibrary.HTTP
+Library           ../../../libraries/RequestsLibrary.py
+Library           ../../../libraries/Common.py
+Resource          ../../../libraries/Utils.txt
+Variables         ../../../variables/Variables.py
+Resource          ../../../libraries/AAAKeywords.txt
+
+*** Variables ***
+
+*** Test Cases ***
+Get Token With Valid Username And Password
+    [Documentation]    Sanity test to ensure default user/password can get a token
+    ${auth_token}=    Get Auth Token
+    Should Be String    ${auth_token}
+    Log    Token: ${auth_token}
+    Validate Token Format    ${auth_token}
+
+Fail To Get Token With Invalid Username And Password
+    [Documentation]    Negative test to verify invalid user/password is denied a token
+    ${bad_user}=    Set Variable    notTheAdmin
+    ${auth_data}=    Create Auth Data    ${bad_user}    notTheAdminPassword
+    ${resp}=    AAA Login    ${CONTROLLER}    ${auth_data}
+    Should Be Equal As Strings    ${resp.status_code}    401
+    Log    ${resp.content}
+    ${error_msg}=    Extract Value From Content    ${resp.content}    /error    strip
+    Should Be Equal As Strings    ${error_msg}    User :${bad_user} does not exist
+
+Create Token with Client Authorization
+    [Documentation]    Get a token using client domain
+    ${auth_token}=    Get Auth Token    ${USER}    ${PWD}    ${SCOPE}    dlux    secrete
+    Should Be String    ${auth_token}
+    Log    Token: ${auth_token}
+    Validate Token Format    ${auth_token}
+
+Token Authentication In REST Request
+    [Documentation]    Use a token to make a successful REST transaction
+    ${auth_token}=    Get Auth Token
+    Make REST Transaction    200    ${auth_token}
+
+Revoke Token And Verify Transaction Fails
+    [Documentation]    negative test to revoke valid token and check that REST transaction fails
+    ${auth_token}=    Get Auth Token
+    Make REST Transaction    200    ${auth_token}
+    Revoke Auth Token    ${auth_token}
+    Make REST Transaction    401    ${auth_token}
+
+Disable Authentication And Re-Enable Authentication
+    [Documentation]    Toggles authentication off and verifies that no login credentials are needed for REST transactions
+    Disable Authentication On Controller    ${CONTROLLER}
+    Wait Until Keyword Succeeds    10s    1s    Make REST Transaction    200
+    Enable Authentication On Controller    ${CONTROLLER}
+    Wait Until Keyword Succeeds    10s    1s    Validate That Authentication Fails With Wrong Token
+    ${auth_token}=    Get Auth Token
+    Make REST Transaction    200    ${auth_token}
+
+*** Keywords ***
+Validate That Authentication Fails With Wrong Token
+    ${bad_token}=    Set Variable    notARealToken
+    Make REST Transaction    401    ${bad_token}
+
+Make REST Transaction
+    [Arguments]    ${expected_status_code}    ${auth_data}=${EMPTY}
+    Create Session    ODL_SESSION    http://${CONTROLLER}:8181
+    ${headers}=    Create Dictionary    Content-Type    application/x-www-form-urlencoded
+    Run Keyword If    "${auth_data}" != "${EMPTY}"    Set To Dictionary    ${headers}    Authorization    Bearer ${auth_data}
+    ${resp}=    RequestsLibrary.GET    ODL_SESSION    ${OPERATIONAL_NODES_API}    headers=${headers}
+    Log    STATUS_CODE: ${resp.status_code} CONTENT: ${resp.content}
+    Should Be Equal As Strings    ${resp.status_code}    ${expected_status_code}
+    Should Contain    ${resp.content}    nodes
+
+Credential Authentication Suite Setup
+    Log    Suite Setup
+
+Credential Authentication Suite Teardown
+    Log    Suite Teardown
+    Delete All Sessions
diff --git a/test/csit/suites/aaa/AAA/020_Identity_Management.txt b/test/csit/suites/aaa/AAA/020_Identity_Management.txt
new file mode 100644 (file)
index 0000000..c2557b0
--- /dev/null
@@ -0,0 +1,16 @@
+*** Settings ***
+Documentation     tmp
+Suite Setup       Identity Management Suite Setup
+Suite Teardown    Identity Management Suite Teardown
+Library           Collections
+Library           OperatingSystem
+Library           String
+Library           ../../../libraries/RequestsLibrary.py
+Library           ../../../libraries/Common.py
+Variables         ../../../variables/Variables.py
+
+*** Variables ***
+
+*** Test Cases ***
+
+*** Keywords ***
diff --git a/test/csit/suites/controller/AD_SAL_Apps_OF10/010__host_tracker.txt b/test/csit/suites/controller/AD_SAL_Apps_OF10/010__host_tracker.txt
new file mode 100644 (file)
index 0000000..03facee
--- /dev/null
@@ -0,0 +1,62 @@
+*** Settings ***
+Documentation     Test suite for Host Tracker
+Suite Setup       Create Session    session    http://${CONTROLLER}:${RESTPORT}    auth=${AUTH}    headers=${HEADERS}
+Suite Teardown    Delete All Sessions
+Library           Collections
+Library           ../../../libraries/RequestsLibrary.py
+Library           ../../../libraries/Common.py
+Variables         ../../../variables/Variables.py
+
+*** Variables ***
+${name}           10.0.1.4
+${key}            hostConfig
+${REST_CONTEXT}    /controller/nb/v2/hosttracker
+${REST_CONTEXT_ST}    /controller/nb/v2/statistics
+${FLOW}           "10.0.1.4"
+
+*** Test Cases ***
+Add a host
+    [Documentation]    Add a host, list to validate the result.
+    [Tags]    apps
+    ${body}    Create Dictionary    nodeType    OF    dataLayerAddress    5e:bf:79:84:10:a6    vlan
+    ...    1    nodeId    00:00:00:00:00:00:00:03    nodeConnectorId    2    networkAddress
+    ...    10.0.1.4    staticHost    ${True}    nodeConnectorType    OF
+    ${resp}    RequestsLibrary.Put    session    ${REST_CONTEXT}/${CONTAINER}/address/${name}    data=${body}
+    Should Be Equal As Strings    ${resp.status_code}    201
+    ${resp}    RequestsLibrary.Get    session    ${REST_CONTEXT}/${CONTAINER}/hosts/active
+    Should Be Equal As Strings    ${resp.status_code}    200
+    ${result}    To JSON    ${resp.content}
+    ${content}    Get From Dictionary    ${result}    ${key}
+    List Should Contain Value    ${content}    ${body}
+
+Check flow in flow stats
+    [Documentation]    Show flow stats and validate result
+    [Tags]    apps
+    Sleep    30
+    ${resp}    RequestsLibrary.Get    session    ${REST_CONTEXT_ST}/${CONTAINER}/flow
+    Should Be Equal As Strings    ${resp.status_code}    200
+    Log    ${resp.content}
+    Should Contain X Times    ${resp.content}    ${FLOW}    3
+
+Remove a host
+    [Documentation]    Remove a host, list to validate the result.
+    [Tags]    apps
+    ${body}    Create Dictionary    nodeType    OF    dataLayerAddress    5e:bf:79:84:10:a6    vlan
+    ...    1    nodeId    00:00:00:00:00:00:00:03    nodeConnectorId    2    networkAddress
+    ...    10.0.1.4    staticHost    ${True}    nodeConnectorType    OF
+    ${resp}    RequestsLibrary.Delete    session    ${REST_CONTEXT}/${CONTAINER}/address/${name}
+    Should Be Equal As Strings    ${resp.status_code}    204
+    ${resp}    RequestsLibrary.Get    session    ${REST_CONTEXT}/${CONTAINER}/hosts/inactive
+    Should Be Equal As Strings    ${resp.status_code}    200
+    ${result}    To JSON    ${resp.content}
+    ${content}    Get From Dictionary    ${result}    ${key}
+    List Should Not Contain Value    ${content}    ${body}
+
+Check flow is not in flow stats
+    [Documentation]    Show flow stats and validate result
+    [Tags]    apps
+    Sleep    30
+    ${resp}    RequestsLibrary.Get    session    ${REST_CONTEXT_ST}/${CONTAINER}/flow
+    Should Be Equal As Strings    ${resp.status_code}    200
+    Log    ${resp.content}
+    Should Not Contain    ${resp.content}    ${FLOW}
diff --git a/test/csit/suites/controller/AD_SAL_Apps_OF10/020__static_route.txt b/test/csit/suites/controller/AD_SAL_Apps_OF10/020__static_route.txt
new file mode 100644 (file)
index 0000000..86b20c5
--- /dev/null
@@ -0,0 +1,51 @@
+*** Settings ***
+Documentation     Test suite for Static Route
+Suite Setup       Create Session    session    http://${CONTROLLER}:${RESTPORT}    auth=${AUTH}    headers=${HEADERS}
+Suite Teardown    Delete All Sessions
+Library           SSHLibrary
+Library           Collections
+Library           ../../../libraries/RequestsLibrary.py
+Library           ../../../libraries/Common.py
+Variables         ../../../variables/Variables.py
+
+*** Variables ***
+${name}           test_route1
+${key}            staticRoute
+${REST_CONTEXT}    /controller/nb/v2/staticroute
+${REST_CONTEXT_HT}    /controller/nb/v2/hosttracker
+
+*** Test Cases ***
+Add a static route
+    [Documentation]    Add a static route, list to validate the result.
+    [Tags]    apps
+    ${body}    Create Dictionary    name    ${name}    prefix    192.168.1.0/24    nextHop
+    ...    10.0.0.2
+    ${resp}    RequestsLibrary.Put    session    ${REST_CONTEXT}/${CONTAINER}/route/${name}    data=${body}
+    Should Be Equal As Strings    ${resp.status_code}    201
+    ${resp}    RequestsLibrary.Get    session    ${REST_CONTEXT}/${CONTAINER}/routes
+    Should Be Equal As Strings    ${resp.status_code}    200    Response status code error
+    ${result}    To JSON    ${resp.content}
+    ${content}    Get From Dictionary    ${result}    ${key}
+    List Should Contain Value    ${content}    ${body}
+    Sleep    30
+    #    This works locally but NOT in OpenDaylight
+    #Check flow in flow stats
+    #    [Documentation]    Show flow stats and validate result
+    #    [Tags]    apps
+    #    ${resp}    Get    session    ${REST_CONTEXT_ST}/${CONTAINER}/flow
+    #    Should Be Equal As Strings    ${resp.status_code}    200
+    #    Log    ${resp.content}
+    #    Should Contain X Times    ${resp.content}    10.0.0.2    3
+
+Remove a static route
+    [Documentation]    Remove a static route, list to validate the result.
+    [Tags]    apps
+    ${body}    Create Dictionary    name    ${name}    prefix    192.168.1.0/24    nextHop
+    ...    10.0.0.2
+    ${resp}    RequestsLibrary.Delete    session    ${REST_CONTEXT}/${CONTAINER}/route/${name}
+    Should Be Equal As Strings    ${resp.status_code}    204
+    ${resp}    RequestsLibrary.Get    session    ${REST_CONTEXT}/${CONTAINER}/routes
+    Should Be Equal As Strings    ${resp.status_code}    200
+    ${result}    To JSON    ${resp.content}
+    ${content}    Get From Dictionary    ${result}    ${key}
+    List Should Not Contain Value    ${content}    ${body}
diff --git a/test/csit/suites/controller/AD_SAL_Apps_OF10/030__subnet_gateway.txt b/test/csit/suites/controller/AD_SAL_Apps_OF10/030__subnet_gateway.txt
new file mode 100644 (file)
index 0000000..eb30a86
--- /dev/null
@@ -0,0 +1,68 @@
+*** Settings ***
+Documentation     Test suite for Subnet Gateway
+Suite Setup       Create Session    session    http://${CONTROLLER}:${RESTPORT}    auth=${AUTH}    headers=${HEADERS}
+Suite Teardown    Delete All Sessions
+Library           SSHLibrary
+Library           Collections
+Library           ../../../libraries/RequestsLibrary.py
+Library           ../../../libraries/Common.py
+Variables         ../../../variables/Variables.py
+
+*** Variables ***
+${name}           test
+${key}            subnetConfig
+${REST_CONTEXT}    /controller/nb/v2/subnetservice
+${REST_CONTEXT_HT}    /controller/nb/v2/hosttracker
+
+*** Test Cases ***
+List Subnets
+    [Documentation]    List subnets and verify default is there
+    [Tags]    apps
+    ${resp}    RequestsLibrary.Get    session    ${REST_CONTEXT}/${CONTAINER}/subnets
+    Should Be Equal As Strings    ${resp.status_code}    200
+    ${result}    To JSON    ${resp.content}
+    ${subnet}    Get From Dictionary    ${result}    ${key}
+    ${content}    Get From List    ${subnet}    0
+    Dictionary Should Contain Value    ${content}    0.0.0.0/0
+
+Ping h1 to h4
+    [Documentation]    Ping h1 to h4, verify no packet loss
+    [Tags]    apps
+    Write    h1 ping -w 6 h4
+    Sleep    6
+    Write    h4 ping -w 6 h1
+    Sleep    6
+    ${result}    Read
+    Should Contain    ${result}    64 bytes
+
+List hosts
+    [Documentation]    List hosts and verify h1 and h4
+    [Tags]    apps
+    ${resp}    RequestsLibrary.Get    session    ${REST_CONTEXT_HT}/${CONTAINER}/hosts/active
+    Should Be Equal As Strings    ${resp.status_code}    200
+    Should Contain    ${resp.content}    10.0.0.1
+    Should Contain    ${resp.content}    10.0.0.4
+
+Add a subnet
+    [Documentation]    Add a subnet, list to validate the result.
+    [Tags]    apps
+    ${body}    Create Dictionary    name    ${name}    subnet    11.0.0.254/8
+    ${resp}    RequestsLibrary.Put    session    ${REST_CONTEXT}/${CONTAINER}/subnet/${name}    data=${body}
+    Should Be Equal As Strings    ${resp.status_code}    201
+    ${resp}    RequestsLibrary.Get    session    ${REST_CONTEXT}/${CONTAINER}/subnets
+    Should Be Equal As Strings    ${resp.status_code}    200
+    ${result}    To JSON    ${resp.content}
+    ${content}    Get From Dictionary    ${result}    ${key}
+    List Should Contain Value    ${content}    ${body}
+
+Remove a subnet
+    [Documentation]    Remove a subnet, list to validate the result.
+    [Tags]    apps
+    ${body}    Create Dictionary    name    ${name}    subnet    11.0.0.254/8
+    ${resp}    RequestsLibrary.Delete    session    ${REST_CONTEXT}/${CONTAINER}/subnet/${name}
+    Should Be Equal As Strings    ${resp.status_code}    204
+    ${resp}    RequestsLibrary.Get    session    ${REST_CONTEXT}/${CONTAINER}/subnets
+    Should Be Equal As Strings    ${resp.status_code}    200
+    ${result}    To JSON    ${resp.content}
+    ${content}    Get From Dictionary    ${result}    ${key}
+    List Should Not Contain Value    ${content}    ${body}
diff --git a/test/csit/suites/controller/AD_SAL_Apps_OF10/__init__.txt b/test/csit/suites/controller/AD_SAL_Apps_OF10/__init__.txt
new file mode 100644 (file)
index 0000000..17abe56
--- /dev/null
@@ -0,0 +1,11 @@
+*** Settings ***
+Documentation     Test suite for AD-SAL Applications 
+Suite Setup       Start Suite
+Suite Teardown    Stop Suite
+Library     SSHLibrary
+Resource          ../../../libraries/Utils.txt
+
+*** Variables ***
+${start}=   sudo mn --controller=remote,ip=${CONTROLLER} --topo tree,2 
+
+** Keywords ***
diff --git a/test/csit/suites/controller/AD_SAL_Apps_OF13/010__host_tracker.txt b/test/csit/suites/controller/AD_SAL_Apps_OF13/010__host_tracker.txt
new file mode 100644 (file)
index 0000000..a7f92c5
--- /dev/null
@@ -0,0 +1,60 @@
+*** Settings ***
+Documentation     Test suite for Host Tracker
+Suite Setup       Create Session   session   http://${CONTROLLER}:${RESTPORT}   auth=${AUTH}   headers=${HEADERS}
+Suite Teardown    Delete All Sessions
+Library           Collections
+Library           ../../../libraries/RequestsLibrary.py
+Library           ../../../libraries/Common.py
+Variables         ../../../variables/Variables.py
+
+*** Variables ***
+${name}           10.0.1.4
+${key}            hostConfig
+${REST_CONTEXT}    /controller/nb/v2/hosttracker
+${REST_CONTEXT_ST}    /controller/nb/v2/statistics
+${FLOW}           "10.0.1.4"
+
+*** Test Cases ***
+Add a host
+    [Documentation]    Add a host, list to validate the result.
+    [Tags]    apps
+    ${body}    Create Dictionary    nodeType    OF    dataLayerAddress    5e:bf:79:84:10:a6    vlan
+    ...    1    nodeId    00:00:00:00:00:00:00:03    nodeConnectorId    2    networkAddress
+    ...    10.0.1.4    staticHost    ${True}    nodeConnectorType    OF
+    ${resp}    Put    session    ${REST_CONTEXT}/${CONTAINER}/address/${name}    data=${body}
+    Should Be Equal As Strings    ${resp.status_code}    201
+    ${resp}    Get    session    ${REST_CONTEXT}/${CONTAINER}/hosts/active
+    Should Be Equal As Strings    ${resp.status_code}    200 
+    ${result}    To JSON    ${resp.content}
+    ${content}    Get From Dictionary    ${result}    ${key}
+    List Should Contain Value    ${content}    ${body} 
+Check flow in flow stats
+    [Documentation]    Show flow stats and validate result
+    [Tags]   apps
+    Sleep   30
+    ${resp}    Get    session    ${REST_CONTEXT_ST}/${CONTAINER}/flow
+    Should Be Equal As Strings    ${resp.status_code}    200 
+    Log    ${resp.content}
+    Should Contain X Times   ${resp.content}    ${FLOW}   3
+Remove a host
+    [Documentation]    Remove a host, list to validate the result.
+    [Tags]    apps
+    ${body}    Create Dictionary    nodeType    OF    dataLayerAddress    5e:bf:79:84:10:a6    vlan
+    ...    1    nodeId    00:00:00:00:00:00:00:03    nodeConnectorId    2    networkAddress
+    ...    10.0.1.4    staticHost    ${True}    nodeConnectorType    OF
+    ${resp}    Delete    session    ${REST_CONTEXT}/${CONTAINER}/address/${name}
+    Should Be Equal As Strings    ${resp.status_code}    204
+    ${resp}    Get    session    ${REST_CONTEXT}/${CONTAINER}/hosts/inactive
+    Should Be Equal As Strings    ${resp.status_code}    200
+    ${result}    To JSON    ${resp.content}
+    ${content}    Get From Dictionary    ${result}    ${key}
+    List Should Not Contain Value    ${content}    ${body}
+Check flow is not in flow stats
+    [Documentation]    Show flow stats and validate result
+    [Tags]    apps
+    Sleep    30
+    ${resp}    Get    session    ${REST_CONTEXT_ST}/${CONTAINER}/flow
+    Should Be Equal As Strings    ${resp.status_code}    200 
+    Log    ${resp.content}
+    Should Not Contain    ${resp.content}    ${FLOW}
+
diff --git a/test/csit/suites/controller/AD_SAL_Apps_OF13/020__static_route.txt b/test/csit/suites/controller/AD_SAL_Apps_OF13/020__static_route.txt
new file mode 100644 (file)
index 0000000..48851c8
--- /dev/null
@@ -0,0 +1,51 @@
+*** Settings ***
+Documentation     Test suite for Static Route
+Suite Setup       Create Session   session   http://${CONTROLLER}:${RESTPORT}   auth=${AUTH}   headers=${HEADERS}
+Suite Teardown    Delete All Sessions
+Library           SSHLibrary
+Library           Collections
+Library           ../../../libraries/RequestsLibrary.py
+Library           ../../../libraries/Common.py
+Variables         ../../../variables/Variables.py
+
+*** Variables ***
+${name}           test_route1
+${key}            staticRoute
+${REST_CONTEXT}    /controller/nb/v2/staticroute
+${REST_CONTEXT_HT}   /controller/nb/v2/hosttracker
+
+*** Test Cases ***
+Add a static route
+    [Documentation]    Add a static route, list to validate the result.
+    [Tags]    apps
+    ${body}    Create Dictionary    name    ${name}    prefix    192.168.1.0/24    nextHop
+    ...    10.0.0.2
+    ${resp}    Put    session    ${REST_CONTEXT}/${CONTAINER}/route/${name}    data=${body}
+    Should Be Equal As Strings    ${resp.status_code}    201
+    ${resp}    Get    session    ${REST_CONTEXT}/${CONTAINER}/routes
+    Should Be Equal As Strings    ${resp.status_code}    200    Response status code error
+    ${result}    To JSON    ${resp.content}
+    ${content}    Get From Dictionary    ${result}    ${key}
+    List Should Contain Value    ${content}    ${body}
+    Sleep    30
+#     This works locally but NOT in OpenDaylight
+#Check flow in flow stats
+#    [Documentation]    Show flow stats and validate result
+#    [Tags]    apps
+#    ${resp}    Get    session    ${REST_CONTEXT_ST}/${CONTAINER}/flow
+#    Should Be Equal As Strings    ${resp.status_code}    200 
+#    Log    ${resp.content}
+#    Should Contain X Times    ${resp.content}    10.0.0.2     3
+Remove a static route
+    [Documentation]    Remove a static route, list to validate the result.
+    [Tags]    apps
+    ${body}    Create Dictionary    name    ${name}    prefix    192.168.1.0/24    nextHop
+    ...    10.0.0.2
+    ${resp}    Delete    session    ${REST_CONTEXT}/${CONTAINER}/route/${name}
+    Should Be Equal As Strings    ${resp.status_code}    204
+    ${resp}    Get    session    ${REST_CONTEXT}/${CONTAINER}/routes
+    Should Be Equal As Strings    ${resp.status_code}    200
+    ${result}    To JSON    ${resp.content}
+    ${content}    Get From Dictionary    ${result}    ${key}
+    List Should Not Contain Value    ${content}    ${body}
+
diff --git a/test/csit/suites/controller/AD_SAL_Apps_OF13/030__subnet_gateway.txt b/test/csit/suites/controller/AD_SAL_Apps_OF13/030__subnet_gateway.txt
new file mode 100644 (file)
index 0000000..31c2d05
--- /dev/null
@@ -0,0 +1,65 @@
+*** Settings ***
+Documentation     Test suite for Subnet Gateway
+Suite Setup       Create Session   session   http://${CONTROLLER}:${RESTPORT}   auth=${AUTH}   headers=${HEADERS}
+Suite Teardown    Delete All Sessions
+Library           SSHLibrary
+Library           Collections
+Library           ../../../libraries/RequestsLibrary.py
+Library           ../../../libraries/Common.py
+Variables         ../../../variables/Variables.py
+
+*** Variables ***
+${name}           test
+${key}            subnetConfig
+${REST_CONTEXT}    /controller/nb/v2/subnetservice
+${REST_CONTEXT_HT}   /controller/nb/v2/hosttracker
+
+*** Test Cases ***
+List Subnets
+    [Documentation]    List subnets and verify default is there
+    [Tags]    apps
+    ${resp}    Get    session    ${REST_CONTEXT}/${CONTAINER}/subnets
+    Should Be Equal As Strings   ${resp.status_code}   200
+    ${result}    To JSON    ${resp.content}
+    ${subnet}    Get From Dictionary    ${result}    ${key}
+    ${content}   Get From List    ${subnet}    0
+    Dictionary Should Contain Value   ${content}   0.0.0.0/0
+Ping h1 to h4
+    [Documentation]    Ping h1 to h4, verify no packet loss
+    [Tags]   apps
+    Write   h1 ping -w 6 h4
+    Sleep   6
+    Write   h4 ping -w 6 h1
+    Sleep   6
+    ${result}    Read
+    Should Contain   ${result}   64 bytes
+List hosts
+    [Documentation]    List hosts and verify h1 and h4
+    [Tags]   apps
+    ${resp}    Get    session    ${REST_CONTEXT_HT}/${CONTAINER}/hosts/active
+    Should Be Equal As Strings    ${resp.status_code}    200  
+    Should Contain     ${resp.content}    10.0.0.1
+    Should Contain     ${resp.content}    10.0.0.4
+Add a subnet
+    [Documentation]    Add a subnet, list to validate the result.
+    [Tags]    apps
+    ${body}    Create Dictionary    name    ${name}    subnet    11.0.0.254/8
+    ${resp}    Put    session    ${REST_CONTEXT}/${CONTAINER}/subnet/${name}    data=${body}
+    Should Be Equal As Strings    ${resp.status_code}    201
+    ${resp}    Get    session    ${REST_CONTEXT}/${CONTAINER}/subnets
+    Should Be Equal As Strings    ${resp.status_code}    200
+    ${result}    To JSON    ${resp.content}
+    ${content}    Get From Dictionary    ${result}    ${key}
+    List Should Contain Value    ${content}    ${body}
+Remove a subnet
+    [Documentation]    Remove a subnet, list to validate the result.
+    [Tags]    apps
+    ${body}    Create Dictionary    name    ${name}    subnet    11.0.0.254/8
+    ${resp}    Delete    session    ${REST_CONTEXT}/${CONTAINER}/subnet/${name}
+    Should Be Equal As Strings    ${resp.status_code}    204
+    ${resp}    Get    session    ${REST_CONTEXT}/${CONTAINER}/subnets
+    Should Be Equal As Strings    ${resp.status_code}    200
+    ${result}    To JSON    ${resp.content}
+    ${content}    Get From Dictionary    ${result}    ${key}
+    List Should Not Contain Value    ${content}    ${body}
+
diff --git a/test/csit/suites/controller/AD_SAL_Apps_OF13/__init__.txt b/test/csit/suites/controller/AD_SAL_Apps_OF13/__init__.txt
new file mode 100644 (file)
index 0000000..a2546e9
--- /dev/null
@@ -0,0 +1,12 @@
+*** Settings ***
+Documentation     Test suite for AD-SAL Applications mininet OF13
+Suite Setup       Start Suite
+Suite Teardown    Stop Suite
+Library     SSHLibrary
+Resource          ../../../libraries/Utils.txt
+
+
+*** Variables ***
+${start}=   sudo mn --controller=remote,ip=${CONTROLLER} --topo tree,2 --switch ovsk,protocols=OpenFlow13 
+
+** Keywords ***
diff --git a/test/csit/suites/controller/AD_SAL_NSF_OF10/010__switch_manager.txt b/test/csit/suites/controller/AD_SAL_NSF_OF10/010__switch_manager.txt
new file mode 100644 (file)
index 0000000..43f6bf3
--- /dev/null
@@ -0,0 +1,167 @@
+*** Settings ***
+Documentation     Test suite for Switch Manager
+Suite Setup       Create Session    ${ODL_CONTROLLER_SESSION}    http://${CONTROLLER}:${RESTPORT}    auth=${AUTH}    headers=${HEADERS}
+Suite Teardown    Delete All Sessions
+Library           Collections
+Library           RequestsLibrary
+Library           ../../../libraries/Common.py
+Library           ../../../libraries/SwitchManager.py
+Variables         ../../../variables/Variables.py
+Library           ../../../libraries/Topology.py
+
+*** Variables ***
+${REST_CONTEXT}    /controller/nb/v2/switchmanager
+
+*** Test Cases ***
+List all nodes
+    [Documentation]    List all nodes and their properties in the network.
+    [Tags]    adsal
+    Log    ${TOPO_TREE_LEVEL}
+    ${topo_nodes}    Get Nodes From Topology    ${TOPO_TREE_LEVEL}
+    ${resp}    RequestsLibrary.Get    ${ODL_CONTROLLER_SESSION}    ${REST_CONTEXT}/default/nodes
+    Should Be Equal As Strings    ${resp.status_code}    200    Response    status code error
+    ${jsondata}=    To JSON    ${resp.content}
+    ${nodes}    Extract All Nodes    ${jsondata}
+    List Should Contain Sublist    ${nodes}    ${topo_nodes}
+
+Check node 1 connectors
+    [Documentation]    List node connectors and verify all connectors are there
+    [Tags]    adsal
+    ${resp}    RequestsLibrary.Get    ${ODL_CONTROLLER_SESSION}    ${REST_CONTEXT}/default/node/OF/00:00:00:00:00:00:00:01
+    Should Be Equal As Strings    ${resp.status_code}    200    Response    status code error
+    Should Contain    ${resp.content}    s1-eth1
+    Should Contain    ${resp.content}    s1-eth2
+
+Check node 2 connectors
+    [Documentation]    List node connectors and verify all connectors are there
+    [Tags]    adsal
+    ${resp}    RequestsLibrary.Get    ${ODL_CONTROLLER_SESSION}    ${REST_CONTEXT}/default/node/OF/00:00:00:00:00:00:00:02
+    Should Be Equal As Strings    ${resp.status_code}    200    Response    status code error
+    Should Contain    ${resp.content}    s2-eth1
+    Should Contain    ${resp.content}    s2-eth2
+    Should Contain    ${resp.content}    s2-eth3
+
+Check node 3 connectors
+    [Documentation]    List node connectors and verify all connectors are there
+    [Tags]    adsal
+    ${resp}    RequestsLibrary.Get    ${ODL_CONTROLLER_SESSION}    ${REST_CONTEXT}/default/node/OF/00:00:00:00:00:00:00:03
+    Should Be Equal As Strings    ${resp.status_code}    200    Response    status code error
+    Should Contain    ${resp.content}    s3-eth1
+    Should Contain    ${resp.content}    s3-eth2
+    Should Contain    ${resp.content}    s3-eth3
+
+Add property to node
+    [Documentation]    Add a property to node
+    [Tags]    adsal
+    Add property to node    OF    00:00:00:00:00:00:00:02    description    Switch2
+    Node property should exist    OF    00:00:00:00:00:00:00:02    description    Switch2
+    #Remove property from node
+    #    [Documentation]    Remove a property from node
+    #    Remove property from node    OF    00:00:00:00:00:00:00:02    description
+    #    Node property should not exist    OF    00:00:00:00:00:00:00:02    description    Switch2
+
+Add property to nodeconnector
+    [Documentation]    Add a property to nodeconnector
+    [Tags]    adsal
+    Add property to nodeconnector    OF    00:00:00:00:00:00:00:02    OF    2    bandwidth    1000
+    Nodeconnector property should exist    OF    00:00:00:00:00:00:00:02    OF    2    bandwidth    ${1000}
+
+Remove property from nodeconnector
+    [Documentation]    Remove a property from nodeconnector
+    [Tags]    adsal
+    Remove property from nodeconnector    OF    00:00:00:00:00:00:00:02    OF    2    bandwidth
+    Nodeconnector property should not exist    OF    00:00:00:00:00:00:00:02    OF    2    bandwidth    ${1000}
+
+*** Keywords ***
+Get node
+    [Arguments]    ${node_id}    ${node_type}
+    [Documentation]    Get a specific node
+    ${resp}    RequestsLibrary.Get    ${ODL_CONTROLLER_SESSION}    ${REST_CONTEXT}/${CONTAINER}/nodes
+    Should Be Equal As Strings    ${resp.status_code}    200    Response status code error
+    ${result}    TO JSON    ${resp.content}
+    ${node}    Create Dictionary    id    ${node_id}    type    ${node_type}
+    ${content}    Extract All Nodes    ${result}
+    Log    ${content}
+    List Should Contain Value    ${content}    ${node}
+
+Add property to node
+    [Arguments]    ${node_type}    ${node_id}    ${property}    ${value}
+    [Documentation]    Add property to node
+    ${resp}    RequestsLibrary.Put    ${ODL_CONTROLLER_SESSION}    ${REST_CONTEXT}/${CONTAINER}/node/${node_type}/${node_id}/property/${property}/${value}
+    Should Be Equal As Strings    ${resp.status_code}    201    Response status code error
+
+Remove property from node
+    [Arguments]    ${node_type}    ${node_id}    ${property}
+    [Documentation]    Remove property from node
+    ${resp}    RequestsLibrary.Delete    ${ODL_CONTROLLER_SESSION}    ${REST_CONTEXT}/${CONTAINER}/node/${node_type}/${node_id}/property/${property}
+    Should Be Equal As Strings    ${resp.status_code}    204    Response status code error
+
+Add property to nodeconnector
+    [Arguments]    ${node_type}    ${node_id}    ${nc_type}    ${nc_id}    ${property}    ${value}
+    [Documentation]    Add property to nodeconnector
+    ${resp}    RequestsLibrary.Put    ${ODL_CONTROLLER_SESSION}    ${REST_CONTEXT}/${CONTAINER}/nodeconnector/${node_type}/${node_id}/${nc_type}/${nc_id}/property/${property}/${value}
+    Should Be Equal As Strings    ${resp.status_code}    201    Response status code error
+
+Remove property from nodeconnector
+    [Arguments]    ${node_type}    ${node_id}    ${nc_type}    ${nc_id}    ${property}
+    [Documentation]    Remove property from nodeconnector
+    ${resp}    RequestsLibrary.Delete    ${ODL_CONTROLLER_SESSION}    ${REST_CONTEXT}/${CONTAINER}/nodeconnector/${node_type}/${node_id}/${nc_type}/${nc_id}/property/${property}
+    Should Be Equal As Strings    ${resp.status_code}    204    Response status code error
+
+Node property should exist
+    [Arguments]    ${node_type}    ${node_id}    ${property}    ${value}
+    [Documentation]    Property of node should exist
+    ${resp}    RequestsLibrary.Get    ${ODL_CONTROLLER_SESSION}    ${REST_CONTEXT}/${CONTAINER}/nodes
+    Should Be Equal As Strings    ${resp.status_code}    200    Response status code error
+    ${result}    TO JSON    ${resp.content}
+    Log    ${result}
+    ${nodes}    Extract All Nodes    ${result}
+    ${property_values}    Extract Node Property Values    ${result}    ${property}
+    ${node}    Create Dictionary    id    ${node_id}    type    ${node_type}
+    ${property_value}    Create Dictionary    value    ${value}
+    Log    ${property_value}
+    List Should Contain Value    ${nodes}    ${node}
+    List Should Contain Value    ${property_values}    ${property_value}
+
+Node property should not exist
+    [Arguments]    ${node_type}    ${node_id}    ${property}    ${value}
+    [Documentation]    Property of node should not exist
+    ${resp}    RequestsLibrary.Get    ${ODL_CONTROLLER_SESSION}    ${REST_CONTEXT}/${CONTAINER}/nodes
+    Should Be Equal As Strings    ${resp.status_code}    200    Response status code error
+    ${result}    TO JSON    ${resp.content}
+    Log    ${result}
+    ${nodes}    Extract All Nodes    ${result}
+    ${properties}    Extract Node Property Values    ${result}    ${property}
+    ${node}    Create Dictionary    id    ${node_id}    type    ${node_type}
+    ${property}    Create Dictionary    value    ${value}
+    Log    ${property}
+    List Should Contain Value    ${nodes}    ${node}
+    List Should Not Contain Value    ${properties}    ${property}
+
+Nodeconnector property should exist
+    [Arguments]    ${node_type}    ${node_id}    ${nc_type}    ${nc_id}    ${property}    ${value}
+    [Documentation]    Property of nodeconnector should exist
+    ${resp}    RequestsLibrary.Get    ${ODL_CONTROLLER_SESSION}    ${REST_CONTEXT}/${CONTAINER}/node/${node_type}/${node_id}
+    Should Be Equal As Strings    ${resp.status_code}    200    Response status code error
+    ${result}    TO JSON    ${resp.content}
+    Log    ${result}
+    ${property_values}    Extract Nodeconnector Property Values    ${result}    ${property}
+    Log    ${property_values}
+    ${property_value}    Create Dictionary    value    ${value}
+    List Should Contain Value    ${property_values}    ${property_value}
+
+Nodeconnector property should not exist
+    [Arguments]    ${node_type}    ${node_id}    ${nc_type}    ${nc_id}    ${property}    ${value}
+    [Documentation]    Property of nodeconnector should not exist
+    ${resp}    RequestsLibrary.Get    ${ODL_CONTROLLER_SESSION}    ${REST_CONTEXT}/${CONTAINER}/node/${node_type}/${node_id}
+    Should Be Equal As Strings    ${resp.status_code}    200    Response status code error
+    ${result}    TO JSON    ${resp.content}
+    Log    ${result}
+    ${property_values}    Extract Nodeconnector Property Values    ${result}    ${property}
+    Log    ${property_values}
+    ${property_value}    Create Dictionary    value    ${value}
+    List Should not Contain Value    ${property_values}    ${property_value}
+
+List all nodeconnectors of node
+    [Arguments]    ${node_type}    ${node_id}
+    [Documentation]    List all nodeconnectors and properties of node
diff --git a/test/csit/suites/controller/AD_SAL_NSF_OF10/020__topology_manager.txt b/test/csit/suites/controller/AD_SAL_NSF_OF10/020__topology_manager.txt
new file mode 100644 (file)
index 0000000..eff4b48
--- /dev/null
@@ -0,0 +1,51 @@
+*** Settings ***
+Documentation     Test suite for Topology Manager
+Suite Setup       Create Session    session    http://${CONTROLLER}:${RESTPORT}    auth=${AUTH}    headers=${HEADERS}
+Suite Teardown    Delete All Sessions
+Library           Collections
+Library           ../../../libraries/RequestsLibrary.py
+Library           ../../../libraries/Common.py
+Variables         ../../../variables/Variables.py
+Resource          ../../../libraries/Utils.txt
+
+*** Variables ***
+${node1}          "00:00:00:00:00:00:00:01"
+${node2}          "00:00:00:00:00:00:00:02"
+${node3}          "00:00:00:00:00:00:00:03"
+${name}           test_userlink1
+${key}            userLinks
+${REST_CONTEXT}    /controller/nb/v2/topology
+
+*** Test Cases ***
+Get Topology
+    [Documentation]    Get Topology and validate the result.
+    [Tags]    adsal
+    Wait Until Keyword Succeeds    10s    2s    Check For Specific Number Of Elements At URI    ${REST_CONTEXT}/${CONTAINER}    ${node1}    4
+    Wait Until Keyword Succeeds    10s    2s    Check For Specific Number Of Elements At URI    ${REST_CONTEXT}/${CONTAINER}    ${node1}    4
+    Wait Until Keyword Succeeds    10s    2s    Check For Specific Number Of Elements At URI    ${REST_CONTEXT}/${CONTAINER}    ${node1}    4
+
+Add a userlink
+    [Documentation]    Add a userlink, list to validate the result.
+    [Tags]    adsal
+    ${body}    Create Dictionary    name    ${name}    status    Success    srcNodeConnector
+    ...    OF|1@OF|00:00:00:00:00:00:00:02    dstNodeConnector    OF|1@OF|00:00:00:00:00:00:00:03
+    ${resp}    RequestsLibrary.Put    session    ${REST_CONTEXT}/${CONTAINER}/userLink/${name}    data=${body}
+    Should Be Equal As Strings    ${resp.status_code}    201
+    ${resp}    RequestsLibrary.Get    session    ${REST_CONTEXT}/${CONTAINER}/userLinks
+    Should Be Equal As Strings    ${resp.status_code}    200
+    ${result}    To JSON    ${resp.content}
+    ${content}    Get From Dictionary    ${result}    ${key}
+    List Should Contain Value    ${content}    ${body}
+
+Remove a userlink
+    [Documentation]    Remove a userlink, list to validate the result.
+    [Tags]    adsal
+    ${body}    Create Dictionary    name    ${name}    status    Success    srcNodeConnector
+    ...    OF|1@OF|00:00:00:00:00:00:00:02    dstNodeConnector    OF|1@OF|00:00:00:00:00:00:00:03
+    ${resp}    RequestsLibrary.Delete    session    ${REST_CONTEXT}/${CONTAINER}/userLink/${name}
+    Should Be Equal As Strings    ${resp.status_code}    204
+    ${resp}    RequestsLibrary.Get    session    ${REST_CONTEXT}/${CONTAINER}/userLinks
+    Should Be Equal As Strings    ${resp.status_code}    200
+    ${result}    To JSON    ${resp.content}
+    ${content}    Get From Dictionary    ${result}    ${key}
+    List Should Not Contain Value    ${content}    ${body}
diff --git a/test/csit/suites/controller/AD_SAL_NSF_OF10/030__statistics_manager.txt b/test/csit/suites/controller/AD_SAL_NSF_OF10/030__statistics_manager.txt
new file mode 100644 (file)
index 0000000..cd4b6ee
--- /dev/null
@@ -0,0 +1,38 @@
+*** Settings ***
+Documentation     Test suite for Statistics Manager
+Suite Setup       Create Session    session    http://${CONTROLLER}:${RESTPORT}    auth=${AUTH}    headers=${HEADERS}
+Suite Teardown    Delete All Sessions
+Library           Collections
+Library           ../../../libraries/RequestsLibrary.py
+Library           ../../../libraries/Common.py
+Variables         ../../../variables/Variables.py
+Resource          ../../../libraries/Utils.txt
+
+*** Variables ***
+${node1}          "00:00:00:00:00:00:00:01"
+${node2}          "00:00:00:00:00:00:00:02"
+${node3}          "00:00:00:00:00:00:00:03"
+@{macaddr_list}    ${node1}    ${node2}    ${node3}
+@{node_list}      openflow:1    openflow:2    openflow:3
+${key}            portStatistics
+${REST_CONTEXT}    /controller/nb/v2/statistics
+
+*** Test Cases ***
+
+get port stats
+    [Documentation]    Show port stats and validate result
+    [Tags]    adsal 
+    Wait Until Keyword Succeeds    10s    2s    Check For Elements At URI    ${REST_CONTEXT}/${CONTAINER}/port    ${macaddr_list}
+    Wait Until Keyword Succeeds    60s    2s    Check That Port Count Is Ok    ${node1}    4
+    Wait Until Keyword Succeeds    60s    1s    Check That Port Count Is Ok    ${node2}    5
+    Wait Until Keyword Succeeds    60s    1s    Check That Port Count Is Ok    ${node3}    5
+
+get flow stats
+    [Documentation]    Show flow stats and validate result
+    [Tags]    adsal 
+    Wait Until Keyword Succeeds    10s    2s    Check For Elements At URI    ${REST_CONTEXT}/${CONTAINER}/flow    ${macaddr_list}
+
+get table stats
+    [Documentation]    Show flow stats and validate result
+    [Tags]    adsal 
+    Wait Until Keyword Succeeds    10s    2s    Check For Elements At URI    ${REST_CONTEXT}/${CONTAINER}/table    ${macaddr_list}
diff --git a/test/csit/suites/controller/AD_SAL_NSF_OF10/040__flow_programmer.txt b/test/csit/suites/controller/AD_SAL_NSF_OF10/040__flow_programmer.txt
new file mode 100644 (file)
index 0000000..000d24d
--- /dev/null
@@ -0,0 +1,61 @@
+*** Settings ***
+Documentation     Test suite for Flow Programmer
+Suite Setup       Create Session    session    http://${CONTROLLER}:${RESTPORT}    auth=${AUTH}    headers=${HEADERS}
+Suite Teardown    Delete All Sessions
+Library           Collections
+Library           ../../../libraries/RequestsLibrary.py
+Library           ../../../libraries/Common.py
+Variables         ../../../variables/Variables.py
+Resource          ../../../libraries/Utils.txt
+
+*** Variables ***
+${name}           flow1
+${key}            flowConfig
+${node_id}        00:00:00:00:00:00:00:02
+${REST_CONTEXT}    /controller/nb/v2/flowprogrammer
+${REST_CONTEXT_ST}    /controller/nb/v2/statistics
+
+*** Test Cases ***
+Add a flow
+    [Documentation]    Add a flow, list to validate the result.
+    [Tags]    adsal
+    ${node}    Create Dictionary    type    OF    id    ${node_id}
+    ${actions}    Create List    OUTPUT=1
+    ${body}    Create Dictionary    name    ${name}    installInHw    true    node
+    ...    ${node}    priority    1    etherType    0x800    nwDst
+    ...    10.0.0.1/32    actions    ${actions}
+    ${resp}    RequestsLibrary.Put    session    ${REST_CONTEXT}/${CONTAINER}/node/OF/${node_id}/staticFlow/${name}    data=${body}
+    Should Be Equal As Strings    ${resp.status_code}    201
+    ${resp}    RequestsLibrary.Get    session    ${REST_CONTEXT}/${CONTAINER}
+    Should Be Equal As Strings    ${resp.status_code}    200
+    ${result}    To JSON    ${resp.content}
+    ${content}    Get From Dictionary    ${result}    ${key}
+    List Should Contain Value    ${content}    ${body}
+
+Check flow in flow stats
+    [Documentation]    Show flow stats and validate result
+    [Tags]    adsal
+    ${elements}=    Create List    10.0.0.1
+    Wait Until Keyword Succeeds    90s    2s    Check For Elements At URI    ${REST_CONTEXT_ST}/${CONTAINER}/flow    ${elements}
+
+Remove a flow
+    [Documentation]    Remove a flow, list to validate the result.
+    [Tags]    adsal
+    ${node}    Create Dictionary    type    OF    id    ${node_id}
+    ${actions}    Create List    OUTPUT=1
+    ${body}    Create Dictionary    name    ${name}    installInHw    true    node
+    ...    ${node}    priority    1    etherType    0x800    nwDst
+    ...    10.0.0.1/32    actions    ${actions}
+    ${resp}    RequestsLibrary.Delete    session    ${REST_CONTEXT}/${CONTAINER}/node/OF/${node_id}/staticFlow/${name}
+    Should Be Equal As Strings    ${resp.status_code}    204
+    ${resp}    RequestsLibrary.Get    session    ${REST_CONTEXT}/${CONTAINER}
+    Should Be Equal As Strings    ${resp.status_code}    200
+    ${result}    To JSON    ${resp.content}
+    ${content}    Get From Dictionary    ${result}    ${key}
+    List Should Not Contain Value    ${content}    ${body}
+
+Check flow is not in flow stats
+    [Documentation]    Show flow stats and validate result
+    [Tags]    adsal
+    ${elements}=    Create List    10.0.0.1
+    Wait Until Keyword Succeeds    60s    2s    Check For Elements Not At URI    ${REST_CONTEXT_ST}/${CONTAINER}/flow    ${elements}
diff --git a/test/csit/suites/controller/AD_SAL_NSF_OF10/__init__.txt b/test/csit/suites/controller/AD_SAL_NSF_OF10/__init__.txt
new file mode 100644 (file)
index 0000000..8a8c194
--- /dev/null
@@ -0,0 +1,11 @@
+*** Settings ***
+Documentation     Test suite for AD-SAL NSF
+Suite Setup       Start Suite
+Suite Teardown    Stop Suite
+Library     SSHLibrary
+Resource          ../../../libraries/Utils.txt
+
+*** Variables ***
+${start}=   sudo mn --controller=remote,ip=${CONTROLLER} --topo tree,2 
+
+** Keywords ***
diff --git a/test/csit/suites/controller/AD_SAL_NSF_OF13/010__switch_manager.txt b/test/csit/suites/controller/AD_SAL_NSF_OF13/010__switch_manager.txt
new file mode 100644 (file)
index 0000000..43f6bf3
--- /dev/null
@@ -0,0 +1,167 @@
+*** Settings ***
+Documentation     Test suite for Switch Manager
+Suite Setup       Create Session    ${ODL_CONTROLLER_SESSION}    http://${CONTROLLER}:${RESTPORT}    auth=${AUTH}    headers=${HEADERS}
+Suite Teardown    Delete All Sessions
+Library           Collections
+Library           RequestsLibrary
+Library           ../../../libraries/Common.py
+Library           ../../../libraries/SwitchManager.py
+Variables         ../../../variables/Variables.py
+Library           ../../../libraries/Topology.py
+
+*** Variables ***
+${REST_CONTEXT}    /controller/nb/v2/switchmanager
+
+*** Test Cases ***
+List all nodes
+    [Documentation]    List all nodes and their properties in the network.
+    [Tags]    adsal
+    Log    ${TOPO_TREE_LEVEL}
+    ${topo_nodes}    Get Nodes From Topology    ${TOPO_TREE_LEVEL}
+    ${resp}    RequestsLibrary.Get    ${ODL_CONTROLLER_SESSION}    ${REST_CONTEXT}/default/nodes
+    Should Be Equal As Strings    ${resp.status_code}    200    Response    status code error
+    ${jsondata}=    To JSON    ${resp.content}
+    ${nodes}    Extract All Nodes    ${jsondata}
+    List Should Contain Sublist    ${nodes}    ${topo_nodes}
+
+Check node 1 connectors
+    [Documentation]    List node connectors and verify all connectors are there
+    [Tags]    adsal
+    ${resp}    RequestsLibrary.Get    ${ODL_CONTROLLER_SESSION}    ${REST_CONTEXT}/default/node/OF/00:00:00:00:00:00:00:01
+    Should Be Equal As Strings    ${resp.status_code}    200    Response    status code error
+    Should Contain    ${resp.content}    s1-eth1
+    Should Contain    ${resp.content}    s1-eth2
+
+Check node 2 connectors
+    [Documentation]    List node connectors and verify all connectors are there
+    [Tags]    adsal
+    ${resp}    RequestsLibrary.Get    ${ODL_CONTROLLER_SESSION}    ${REST_CONTEXT}/default/node/OF/00:00:00:00:00:00:00:02
+    Should Be Equal As Strings    ${resp.status_code}    200    Response    status code error
+    Should Contain    ${resp.content}    s2-eth1
+    Should Contain    ${resp.content}    s2-eth2
+    Should Contain    ${resp.content}    s2-eth3
+
+Check node 3 connectors
+    [Documentation]    List node connectors and verify all connectors are there
+    [Tags]    adsal
+    ${resp}    RequestsLibrary.Get    ${ODL_CONTROLLER_SESSION}    ${REST_CONTEXT}/default/node/OF/00:00:00:00:00:00:00:03
+    Should Be Equal As Strings    ${resp.status_code}    200    Response    status code error
+    Should Contain    ${resp.content}    s3-eth1
+    Should Contain    ${resp.content}    s3-eth2
+    Should Contain    ${resp.content}    s3-eth3
+
+Add property to node
+    [Documentation]    Add a property to node
+    [Tags]    adsal
+    Add property to node    OF    00:00:00:00:00:00:00:02    description    Switch2
+    Node property should exist    OF    00:00:00:00:00:00:00:02    description    Switch2
+    #Remove property from node
+    #    [Documentation]    Remove a property from node
+    #    Remove property from node    OF    00:00:00:00:00:00:00:02    description
+    #    Node property should not exist    OF    00:00:00:00:00:00:00:02    description    Switch2
+
+Add property to nodeconnector
+    [Documentation]    Add a property to nodeconnector
+    [Tags]    adsal
+    Add property to nodeconnector    OF    00:00:00:00:00:00:00:02    OF    2    bandwidth    1000
+    Nodeconnector property should exist    OF    00:00:00:00:00:00:00:02    OF    2    bandwidth    ${1000}
+
+Remove property from nodeconnector
+    [Documentation]    Remove a property from nodeconnector
+    [Tags]    adsal
+    Remove property from nodeconnector    OF    00:00:00:00:00:00:00:02    OF    2    bandwidth
+    Nodeconnector property should not exist    OF    00:00:00:00:00:00:00:02    OF    2    bandwidth    ${1000}
+
+*** Keywords ***
+Get node
+    [Arguments]    ${node_id}    ${node_type}
+    [Documentation]    Get a specific node
+    ${resp}    RequestsLibrary.Get    ${ODL_CONTROLLER_SESSION}    ${REST_CONTEXT}/${CONTAINER}/nodes
+    Should Be Equal As Strings    ${resp.status_code}    200    Response status code error
+    ${result}    TO JSON    ${resp.content}
+    ${node}    Create Dictionary    id    ${node_id}    type    ${node_type}
+    ${content}    Extract All Nodes    ${result}
+    Log    ${content}
+    List Should Contain Value    ${content}    ${node}
+
+Add property to node
+    [Arguments]    ${node_type}    ${node_id}    ${property}    ${value}
+    [Documentation]    Add property to node
+    ${resp}    RequestsLibrary.Put    ${ODL_CONTROLLER_SESSION}    ${REST_CONTEXT}/${CONTAINER}/node/${node_type}/${node_id}/property/${property}/${value}
+    Should Be Equal As Strings    ${resp.status_code}    201    Response status code error
+
+Remove property from node
+    [Arguments]    ${node_type}    ${node_id}    ${property}
+    [Documentation]    Remove property from node
+    ${resp}    RequestsLibrary.Delete    ${ODL_CONTROLLER_SESSION}    ${REST_CONTEXT}/${CONTAINER}/node/${node_type}/${node_id}/property/${property}
+    Should Be Equal As Strings    ${resp.status_code}    204    Response status code error
+
+Add property to nodeconnector
+    [Arguments]    ${node_type}    ${node_id}    ${nc_type}    ${nc_id}    ${property}    ${value}
+    [Documentation]    Add property to nodeconnector
+    ${resp}    RequestsLibrary.Put    ${ODL_CONTROLLER_SESSION}    ${REST_CONTEXT}/${CONTAINER}/nodeconnector/${node_type}/${node_id}/${nc_type}/${nc_id}/property/${property}/${value}
+    Should Be Equal As Strings    ${resp.status_code}    201    Response status code error
+
+Remove property from nodeconnector
+    [Arguments]    ${node_type}    ${node_id}    ${nc_type}    ${nc_id}    ${property}
+    [Documentation]    Remove property from nodeconnector
+    ${resp}    RequestsLibrary.Delete    ${ODL_CONTROLLER_SESSION}    ${REST_CONTEXT}/${CONTAINER}/nodeconnector/${node_type}/${node_id}/${nc_type}/${nc_id}/property/${property}
+    Should Be Equal As Strings    ${resp.status_code}    204    Response status code error
+
+Node property should exist
+    [Arguments]    ${node_type}    ${node_id}    ${property}    ${value}
+    [Documentation]    Property of node should exist
+    ${resp}    RequestsLibrary.Get    ${ODL_CONTROLLER_SESSION}    ${REST_CONTEXT}/${CONTAINER}/nodes
+    Should Be Equal As Strings    ${resp.status_code}    200    Response status code error
+    ${result}    TO JSON    ${resp.content}
+    Log    ${result}
+    ${nodes}    Extract All Nodes    ${result}
+    ${property_values}    Extract Node Property Values    ${result}    ${property}
+    ${node}    Create Dictionary    id    ${node_id}    type    ${node_type}
+    ${property_value}    Create Dictionary    value    ${value}
+    Log    ${property_value}
+    List Should Contain Value    ${nodes}    ${node}
+    List Should Contain Value    ${property_values}    ${property_value}
+
+Node property should not exist
+    [Arguments]    ${node_type}    ${node_id}    ${property}    ${value}
+    [Documentation]    Property of node should not exist
+    ${resp}    RequestsLibrary.Get    ${ODL_CONTROLLER_SESSION}    ${REST_CONTEXT}/${CONTAINER}/nodes
+    Should Be Equal As Strings    ${resp.status_code}    200    Response status code error
+    ${result}    TO JSON    ${resp.content}
+    Log    ${result}
+    ${nodes}    Extract All Nodes    ${result}
+    ${properties}    Extract Node Property Values    ${result}    ${property}
+    ${node}    Create Dictionary    id    ${node_id}    type    ${node_type}
+    ${property}    Create Dictionary    value    ${value}
+    Log    ${property}
+    List Should Contain Value    ${nodes}    ${node}
+    List Should Not Contain Value    ${properties}    ${property}
+
+Nodeconnector property should exist
+    [Arguments]    ${node_type}    ${node_id}    ${nc_type}    ${nc_id}    ${property}    ${value}
+    [Documentation]    Property of nodeconnector should exist
+    ${resp}    RequestsLibrary.Get    ${ODL_CONTROLLER_SESSION}    ${REST_CONTEXT}/${CONTAINER}/node/${node_type}/${node_id}
+    Should Be Equal As Strings    ${resp.status_code}    200    Response status code error
+    ${result}    TO JSON    ${resp.content}
+    Log    ${result}
+    ${property_values}    Extract Nodeconnector Property Values    ${result}    ${property}
+    Log    ${property_values}
+    ${property_value}    Create Dictionary    value    ${value}
+    List Should Contain Value    ${property_values}    ${property_value}
+
+Nodeconnector property should not exist
+    [Arguments]    ${node_type}    ${node_id}    ${nc_type}    ${nc_id}    ${property}    ${value}
+    [Documentation]    Property of nodeconnector should not exist
+    ${resp}    RequestsLibrary.Get    ${ODL_CONTROLLER_SESSION}    ${REST_CONTEXT}/${CONTAINER}/node/${node_type}/${node_id}
+    Should Be Equal As Strings    ${resp.status_code}    200    Response status code error
+    ${result}    TO JSON    ${resp.content}
+    Log    ${result}
+    ${property_values}    Extract Nodeconnector Property Values    ${result}    ${property}
+    Log    ${property_values}
+    ${property_value}    Create Dictionary    value    ${value}
+    List Should not Contain Value    ${property_values}    ${property_value}
+
+List all nodeconnectors of node
+    [Arguments]    ${node_type}    ${node_id}
+    [Documentation]    List all nodeconnectors and properties of node
diff --git a/test/csit/suites/controller/AD_SAL_NSF_OF13/020__topology_manager.txt b/test/csit/suites/controller/AD_SAL_NSF_OF13/020__topology_manager.txt
new file mode 100644 (file)
index 0000000..eff4b48
--- /dev/null
@@ -0,0 +1,51 @@
+*** Settings ***
+Documentation     Test suite for Topology Manager
+Suite Setup       Create Session    session    http://${CONTROLLER}:${RESTPORT}    auth=${AUTH}    headers=${HEADERS}
+Suite Teardown    Delete All Sessions
+Library           Collections
+Library           ../../../libraries/RequestsLibrary.py
+Library           ../../../libraries/Common.py
+Variables         ../../../variables/Variables.py
+Resource          ../../../libraries/Utils.txt
+
+*** Variables ***
+${node1}          "00:00:00:00:00:00:00:01"
+${node2}          "00:00:00:00:00:00:00:02"
+${node3}          "00:00:00:00:00:00:00:03"
+${name}           test_userlink1
+${key}            userLinks
+${REST_CONTEXT}    /controller/nb/v2/topology
+
+*** Test Cases ***
+Get Topology
+    [Documentation]    Get Topology and validate the result.
+    [Tags]    adsal
+    Wait Until Keyword Succeeds    10s    2s    Check For Specific Number Of Elements At URI    ${REST_CONTEXT}/${CONTAINER}    ${node1}    4
+    Wait Until Keyword Succeeds    10s    2s    Check For Specific Number Of Elements At URI    ${REST_CONTEXT}/${CONTAINER}    ${node1}    4
+    Wait Until Keyword Succeeds    10s    2s    Check For Specific Number Of Elements At URI    ${REST_CONTEXT}/${CONTAINER}    ${node1}    4
+
+Add a userlink
+    [Documentation]    Add a userlink, list to validate the result.
+    [Tags]    adsal
+    ${body}    Create Dictionary    name    ${name}    status    Success    srcNodeConnector
+    ...    OF|1@OF|00:00:00:00:00:00:00:02    dstNodeConnector    OF|1@OF|00:00:00:00:00:00:00:03
+    ${resp}    RequestsLibrary.Put    session    ${REST_CONTEXT}/${CONTAINER}/userLink/${name}    data=${body}
+    Should Be Equal As Strings    ${resp.status_code}    201
+    ${resp}    RequestsLibrary.Get    session    ${REST_CONTEXT}/${CONTAINER}/userLinks
+    Should Be Equal As Strings    ${resp.status_code}    200
+    ${result}    To JSON    ${resp.content}
+    ${content}    Get From Dictionary    ${result}    ${key}
+    List Should Contain Value    ${content}    ${body}
+
+Remove a userlink
+    [Documentation]    Remove a userlink, list to validate the result.
+    [Tags]    adsal
+    ${body}    Create Dictionary    name    ${name}    status    Success    srcNodeConnector
+    ...    OF|1@OF|00:00:00:00:00:00:00:02    dstNodeConnector    OF|1@OF|00:00:00:00:00:00:00:03
+    ${resp}    RequestsLibrary.Delete    session    ${REST_CONTEXT}/${CONTAINER}/userLink/${name}
+    Should Be Equal As Strings    ${resp.status_code}    204
+    ${resp}    RequestsLibrary.Get    session    ${REST_CONTEXT}/${CONTAINER}/userLinks
+    Should Be Equal As Strings    ${resp.status_code}    200
+    ${result}    To JSON    ${resp.content}
+    ${content}    Get From Dictionary    ${result}    ${key}
+    List Should Not Contain Value    ${content}    ${body}
diff --git a/test/csit/suites/controller/AD_SAL_NSF_OF13/030__statistics_manager.txt b/test/csit/suites/controller/AD_SAL_NSF_OF13/030__statistics_manager.txt
new file mode 100644 (file)
index 0000000..cd4b6ee
--- /dev/null
@@ -0,0 +1,38 @@
+*** Settings ***
+Documentation     Test suite for Statistics Manager
+Suite Setup       Create Session    session    http://${CONTROLLER}:${RESTPORT}    auth=${AUTH}    headers=${HEADERS}
+Suite Teardown    Delete All Sessions
+Library           Collections
+Library           ../../../libraries/RequestsLibrary.py
+Library           ../../../libraries/Common.py
+Variables         ../../../variables/Variables.py
+Resource          ../../../libraries/Utils.txt
+
+*** Variables ***
+${node1}          "00:00:00:00:00:00:00:01"
+${node2}          "00:00:00:00:00:00:00:02"
+${node3}          "00:00:00:00:00:00:00:03"
+@{macaddr_list}    ${node1}    ${node2}    ${node3}
+@{node_list}      openflow:1    openflow:2    openflow:3
+${key}            portStatistics
+${REST_CONTEXT}    /controller/nb/v2/statistics
+
+*** Test Cases ***
+
+get port stats
+    [Documentation]    Show port stats and validate result
+    [Tags]    adsal 
+    Wait Until Keyword Succeeds    10s    2s    Check For Elements At URI    ${REST_CONTEXT}/${CONTAINER}/port    ${macaddr_list}
+    Wait Until Keyword Succeeds    60s    2s    Check That Port Count Is Ok    ${node1}    4
+    Wait Until Keyword Succeeds    60s    1s    Check That Port Count Is Ok    ${node2}    5
+    Wait Until Keyword Succeeds    60s    1s    Check That Port Count Is Ok    ${node3}    5
+
+get flow stats
+    [Documentation]    Show flow stats and validate result
+    [Tags]    adsal 
+    Wait Until Keyword Succeeds    10s    2s    Check For Elements At URI    ${REST_CONTEXT}/${CONTAINER}/flow    ${macaddr_list}
+
+get table stats
+    [Documentation]    Show flow stats and validate result
+    [Tags]    adsal 
+    Wait Until Keyword Succeeds    10s    2s    Check For Elements At URI    ${REST_CONTEXT}/${CONTAINER}/table    ${macaddr_list}
diff --git a/test/csit/suites/controller/AD_SAL_NSF_OF13/040__flow_programmer.txt b/test/csit/suites/controller/AD_SAL_NSF_OF13/040__flow_programmer.txt
new file mode 100644 (file)
index 0000000..000d24d
--- /dev/null
@@ -0,0 +1,61 @@
+*** Settings ***
+Documentation     Test suite for Flow Programmer
+Suite Setup       Create Session    session    http://${CONTROLLER}:${RESTPORT}    auth=${AUTH}    headers=${HEADERS}
+Suite Teardown    Delete All Sessions
+Library           Collections
+Library           ../../../libraries/RequestsLibrary.py
+Library           ../../../libraries/Common.py
+Variables         ../../../variables/Variables.py
+Resource          ../../../libraries/Utils.txt
+
+*** Variables ***
+${name}           flow1
+${key}            flowConfig
+${node_id}        00:00:00:00:00:00:00:02
+${REST_CONTEXT}    /controller/nb/v2/flowprogrammer
+${REST_CONTEXT_ST}    /controller/nb/v2/statistics
+
+*** Test Cases ***
+Add a flow
+    [Documentation]    Add a flow, list to validate the result.
+    [Tags]    adsal
+    ${node}    Create Dictionary    type    OF    id    ${node_id}
+    ${actions}    Create List    OUTPUT=1
+    ${body}    Create Dictionary    name    ${name}    installInHw    true    node
+    ...    ${node}    priority    1    etherType    0x800    nwDst
+    ...    10.0.0.1/32    actions    ${actions}
+    ${resp}    RequestsLibrary.Put    session    ${REST_CONTEXT}/${CONTAINER}/node/OF/${node_id}/staticFlow/${name}    data=${body}
+    Should Be Equal As Strings    ${resp.status_code}    201
+    ${resp}    RequestsLibrary.Get    session    ${REST_CONTEXT}/${CONTAINER}
+    Should Be Equal As Strings    ${resp.status_code}    200
+    ${result}    To JSON    ${resp.content}
+    ${content}    Get From Dictionary    ${result}    ${key}
+    List Should Contain Value    ${content}    ${body}
+
+Check flow in flow stats
+    [Documentation]    Show flow stats and validate result
+    [Tags]    adsal
+    ${elements}=    Create List    10.0.0.1
+    Wait Until Keyword Succeeds    90s    2s    Check For Elements At URI    ${REST_CONTEXT_ST}/${CONTAINER}/flow    ${elements}
+
+Remove a flow
+    [Documentation]    Remove a flow, list to validate the result.
+    [Tags]    adsal
+    ${node}    Create Dictionary    type    OF    id    ${node_id}
+    ${actions}    Create List    OUTPUT=1
+    ${body}    Create Dictionary    name    ${name}    installInHw    true    node
+    ...    ${node}    priority    1    etherType    0x800    nwDst
+    ...    10.0.0.1/32    actions    ${actions}
+    ${resp}    RequestsLibrary.Delete    session    ${REST_CONTEXT}/${CONTAINER}/node/OF/${node_id}/staticFlow/${name}
+    Should Be Equal As Strings    ${resp.status_code}    204
+    ${resp}    RequestsLibrary.Get    session    ${REST_CONTEXT}/${CONTAINER}
+    Should Be Equal As Strings    ${resp.status_code}    200
+    ${result}    To JSON    ${resp.content}
+    ${content}    Get From Dictionary    ${result}    ${key}
+    List Should Not Contain Value    ${content}    ${body}
+
+Check flow is not in flow stats
+    [Documentation]    Show flow stats and validate result
+    [Tags]    adsal
+    ${elements}=    Create List    10.0.0.1
+    Wait Until Keyword Succeeds    60s    2s    Check For Elements Not At URI    ${REST_CONTEXT_ST}/${CONTAINER}/flow    ${elements}
diff --git a/test/csit/suites/controller/AD_SAL_NSF_OF13/__init__.txt b/test/csit/suites/controller/AD_SAL_NSF_OF13/__init__.txt
new file mode 100644 (file)
index 0000000..36c2d66
--- /dev/null
@@ -0,0 +1,11 @@
+*** Settings ***
+Documentation     Test suite for AD-SAL NSF mininet OF13
+Suite Setup       Start Suite
+Suite Teardown    Stop Suite
+Library     SSHLibrary
+Resource          ../../../libraries/Utils.txt
+
+*** Variables ***
+${start}=   sudo mn --controller=remote,ip=${CONTROLLER} --topo tree,2 --switch ovsk,protocols=OpenFlow13 
+
+** Keywords ***
diff --git a/test/csit/suites/controller/Inventory_Scalability_OF10/010__restconf_inventory.txt b/test/csit/suites/controller/Inventory_Scalability_OF10/010__restconf_inventory.txt
new file mode 100644 (file)
index 0000000..797334a
--- /dev/null
@@ -0,0 +1,71 @@
+*** Settings ***
+Documentation     Test suite for RESTCONF inventory
+Suite Setup       Create Session    session    http://${CONTROLLER}:${RESTCONFPORT}    auth=${AUTH}    headers=${HEADERS_XML}
+Suite Teardown    Delete All Sessions
+Library           Collections
+Library           ../../../libraries/RequestsLibrary.py
+Library           ../../../libraries/Common.py
+Variables         ../../../variables/Variables.py
+
+*** Variables ***
+${REST_CONTEXT}    /restconf/operational/opendaylight-inventory:nodes
+
+*** Test Cases ***
+Get list of nodes
+    [Documentation]    Get the inventory
+    ${TOPO_TREE_DEPTH}    Convert To Integer    ${TOPO_TREE_DEPTH}
+    ${TOPO_TREE_FANOUT}    Convert To Integer    ${TOPO_TREE_FANOUT}
+    ${numnodes}    Num Of Nodes    ${TOPO_TREE_DEPTH}    ${TOPO_TREE_FANOUT}
+    Wait Until Keyword Succeeds    30s    2s    Check Every Nodes    ${numnodes}
+
+Get nodeconnector for the root node
+    [Documentation]    Get the inventory for the root node
+    ${TOPO_TREE_FANOUT}    Convert To Integer    ${TOPO_TREE_FANOUT}
+    ${resp}    RequestsLibrary.Get    session    ${REST_CONTEXT}/node/openflow:1
+    Log    ${resp.content}
+    Should Be Equal As Strings    ${resp.status_code}    200
+    Wait Until Keyword Succeeds    30s    2s    Check conn loop    ${TOPO_TREE_FANOUT}    1    ${resp.content}
+
+Get nodeconnector for a node
+    [Documentation]    Get the inventory for a node
+    ${TOPO_TREE_DEPTH}    Convert To Integer    ${TOPO_TREE_DEPTH}
+    ${TOPO_TREE_FANOUT}    Convert To Integer    ${TOPO_TREE_FANOUT}
+    ${numnodes}    Num Of Nodes    ${TOPO_TREE_DEPTH}    ${TOPO_TREE_FANOUT}
+    Wait Until Keyword Succeeds    30s    2s    Check Every Nodes Nodeconnector    ${numnodes}
+
+Get Stats for a node
+    [Documentation]    Get the stats for a node
+    ${TOPO_TREE_DEPTH}    Convert To Integer    ${TOPO_TREE_DEPTH}
+    ${TOPO_TREE_FANOUT}    Convert To Integer    ${TOPO_TREE_FANOUT}
+    ${numnodes}    Num Of Nodes    ${TOPO_TREE_DEPTH}    ${TOPO_TREE_FANOUT}
+    Wait Until Keyword Succeeds    120s    2s    Check Every Nodes Stats    ${numnodes}
+
+*** Keywords ***
+Check Every Nodes
+    [Arguments]    ${numnodes}
+    ${resp}    RequestsLibrary.Get    session    ${REST_CONTEXT}
+    Should Be Equal As Strings    ${resp.status_code}    200
+    : FOR    ${IND}    IN RANGE    1    ${numnodes+1}
+    \    Should Contain    ${resp.content}    openflow:${IND}
+
+Check Every Nodes Stats
+    [Arguments]    ${numnodes}
+    : FOR    ${IND}    IN RANGE    1    ${numnodes+1}
+    \    ${resp}    RequestsLibrary.Get    session    ${REST_CONTEXT}/node/openflow:${IND}
+    \    Log    ${resp.content}
+    \    Should Be Equal As Strings    ${resp.status_code}    200
+    \    Should Contain    ${resp.content}    flow-capable-node-connector-statistics
+    \    Should Contain    ${resp.content}    flow-table-statistics
+
+Check Every Nodes Nodeconnector
+    [Arguments]    ${numnodes}
+    : FOR    ${IND}    IN RANGE    2    ${numnodes+1}
+    \    ${resp}    RequestsLibrary.Get    session    ${REST_CONTEXT}/node/openflow:${IND}
+    \    Log    ${resp.content}
+    \    Should Be Equal As Strings    ${resp.status_code}    200
+    \    Check conn loop    ${TOPO_TREE_FANOUT+1}    ${IND}    ${resp.content}
+
+Check conn loop
+    [Arguments]    ${arg}    ${outerind}    ${content}
+    : FOR    ${var}    IN RANGE    1    ${arg+1}
+    \    Should Contain    ${content}    openflow:${outerind}:${var}
diff --git a/test/csit/suites/controller/Inventory_Scalability_OF10/020__restconf_topology.txt b/test/csit/suites/controller/Inventory_Scalability_OF10/020__restconf_topology.txt
new file mode 100644 (file)
index 0000000..8ad05ed
--- /dev/null
@@ -0,0 +1,37 @@
+*** Settings ***
+Documentation     Test suite for RESTCONF topology
+Suite Setup       Create Session    session    http://${CONTROLLER}:${RESTCONFPORT}    auth=${AUTH}    headers=${HEADERS_XML}
+Suite Teardown    Delete All Sessions
+Library           Collections
+Library           XML
+Library           ../../../libraries/RequestsLibrary.py
+Library           ../../../libraries/Common.py
+Variables         ../../../variables/Variables.py
+
+*** Variables ***
+${REST_CONTEXT}    /restconf/operational/network-topology:network-topology/topology/flow:1
+
+*** Test Cases ***
+Get Nodes Count
+    [Documentation]    Checks the number of switches
+    ${TOPO_TREE_DEPTH}    Convert To Integer    ${TOPO_TREE_DEPTH}
+    ${TOPO_TREE_FANOUT}    Convert To Integer    ${TOPO_TREE_FANOUT}
+    ${numnodes}    Num Of Nodes    ${TOPO_TREE_DEPTH}    ${TOPO_TREE_FANOUT}
+    Wait Until Keyword Succeeds    60s    2s    Verify Element Count    ${REST_CONTEXT}    node    ${numnodes}
+
+Get Links Count
+    [Documentation]    Checks the number of links
+    ${TOPO_TREE_DEPTH}    Convert To Integer    ${TOPO_TREE_DEPTH}
+    ${TOPO_TREE_FANOUT}    Convert To Integer    ${TOPO_TREE_FANOUT}
+    ${numnodes}    Num Of Nodes    ${TOPO_TREE_DEPTH}    ${TOPO_TREE_FANOUT}
+    ${numlinks}    Evaluate    (${numnodes}-1)*2
+    Wait Until Keyword Succeeds    60s    2s    Verify Element Count    ${REST_CONTEXT}    link    ${numlinks}
+
+*** Keywords ***
+Verify Element Count
+    [Arguments]    ${URI}    ${xpath_location}    ${expected_count}
+    ${resp}    RequestsLibrary.Get    session    ${REST_CONTEXT}    headers=${ACCEPT_XML}
+    Log    ${resp.content}
+    Should Be Equal As Strings    ${resp.status_code}    200
+    ${count}=    Get Element Count    ${resp.content}    xpath=${xpath_location}
+    Should Be Equal As Numbers    ${count}    ${expected_count}
diff --git a/test/csit/suites/controller/Inventory_Scalability_OF10/030__switch_manager.txt b/test/csit/suites/controller/Inventory_Scalability_OF10/030__switch_manager.txt
new file mode 100644 (file)
index 0000000..f3c0ff7
--- /dev/null
@@ -0,0 +1,56 @@
+*** Settings ***
+Documentation     Test suite for Switch Manager
+Suite Setup       Create Session    ${ODL_CONTROLLER_SESSION}    http://${CONTROLLER}:${RESTPORT}    auth=${AUTH}    headers=${HEADERS}
+Suite Teardown    Delete All Sessions
+Library           Collections
+Library           RequestsLibrary
+Library           ../../../libraries/Common.py
+Library           ../../../libraries/SwitchManager.py
+Variables         ../../../variables/Variables.py
+Library           ../../../libraries/Topologynew.py
+
+*** Variables ***
+${REST_CONTEXT}    /controller/nb/v2/switchmanager
+
+*** Test Cases ***
+List all nodes
+    [Documentation]    List all nodes and their properties in the network.
+    [Tags]    adsal
+    Log    ${TOPO_TREE_LEVEL}
+    ${topo_nodes}    Get Nodes From Tree Topo    (${TOPO_TREE_DEPTH},${TOPO_TREE_FANOUT})
+    ${resp}    RequestsLibrary.Get    ${ODL_CONTROLLER_SESSION}    ${REST_CONTEXT}/default/nodes
+    Log    ${resp.content}
+    Should Be Equal As Strings    ${resp.status_code}    200    Response    status code error
+    ${jsondata}=    To JSON    ${resp.content}
+    ${nodes}    Extract All Nodes    ${jsondata}
+    List Should Contain Sublist    ${nodes}    ${topo_nodes}
+
+Check root node connectors
+    [Documentation]    List node connectors and verify all connectors are there
+    [Tags]    adsal
+    ${resp}    RequestsLibrary.Get    ${ODL_CONTROLLER_SESSION}    ${REST_CONTEXT}/default/node/OF/00:00:00:00:00:00:00:01
+    Log    ${resp.content}
+    Should Be Equal As Strings    ${resp.status_code}    200    Response    status code error
+    ${TOPO_TREE_FANOUT}    Convert To Integer    ${TOPO_TREE_FANOUT}
+    Check conn loop    ${TOPO_TREE_FANOUT}    1    ${resp.content}
+
+Check node i connectors
+    [Documentation]    List node connectors and verify all connectors are there
+    [Tags]    adsal
+    ${topo_nodes}    Get Nodes From Tree Topo    (${TOPO_TREE_DEPTH},${TOPO_TREE_FANOUT})    1
+    Wait Until Keyword Succeeds    30s    2s    Check Every Nodes Connectors    ${topo_nodes}
+
+*** Keywords ***
+Check Every Nodes Connectors
+    [Arguments]    ${topo_nodes}
+    : FOR    ${ITEM}    IN    @{topo_nodes}
+    \    ${IND}    Get From Dictionary    ${ITEM}    id
+    \    ${resp}    RequestsLibrary.Get    ${ODL_CONTROLLER_SESSION}    ${REST_CONTEXT}/default/node/OF/${IND}
+    \    Log    ${resp.content}
+    \    Should Be Equal As Strings    ${resp.status_code}    200
+    \    Check conn loop    ${TOPO_TREE_FANOUT+1}    ${IND}    ${resp.content}
+
+Check conn loop
+    [Arguments]    ${arg}    ${outerind}    ${content}
+    : FOR    ${var}    IN RANGE    0    ${arg+1}
+    \    Should Contain    ${content}    "id":"${var}"
diff --git a/test/csit/suites/controller/Inventory_Scalability_OF10/040__statistics_manager.txt b/test/csit/suites/controller/Inventory_Scalability_OF10/040__statistics_manager.txt
new file mode 100644 (file)
index 0000000..b8e864a
--- /dev/null
@@ -0,0 +1,66 @@
+*** Settings ***
+Documentation     Test suite for Statistics Manager
+Suite Setup       Create Session    session    http://${CONTROLLER}:${RESTPORT}    auth=${AUTH}    headers=${HEADERS}
+Suite Teardown    Delete All Sessions
+Library           Collections
+Library           ../../../libraries/RequestsLibrary.py
+Library           ../../../libraries/Common.py
+Library           ../../../libraries/Topologynew.py
+Variables         ../../../variables/Variables.py
+Resource          ../../../libraries/Utils.txt
+
+*** Variables ***
+${nodeprefix}     openflow:
+${key}            portStatistics
+${REST_CONTEXT}    /controller/nb/v2/statistics
+
+*** Test Cases ***
+get port stats
+    [Documentation]    Show port stats and validate result
+    [Tags]    adsal
+    ${topo_nodes}    Get Nodes From Tree Topo    (${TOPO_TREE_DEPTH},${TOPO_TREE_FANOUT})    1
+    @{node_list}    Create Nodes List    ${topo_nodes}
+    Wait Until Keyword Succeeds    70s    2s    Check For Elements At URI    ${REST_CONTEXT}/${CONTAINER}/port    ${node_list}
+
+get flow stats
+    [Documentation]    Show flow stats and validate result
+    [Tags]    adsal
+    ${topo_nodes}    Get Nodes From Tree Topo    (${TOPO_TREE_DEPTH},${TOPO_TREE_FANOUT})
+    @{node_list}    Create Nodes List    ${topo_nodes}
+    Wait Until Keyword Succeeds    70s    2s    Check For Elements At URI    ${REST_CONTEXT}/${CONTAINER}/flow    ${node_list}
+
+get table stats
+    [Documentation]    Show flow stats and validate result
+    [Tags]    adsal
+    ${topo_nodes}    Get Nodes From Tree Topo    (${TOPO_TREE_DEPTH},${TOPO_TREE_FANOUT})
+    @{node_list}    Create Nodes List    ${topo_nodes}
+    Wait Until Keyword Succeeds    70s    2s    Check For Elements At URI    ${REST_CONTEXT}/${CONTAINER}/table    ${node_list}
+
+*** Keywords ***
+Check For Correct Number Of Nodes At URI
+    [Arguments]    ${uri}    ${topo_nodes}
+    ${resp}    RequestsLibrary.Get    session    ${REST_CONTEXT}/${CONTAINER}/${uri}
+    Log    ${resp.content}
+    Should Be Equal As Strings    ${resp.status_code}    200
+    Should Contain X Times    ${resp.content}    "00:00:00:00:00:00:00:01"    ${TOPO_TREE_FANOUT+2}
+    : FOR    ${ITEM}    IN    @{topo_nodes}
+    \    ${IND}    Get From Dictionary    ${ITEM}    id
+    \    Should Contain X Times    ${resp.content}    "${IND}"    ${TOPO_TREE_FANOUT+3}
+
+Check For All Nodes At URI
+    [Arguments]    ${uri}    ${topo_nodes}
+    ${resp}    RequestsLibrary.Get    session    ${REST_CONTEXT}/${CONTAINER}/${uri}
+    Log    ${resp.content}
+    Should Be Equal As Strings    ${resp.status_code}    200
+    : FOR    ${ITEM}    IN    @{topo_nodes}
+    \    ${IND}    Get From Dictionary    ${ITEM}    id
+    \    Should Contain    ${resp.content}    "${IND}"
+
+Create Nodes List
+    [Arguments]    ${topo_dict}
+    ##init list
+    @{node_list}=    Create List
+    : FOR    ${ITEM}    IN    @{topo_dict}
+    \    ${IND}    Get From Dictionary    ${ITEM}    id
+    \    Append To List    ${node_list}    ${IND}
+    [Return]    @{node_list}
diff --git a/test/csit/suites/controller/Inventory_Scalability_OF10/050__topology_manager.txt b/test/csit/suites/controller/Inventory_Scalability_OF10/050__topology_manager.txt
new file mode 100644 (file)
index 0000000..ac9b1eb
--- /dev/null
@@ -0,0 +1,35 @@
+*** Settings ***
+Documentation     Test suite for Topology Manager
+Suite Setup       Create Session    session    http://${CONTROLLER}:${RESTPORT}    auth=${AUTH}    headers=${HEADERS}
+Suite Teardown    Delete All Sessions
+Library           Collections
+Library           ../../../libraries/RequestsLibrary.py
+Library           ../../../libraries/Common.py
+Library           ../../../libraries/Topologynew.py
+Variables         ../../../variables/Variables.py
+
+*** Variables ***
+${nodeprefix}     openflow:
+${REST_CONTEXT}    /controller/nb/v2/topology
+
+*** Test Cases ***
+Get Topology
+    [Documentation]    Get Topology and validate the result.
+    [Tags]    adsal
+    ${TOPO_TREE_DEPTH}    Convert To Integer    ${TOPO_TREE_DEPTH}
+    ${TOPO_TREE_FANOUT}    Convert To Integer    ${TOPO_TREE_FANOUT}
+    ${leaflist}    Get Ids Of Leaf Nodes    ${TOPO_TREE_FANOUT}    ${TOPO_TREE_DEPTH}
+    ${topo_nodes}    Get Nodes From Tree Topo    (${TOPO_TREE_DEPTH},${TOPO_TREE_FANOUT})    1
+    Wait Until Keyword Succeeds    30s    2s    Check Link Counts For Each Node    ${topo_nodes}    ${leaflist}
+
+*** Keywords ***
+Check Link Counts For Each Node
+    [Arguments]    ${topo_nodes}    ${leaflist}
+    ${resp}    RequestsLibrary.Get    session    ${REST_CONTEXT}/${CONTAINER}
+    Log    ${resp.content}
+    Should Be Equal As Strings    ${resp.status_code}    200
+    Should Contain X Times    ${resp.content}    "00:00:00:00:00:00:00:01"    ${TOPO_TREE_FANOUT*2}
+    : FOR    ${ITEM}    IN    @{topo_nodes}
+    \    ${IND}    Get From Dictionary    ${ITEM}    id
+    \    ${linkcnt}    Num Of Links For Node    ${IND}    ${leaflist}    ${TOPO_TREE_FANOUT}
+    \    Should Contain X Times    ${resp.content}    "${IND}"    ${linkcnt*2}
diff --git a/test/csit/suites/controller/Inventory_Scalability_OF10/__init__.txt b/test/csit/suites/controller/Inventory_Scalability_OF10/__init__.txt
new file mode 100644 (file)
index 0000000..023ae20
--- /dev/null
@@ -0,0 +1,31 @@
+*** Settings ***
+Documentation     Test suite for Inventory Scalability
+Suite Setup       Start Suite
+Suite Teardown    Stop Suite
+Library           SSHLibrary
+Library           ../../../libraries/Common.py
+Variables         ../../../variables/Variables.py
+
+*** Variables ***
+${start}          sudo mn --controller=remote,ip=${CONTROLLER} --topo tree,${TOPO_TREE_DEPTH},${TOPO_TREE_FANOUT}
+
+*** Keywords ***
+Start Suite
+    Log    Start mininet
+    ${TOPO_TREE_DEPTH}    Convert To Integer    ${TOPO_TREE_DEPTH}
+    ${TOPO_TREE_FANOUT}    Convert To Integer    ${TOPO_TREE_FANOUT}
+    ${numnodes}    Num Of Nodes    ${TOPO_TREE_DEPTH}    ${TOPO_TREE_FANOUT}
+    Open Connection    ${MININET}    prompt=>    timeout=${numnodes*2}
+    Login With Public Key    ${MININET_USER}    ${USER_HOME}/.ssh/id_rsa    any
+    Write    sudo ovs-vsctl set-manager ptcp:6644
+    Write    sudo mn -c
+    Read Until    >
+    Write    ${start}
+    Read Until    mininet>
+
+Stop Suite
+    Log    Stop mininet
+    Read
+    Write    exit
+    Read Until    >
+    Close Connection
diff --git a/test/csit/suites/controller/Inventory_Scalability_OF13/010__restconf_inventory.txt b/test/csit/suites/controller/Inventory_Scalability_OF13/010__restconf_inventory.txt
new file mode 100644 (file)
index 0000000..797334a
--- /dev/null
@@ -0,0 +1,71 @@
+*** Settings ***
+Documentation     Test suite for RESTCONF inventory
+Suite Setup       Create Session    session    http://${CONTROLLER}:${RESTCONFPORT}    auth=${AUTH}    headers=${HEADERS_XML}
+Suite Teardown    Delete All Sessions
+Library           Collections
+Library           ../../../libraries/RequestsLibrary.py
+Library           ../../../libraries/Common.py
+Variables         ../../../variables/Variables.py
+
+*** Variables ***
+${REST_CONTEXT}    /restconf/operational/opendaylight-inventory:nodes
+
+*** Test Cases ***
+Get list of nodes
+    [Documentation]    Get the inventory
+    ${TOPO_TREE_DEPTH}    Convert To Integer    ${TOPO_TREE_DEPTH}
+    ${TOPO_TREE_FANOUT}    Convert To Integer    ${TOPO_TREE_FANOUT}
+    ${numnodes}    Num Of Nodes    ${TOPO_TREE_DEPTH}    ${TOPO_TREE_FANOUT}
+    Wait Until Keyword Succeeds    30s    2s    Check Every Nodes    ${numnodes}
+
+Get nodeconnector for the root node
+    [Documentation]    Get the inventory for the root node
+    ${TOPO_TREE_FANOUT}    Convert To Integer    ${TOPO_TREE_FANOUT}
+    ${resp}    RequestsLibrary.Get    session    ${REST_CONTEXT}/node/openflow:1
+    Log    ${resp.content}
+    Should Be Equal As Strings    ${resp.status_code}    200
+    Wait Until Keyword Succeeds    30s    2s    Check conn loop    ${TOPO_TREE_FANOUT}    1    ${resp.content}
+
+Get nodeconnector for a node
+    [Documentation]    Get the inventory for a node
+    ${TOPO_TREE_DEPTH}    Convert To Integer    ${TOPO_TREE_DEPTH}
+    ${TOPO_TREE_FANOUT}    Convert To Integer    ${TOPO_TREE_FANOUT}
+    ${numnodes}    Num Of Nodes    ${TOPO_TREE_DEPTH}    ${TOPO_TREE_FANOUT}
+    Wait Until Keyword Succeeds    30s    2s    Check Every Nodes Nodeconnector    ${numnodes}
+
+Get Stats for a node
+    [Documentation]    Get the stats for a node
+    ${TOPO_TREE_DEPTH}    Convert To Integer    ${TOPO_TREE_DEPTH}
+    ${TOPO_TREE_FANOUT}    Convert To Integer    ${TOPO_TREE_FANOUT}
+    ${numnodes}    Num Of Nodes    ${TOPO_TREE_DEPTH}    ${TOPO_TREE_FANOUT}
+    Wait Until Keyword Succeeds    120s    2s    Check Every Nodes Stats    ${numnodes}
+
+*** Keywords ***
+Check Every Nodes
+    [Arguments]    ${numnodes}
+    ${resp}    RequestsLibrary.Get    session    ${REST_CONTEXT}
+    Should Be Equal As Strings    ${resp.status_code}    200
+    : FOR    ${IND}    IN RANGE    1    ${numnodes+1}
+    \    Should Contain    ${resp.content}    openflow:${IND}
+
+Check Every Nodes Stats
+    [Arguments]    ${numnodes}
+    : FOR    ${IND}    IN RANGE    1    ${numnodes+1}
+    \    ${resp}    RequestsLibrary.Get    session    ${REST_CONTEXT}/node/openflow:${IND}
+    \    Log    ${resp.content}
+    \    Should Be Equal As Strings    ${resp.status_code}    200
+    \    Should Contain    ${resp.content}    flow-capable-node-connector-statistics
+    \    Should Contain    ${resp.content}    flow-table-statistics
+
+Check Every Nodes Nodeconnector
+    [Arguments]    ${numnodes}
+    : FOR    ${IND}    IN RANGE    2    ${numnodes+1}
+    \    ${resp}    RequestsLibrary.Get    session    ${REST_CONTEXT}/node/openflow:${IND}
+    \    Log    ${resp.content}
+    \    Should Be Equal As Strings    ${resp.status_code}    200
+    \    Check conn loop    ${TOPO_TREE_FANOUT+1}    ${IND}    ${resp.content}
+
+Check conn loop
+    [Arguments]    ${arg}    ${outerind}    ${content}
+    : FOR    ${var}    IN RANGE    1    ${arg+1}
+    \    Should Contain    ${content}    openflow:${outerind}:${var}
diff --git a/test/csit/suites/controller/Inventory_Scalability_OF13/020__restconf_topology.txt b/test/csit/suites/controller/Inventory_Scalability_OF13/020__restconf_topology.txt
new file mode 100644 (file)
index 0000000..8ad05ed
--- /dev/null
@@ -0,0 +1,37 @@
+*** Settings ***
+Documentation     Test suite for RESTCONF topology
+Suite Setup       Create Session    session    http://${CONTROLLER}:${RESTCONFPORT}    auth=${AUTH}    headers=${HEADERS_XML}
+Suite Teardown    Delete All Sessions
+Library           Collections
+Library           XML
+Library           ../../../libraries/RequestsLibrary.py
+Library           ../../../libraries/Common.py
+Variables         ../../../variables/Variables.py
+
+*** Variables ***
+${REST_CONTEXT}    /restconf/operational/network-topology:network-topology/topology/flow:1
+
+*** Test Cases ***
+Get Nodes Count
+    [Documentation]    Checks the number of switches
+    ${TOPO_TREE_DEPTH}    Convert To Integer    ${TOPO_TREE_DEPTH}
+    ${TOPO_TREE_FANOUT}    Convert To Integer    ${TOPO_TREE_FANOUT}
+    ${numnodes}    Num Of Nodes    ${TOPO_TREE_DEPTH}    ${TOPO_TREE_FANOUT}
+    Wait Until Keyword Succeeds    60s    2s    Verify Element Count    ${REST_CONTEXT}    node    ${numnodes}
+
+Get Links Count
+    [Documentation]    Checks the number of links
+    ${TOPO_TREE_DEPTH}    Convert To Integer    ${TOPO_TREE_DEPTH}
+    ${TOPO_TREE_FANOUT}    Convert To Integer    ${TOPO_TREE_FANOUT}
+    ${numnodes}    Num Of Nodes    ${TOPO_TREE_DEPTH}    ${TOPO_TREE_FANOUT}
+    ${numlinks}    Evaluate    (${numnodes}-1)*2
+    Wait Until Keyword Succeeds    60s    2s    Verify Element Count    ${REST_CONTEXT}    link    ${numlinks}
+
+*** Keywords ***
+Verify Element Count
+    [Arguments]    ${URI}    ${xpath_location}    ${expected_count}
+    ${resp}    RequestsLibrary.Get    session    ${REST_CONTEXT}    headers=${ACCEPT_XML}
+    Log    ${resp.content}
+    Should Be Equal As Strings    ${resp.status_code}    200
+    ${count}=    Get Element Count    ${resp.content}    xpath=${xpath_location}
+    Should Be Equal As Numbers    ${count}    ${expected_count}
diff --git a/test/csit/suites/controller/Inventory_Scalability_OF13/030__switch_manager.txt b/test/csit/suites/controller/Inventory_Scalability_OF13/030__switch_manager.txt
new file mode 100644 (file)
index 0000000..f3c0ff7
--- /dev/null
@@ -0,0 +1,56 @@
+*** Settings ***
+Documentation     Test suite for Switch Manager
+Suite Setup       Create Session    ${ODL_CONTROLLER_SESSION}    http://${CONTROLLER}:${RESTPORT}    auth=${AUTH}    headers=${HEADERS}
+Suite Teardown    Delete All Sessions
+Library           Collections
+Library           RequestsLibrary
+Library           ../../../libraries/Common.py
+Library           ../../../libraries/SwitchManager.py
+Variables         ../../../variables/Variables.py
+Library           ../../../libraries/Topologynew.py
+
+*** Variables ***
+${REST_CONTEXT}    /controller/nb/v2/switchmanager
+
+*** Test Cases ***
+List all nodes
+    [Documentation]    List all nodes and their properties in the network.
+    [Tags]    adsal
+    Log    ${TOPO_TREE_LEVEL}
+    ${topo_nodes}    Get Nodes From Tree Topo    (${TOPO_TREE_DEPTH},${TOPO_TREE_FANOUT})
+    ${resp}    RequestsLibrary.Get    ${ODL_CONTROLLER_SESSION}    ${REST_CONTEXT}/default/nodes
+    Log    ${resp.content}
+    Should Be Equal As Strings    ${resp.status_code}    200    Response    status code error
+    ${jsondata}=    To JSON    ${resp.content}
+    ${nodes}    Extract All Nodes    ${jsondata}
+    List Should Contain Sublist    ${nodes}    ${topo_nodes}
+
+Check root node connectors
+    [Documentation]    List node connectors and verify all connectors are there
+    [Tags]    adsal
+    ${resp}    RequestsLibrary.Get    ${ODL_CONTROLLER_SESSION}    ${REST_CONTEXT}/default/node/OF/00:00:00:00:00:00:00:01
+    Log    ${resp.content}
+    Should Be Equal As Strings    ${resp.status_code}    200    Response    status code error
+    ${TOPO_TREE_FANOUT}    Convert To Integer    ${TOPO_TREE_FANOUT}
+    Check conn loop    ${TOPO_TREE_FANOUT}    1    ${resp.content}
+
+Check node i connectors
+    [Documentation]    List node connectors and verify all connectors are there
+    [Tags]    adsal
+    ${topo_nodes}    Get Nodes From Tree Topo    (${TOPO_TREE_DEPTH},${TOPO_TREE_FANOUT})    1
+    Wait Until Keyword Succeeds    30s    2s    Check Every Nodes Connectors    ${topo_nodes}
+
+*** Keywords ***
+Check Every Nodes Connectors
+    [Arguments]    ${topo_nodes}
+    : FOR    ${ITEM}    IN    @{topo_nodes}
+    \    ${IND}    Get From Dictionary    ${ITEM}    id
+    \    ${resp}    RequestsLibrary.Get    ${ODL_CONTROLLER_SESSION}    ${REST_CONTEXT}/default/node/OF/${IND}
+    \    Log    ${resp.content}
+    \    Should Be Equal As Strings    ${resp.status_code}    200
+    \    Check conn loop    ${TOPO_TREE_FANOUT+1}    ${IND}    ${resp.content}
+
+Check conn loop
+    [Arguments]    ${arg}    ${outerind}    ${content}
+    : FOR    ${var}    IN RANGE    0    ${arg+1}
+    \    Should Contain    ${content}    "id":"${var}"
diff --git a/test/csit/suites/controller/Inventory_Scalability_OF13/040__statistics_manager.txt b/test/csit/suites/controller/Inventory_Scalability_OF13/040__statistics_manager.txt
new file mode 100644 (file)
index 0000000..b8e864a
--- /dev/null
@@ -0,0 +1,66 @@
+*** Settings ***
+Documentation     Test suite for Statistics Manager
+Suite Setup       Create Session    session    http://${CONTROLLER}:${RESTPORT}    auth=${AUTH}    headers=${HEADERS}
+Suite Teardown    Delete All Sessions
+Library           Collections
+Library           ../../../libraries/RequestsLibrary.py
+Library           ../../../libraries/Common.py
+Library           ../../../libraries/Topologynew.py
+Variables         ../../../variables/Variables.py
+Resource          ../../../libraries/Utils.txt
+
+*** Variables ***
+${nodeprefix}     openflow:
+${key}            portStatistics
+${REST_CONTEXT}    /controller/nb/v2/statistics
+
+*** Test Cases ***
+get port stats
+    [Documentation]    Show port stats and validate result
+    [Tags]    adsal
+    ${topo_nodes}    Get Nodes From Tree Topo    (${TOPO_TREE_DEPTH},${TOPO_TREE_FANOUT})    1
+    @{node_list}    Create Nodes List    ${topo_nodes}
+    Wait Until Keyword Succeeds    70s    2s    Check For Elements At URI    ${REST_CONTEXT}/${CONTAINER}/port    ${node_list}
+
+get flow stats
+    [Documentation]    Show flow stats and validate result
+    [Tags]    adsal
+    ${topo_nodes}    Get Nodes From Tree Topo    (${TOPO_TREE_DEPTH},${TOPO_TREE_FANOUT})
+    @{node_list}    Create Nodes List    ${topo_nodes}
+    Wait Until Keyword Succeeds    70s    2s    Check For Elements At URI    ${REST_CONTEXT}/${CONTAINER}/flow    ${node_list}
+
+get table stats
+    [Documentation]    Show flow stats and validate result
+    [Tags]    adsal
+    ${topo_nodes}    Get Nodes From Tree Topo    (${TOPO_TREE_DEPTH},${TOPO_TREE_FANOUT})
+    @{node_list}    Create Nodes List    ${topo_nodes}
+    Wait Until Keyword Succeeds    70s    2s    Check For Elements At URI    ${REST_CONTEXT}/${CONTAINER}/table    ${node_list}
+
+*** Keywords ***
+Check For Correct Number Of Nodes At URI
+    [Arguments]    ${uri}    ${topo_nodes}
+    ${resp}    RequestsLibrary.Get    session    ${REST_CONTEXT}/${CONTAINER}/${uri}
+    Log    ${resp.content}
+    Should Be Equal As Strings    ${resp.status_code}    200
+    Should Contain X Times    ${resp.content}    "00:00:00:00:00:00:00:01"    ${TOPO_TREE_FANOUT+2}
+    : FOR    ${ITEM}    IN    @{topo_nodes}
+    \    ${IND}    Get From Dictionary    ${ITEM}    id
+    \    Should Contain X Times    ${resp.content}    "${IND}"    ${TOPO_TREE_FANOUT+3}
+
+Check For All Nodes At URI
+    [Arguments]    ${uri}    ${topo_nodes}
+    ${resp}    RequestsLibrary.Get    session    ${REST_CONTEXT}/${CONTAINER}/${uri}
+    Log    ${resp.content}
+    Should Be Equal As Strings    ${resp.status_code}    200
+    : FOR    ${ITEM}    IN    @{topo_nodes}
+    \    ${IND}    Get From Dictionary    ${ITEM}    id
+    \    Should Contain    ${resp.content}    "${IND}"
+
+Create Nodes List
+    [Arguments]    ${topo_dict}
+    ##init list
+    @{node_list}=    Create List
+    : FOR    ${ITEM}    IN    @{topo_dict}
+    \    ${IND}    Get From Dictionary    ${ITEM}    id
+    \    Append To List    ${node_list}    ${IND}
+    [Return]    @{node_list}
diff --git a/test/csit/suites/controller/Inventory_Scalability_OF13/050__topology_manager.txt b/test/csit/suites/controller/Inventory_Scalability_OF13/050__topology_manager.txt
new file mode 100644 (file)
index 0000000..ac9b1eb
--- /dev/null
@@ -0,0 +1,35 @@
+*** Settings ***
+Documentation     Test suite for Topology Manager
+Suite Setup       Create Session    session    http://${CONTROLLER}:${RESTPORT}    auth=${AUTH}    headers=${HEADERS}
+Suite Teardown    Delete All Sessions
+Library           Collections
+Library           ../../../libraries/RequestsLibrary.py
+Library           ../../../libraries/Common.py
+Library           ../../../libraries/Topologynew.py
+Variables         ../../../variables/Variables.py
+
+*** Variables ***
+${nodeprefix}     openflow:
+${REST_CONTEXT}    /controller/nb/v2/topology
+
+*** Test Cases ***
+Get Topology
+    [Documentation]    Get Topology and validate the result.
+    [Tags]    adsal
+    ${TOPO_TREE_DEPTH}    Convert To Integer    ${TOPO_TREE_DEPTH}
+    ${TOPO_TREE_FANOUT}    Convert To Integer    ${TOPO_TREE_FANOUT}
+    ${leaflist}    Get Ids Of Leaf Nodes    ${TOPO_TREE_FANOUT}    ${TOPO_TREE_DEPTH}
+    ${topo_nodes}    Get Nodes From Tree Topo    (${TOPO_TREE_DEPTH},${TOPO_TREE_FANOUT})    1
+    Wait Until Keyword Succeeds    30s    2s    Check Link Counts For Each Node    ${topo_nodes}    ${leaflist}
+
+*** Keywords ***
+Check Link Counts For Each Node
+    [Arguments]    ${topo_nodes}    ${leaflist}
+    ${resp}    RequestsLibrary.Get    session    ${REST_CONTEXT}/${CONTAINER}
+    Log    ${resp.content}
+    Should Be Equal As Strings    ${resp.status_code}    200
+    Should Contain X Times    ${resp.content}    "00:00:00:00:00:00:00:01"    ${TOPO_TREE_FANOUT*2}
+    : FOR    ${ITEM}    IN    @{topo_nodes}
+    \    ${IND}    Get From Dictionary    ${ITEM}    id
+    \    ${linkcnt}    Num Of Links For Node    ${IND}    ${leaflist}    ${TOPO_TREE_FANOUT}
+    \    Should Contain X Times    ${resp.content}    "${IND}"    ${linkcnt*2}
diff --git a/test/csit/suites/controller/Inventory_Scalability_OF13/__init__.txt b/test/csit/suites/controller/Inventory_Scalability_OF13/__init__.txt
new file mode 100644 (file)
index 0000000..2f1d3dc
--- /dev/null
@@ -0,0 +1,31 @@
+*** Settings ***
+Documentation     Test suite for Inventory Scalability
+Suite Setup       Start Suite
+Suite Teardown    Stop Suite
+Library           SSHLibrary
+Library           ../../../libraries/Common.py
+Variables         ../../../variables/Variables.py
+
+*** Variables ***
+${start}          sudo mn --controller=remote,ip=${CONTROLLER} --topo tree,${TOPO_TREE_DEPTH},${TOPO_TREE_FANOUT} --switch ovsk,protocols=OpenFlow13
+
+*** Keywords ***
+Start Suite
+    Log    Start mininet
+    ${TOPO_TREE_DEPTH}    Convert To Integer    ${TOPO_TREE_DEPTH}
+    ${TOPO_TREE_FANOUT}    Convert To Integer    ${TOPO_TREE_FANOUT}
+    ${numnodes}    Num Of Nodes    ${TOPO_TREE_DEPTH}    ${TOPO_TREE_FANOUT}
+    Open Connection    ${MININET}    prompt=>    timeout=${numnodes*2}
+    Login With Public Key    ${MININET_USER}    ${USER_HOME}/.ssh/id_rsa    any
+    Write    sudo ovs-vsctl set-manager ptcp:6644
+    Write    sudo mn -c
+    Read Until    >
+    Write    ${start}
+    Read Until    mininet>
+
+Stop Suite
+    Log    Stop mininet
+    Read
+    Write    exit
+    Read Until    >
+    Close Connection
diff --git a/test/csit/suites/controller/MD_SAL_Cluster_Datastore/001_start_cluster.txt b/test/csit/suites/controller/MD_SAL_Cluster_Datastore/001_start_cluster.txt
new file mode 100644 (file)
index 0000000..da9264a
--- /dev/null
@@ -0,0 +1,38 @@
+*** Settings ***
+Documentation     Start the controllers
+Library           Collections
+Library           ../../../libraries/RequestsLibrary.py
+Library           ../../../libraries/Common.py
+Library           ../../../libraries/CrudLibrary.py
+Library           ../../../libraries/SettingsLibrary.py
+Library           ../../../libraries/UtilLibrary.py
+Variables         ../../../variables/Variables.py
+
+*** Variables ***
+${REST_CONTEXT}    /restconf/config/
+
+*** Test Cases *** 
+Stop All Controllers
+    [Documentation]    Stop all the controllers in the cluster
+    Stopcontroller    ${MEMBER1}    ${USER_NAME}    ${PASSWORD}    ${KARAF_HOME}
+    Stopcontroller    ${MEMBER2}    ${USER_NAME}    ${PASSWORD}    ${KARAF_HOME}
+    Stopcontroller    ${MEMBER3}    ${USER_NAME}    ${PASSWORD}    ${KARAF_HOME}
+    Sleep    30
+    KillController    ${MEMBER1}    ${USER_NAME}    ${PASSWORD}    ${KARAF_HOME}
+    KillController    ${MEMBER2}    ${USER_NAME}    ${PASSWORD}    ${KARAF_HOME}
+    KillController    ${MEMBER3}    ${USER_NAME}    ${PASSWORD}    ${KARAF_HOME}
+
+
+Clean All Journals
+    [Documentation]    Clean the journals of all the controllers in the cluster
+    CleanJournal    ${MEMBER1}    ${USER_NAME}    ${PASSWORD}    ${KARAF_HOME}
+    CleanJournal    ${MEMBER2}    ${USER_NAME}    ${PASSWORD}    ${KARAF_HOME}
+    CleanJournal    ${MEMBER3}    ${USER_NAME}    ${PASSWORD}    ${KARAF_HOME}
+    Sleep    5
+
+Start All Controllers
+    [Documentation]    Start all the controllers in the cluster
+    Startcontroller    ${MEMBER1}    ${USER_NAME}    ${PASSWORD}    ${KARAF_HOME}
+    Startcontroller    ${MEMBER2}    ${USER_NAME}    ${PASSWORD}    ${KARAF_HOME}
+    Startcontroller    ${MEMBER3}    ${USER_NAME}    ${PASSWORD}    ${KARAF_HOME}
+    Sleep    120
\ No newline at end of file
diff --git a/test/csit/suites/controller/MD_SAL_Cluster_Datastore/010_crud_on_leader.txt b/test/csit/suites/controller/MD_SAL_Cluster_Datastore/010_crud_on_leader.txt
new file mode 100644 (file)
index 0000000..f09db2f
--- /dev/null
@@ -0,0 +1,83 @@
+*** Settings ***
+Documentation     This test finds the leader for shards in a 3-Node cluster and executes CRUD operations on them
+
+Library           Collections
+Library           ../../../libraries/RequestsLibrary.py
+Library           ../../../libraries/Common.py
+Library           ../../../libraries/CrudLibrary.py
+Library           ../../../libraries/SettingsLibrary.py
+Library           ../../../libraries/UtilLibrary.py
+Library           ../../../libraries/ClusterStateLibrary.py
+Variables         ../../../variables/Variables.py
+
+
+*** Variables ***
+${REST_CONTEXT}    /restconf/config/
+${SHARD_CAR_NAME}      shard-car-config
+${SHARD_PEOPLE_NAME}      shard-people-config
+${SHARD_CAR_PERSON_NAME}      shard-car-people-config
+
+
+*** Test Cases ***
+Add cars and get cars from Leader
+    [Documentation]    Add 100 cars and get added cars from Leader
+    ${CURRENT_CAR_LEADER}   GetLeader   ${SHARD_CAR_NAME}   ${3}    ${3}    ${1}    ${PORT}     ${MEMBER1}   ${MEMBER2}    ${MEMBER3}
+    Log    CURRENT_CAR_SHARD_LEADER ${CURRENT_CAR_LEADER}
+    Set Suite Variable  ${CURRENT_CAR_LEADER}
+       ${resp}         AddCar  ${CURRENT_CAR_LEADER}   ${PORT} ${100}
+       ${resp}         Getcars ${CURRENT_CAR_LEADER}   ${PORT} ${0}
+       Should Be Equal As Strings    ${resp.status_code}    200
+       Should Contain     ${resp.content}   manufacturer1
+
+Add persons and get persons from Leader
+    [Documentation]    Add 100 persons and get persons
+    [Documentation]    Note: There should be one person added first to enable rpc
+    ${CURRENT_PEOPLE_LEADER}   GetLeader   ${SHARD_PEOPLE_NAME}   ${3}    ${3}    ${1}    ${PORT}     ${MEMBER1}   ${MEMBER2}    ${MEMBER3}
+    Set Suite Variable  ${CURRENT_PEOPLE_LEADER}
+       ${resp}         AddPerson       ${CURRENT_PEOPLE_LEADER}        ${PORT} ${0}
+       ${resp}         AddPerson       ${CURRENT_PEOPLE_LEADER}        ${PORT} ${100}
+       ${resp}         GetPersons      ${CURRENT_PEOPLE_LEADER}        ${PORT} ${0}
+       Should Be Equal As Strings    ${resp.status_code}    200
+       Should Contain     ${resp.content}   user5
+
+Add car-person mapping and get car-person mapping from Leader
+    [Documentation]    Add car-person and get car-person from Leader
+    [Documentation]  Note: This is done to enable working of rpc
+    ${CURRENT_CAR_PERSON_LEADER}   GetLeader   ${SHARD_CAR_PERSON_NAME}   ${3}    ${3}    ${1}    ${PORT}     ${MEMBER1}   ${MEMBER2}  ${MEMBER3}
+    Set Suite Variable  ${CURRENT_CAR_PERSON_LEADER}
+       ${resp}         AddCarPerson    ${CURRENT_CAR_PERSON_LEADER}   ${PORT}     ${0}
+       Sleep       2
+       ${resp}         GetCarPersonMappings    ${CURRENT_CAR_PERSON_LEADER}   ${PORT}     ${0}
+       Should Be Equal As Strings    ${resp.status_code}    200
+       Should Contain     ${resp.content}   user0
+
+Purchase 100 cars using Leader
+    [Documentation]  Purchase 100 cars using Leader
+       ${resp}         BuyCar  ${CURRENT_CAR_PERSON_LEADER}    ${PORT} ${100}
+    Sleep       2
+       ${resp}         GetCarPersonMappings    ${CURRENT_CAR_PERSON_LEADER}    ${PORT} ${0}
+       Should Be Equal As Strings    ${resp.status_code}    200
+
+Get car-person mappings using Leader
+   [Documentation]     Get car-person mappings using Leader to see 100 entry
+       ${resp}         GetCarPersonMappings    ${CURRENT_CAR_PERSON_LEADER}    ${PORT} ${0}
+       Should Be Equal As Strings    ${resp.status_code}    200
+       Should Contain     ${resp.content}   user100
+
+Get car-person mappings using Follower1
+   [Documentation]     Get car-person mappings using Follower1 to see 100 entry
+   ${FOLLOWERS}   GetFollowers   ${SHARD_CAR_PERSON_NAME}   ${3}    ${3}    ${1}    ${PORT}     ${MEMBER1}   ${MEMBER2}    ${MEMBER3}
+   Log                 ${FOLLOWERS}
+   SET SUITE VARIABLE  ${FOLLOWERS}
+       ${resp}         GetCarPersonMappings    ${FOLLOWERS[0]}     ${PORT}     ${0}
+       Should Be Equal As Strings    ${resp.status_code}    200
+       Should Contain     ${resp.content}   user100
+       Should Contain     ${resp.content}   user5
+
+
+Get car-person mappings using Follower2
+   [Documentation]     Get car-person mappings using Follower2 to see 100 entry
+       ${resp}         GetCarPersonMappings    ${FOLLOWERS[1]}     ${PORT}     ${0}
+       Should Be Equal As Strings    ${resp.status_code}    200
+       Should Contain     ${resp.content}   user0
+       Should Contain     ${resp.content}   user100
diff --git a/test/csit/suites/controller/MD_SAL_Cluster_Datastore/020_crud_on_any_follower.txt b/test/csit/suites/controller/MD_SAL_Cluster_Datastore/020_crud_on_any_follower.txt
new file mode 100644 (file)
index 0000000..baaa24e
--- /dev/null
@@ -0,0 +1,81 @@
+*** Settings ***
+Documentation     This test finds the followers of certain shards in a 3-Node cluster and executes CRUD operations on any one follower
+
+Library           Collections
+Library           ../../../libraries/RequestsLibrary.py
+Library           ../../../libraries/Common.py
+Library           ../../../libraries/CrudLibrary.py
+Library           ../../../libraries/SettingsLibrary.py
+Library           ../../../libraries/UtilLibrary.py
+Library           ../../../libraries/ClusterStateLibrary.py
+Variables         ../../../variables/Variables.py
+
+*** Variables ***
+${REST_CONTEXT}    /restconf/config/
+${SHARD_CAR_NAME}      shard-car-config
+${SHARD_PEOPLE_NAME}      shard-people-config
+${SHARD_CAR_PERSON_NAME}      shard-car-people-config
+
+
+*** Test Cases ***
+Add cars and get cars from Follower1
+    [Documentation]    Add 100 cars and get added cars from Follower1
+    ${FOLLOWERS}   GetFollowers   ${SHARD_CAR_PERSON_NAME}   ${3}    ${3}    ${1}    ${PORT}     ${MEMBER1}   ${MEMBER2}    ${MEMBER3}
+    Log                ${FOLLOWERS}
+    SET SUITE VARIABLE  ${FOLLOWERS}
+
+       ${resp}         AddCar  ${FOLLOWERS[0]} ${PORT} ${100}
+       Sleep   1
+       ${resp}         Getcars ${FOLLOWERS[0]} ${PORT} ${0}
+       Should Be Equal As Strings    ${resp.status_code}    200
+       Should Contain     ${resp.content}   manufacturer1
+
+Add persons and get persons from Follower1
+    [Documentation]    Add 100 persons and get persons from Follower1
+    [Documentation]    Note: There should be one person added first to enable rpc
+       ${resp}         AddPerson       ${FOLLOWERS[0]} ${PORT} ${0}
+       ${resp}         AddPerson       ${FOLLOWERS[0]} ${PORT} ${100}
+       Sleep   1
+       ${resp}         GetPersons      ${FOLLOWERS[0]} ${PORT} ${0}
+       Should Be Equal As Strings    ${resp.status_code}    200
+       Should Contain     ${resp.content}   user5
+
+Add car-person mapping and get car-person mapping from Follower1
+    [Documentation]    Add car-person and get car-person from Follower1
+    [Documentation]  Note: This is done to enable working of rpc
+
+       ${resp}         AddCarPerson    ${FOLLOWERS[0]} ${PORT} ${0}
+       ${resp}         GetCarPersonMappings    ${FOLLOWERS[0]} ${PORT} ${0}
+       Should Be Equal As Strings    ${resp.status_code}    200
+       Should Contain     ${resp.content}   user0
+
+Purchase 100 cars using Follower1
+    [Documentation]  Purchase 100 cars using Follower1
+
+       ${resp}         BuyCar  ${FOLLOWERS[0]} ${PORT} ${100}
+       Sleep   1
+       ${resp}         GetCarPersonMappings    ${FOLLOWERS[0]} ${PORT} ${0}
+       Should Be Equal As Strings    ${resp.status_code}    200
+
+Get car-person mappings using Follower1
+   [Documentation]     Get car-person mappings using follower1 to see 100 entry
+       ${resp}         GetCarPersonMappings    ${FOLLOWERS[0]} ${PORT} ${0}
+       Should Be Equal As Strings    ${resp.status_code}    200
+       Should Contain     ${resp.content}   user100
+       Should Contain     ${resp.content}   user5
+
+Get car-person mappings using Leader
+   [Documentation]     Get car-person mappings using Leader to see 100 entry
+    ${CURRENT_CAR_LEADER}   GetLeader   ${SHARD_CAR_PERSON_NAME}   ${3}    ${3}    ${1}    ${PORT}     ${MEMBER1}   ${MEMBER2}    ${MEMBER3}
+    Log     ${CURRENT_CAR_LEADER}
+    Sleep   1
+       ${resp}         GetCarPersonMappings    ${CURRENT_CAR_LEADER}   ${PORT} ${0}
+       Should Be Equal As Strings    ${resp.status_code}    200
+       Should Contain     ${resp.content}   user100
+
+Get car-person mappings using Follower2
+   [Documentation]     Get car-person mappings using Follower2 to see 100 entry
+       ${resp}         GetCarPersonMappings    ${FOLLOWERS[1]} ${PORT} ${0}
+       Should Be Equal As Strings    ${resp.status_code}    200
+       Should Contain     ${resp.content}   user0
+       Should Contain     ${resp.content}   user100
diff --git a/test/csit/suites/controller/MD_SAL_Cluster_Datastore/030_failover_crud_on_new_leader.txt b/test/csit/suites/controller/MD_SAL_Cluster_Datastore/030_failover_crud_on_new_leader.txt
new file mode 100644 (file)
index 0000000..e40888d
--- /dev/null
@@ -0,0 +1,70 @@
+*** Settings ***
+Documentation     This test brings down the current leader of the "car" shard and then executes CRUD operations on the new leader
+Library           ../../../libraries/CrudLibrary.py
+Library           ../../../libraries/UtilLibrary.py
+Library           ../../../libraries/ClusterStateLibrary.py
+
+*** Variables ***
+${SHARD}    shard-car-config
+
+*** Test Cases ***
+Switch Leader
+    [Documentation]    stop leader and elect new leader
+  ${OLD_LEADER}    GetLeader  ${SHARD}  ${3}  ${3}  ${2}  ${8181}  ${MEMBER1}  ${MEMBER2}  ${MEMBER3}
+  Stopcontroller  ${OLD_LEADER}  ${USERNAME}  ${PASSWORD}  ${KARAFHOME}
+  Sleep    30
+  ${NEW_LEADER}    GetLeader  ${SHARD}  ${3}  ${3}  ${2}  ${8181}  ${MEMBER1}  ${MEMBER2}  ${MEMBER3}
+  Log  ${NEW_LEADER}
+  Set Suite Variable   ${NEW_LEADER}
+
+Delete cars at new leader
+    [Documentation]    delete cars
+  DeleteAllCars         ${NEW_LEADER}  ${PORT}  ${0}
+  ${resp}              Getcars ${NEW_LEADER}   ${PORT} ${0}
+  Should Be Equal As Strings    ${resp.status_code}    404
+
+Delete people at new leader
+    [Documentation]    delete people
+       DeleteAllPersons  ${NEW_LEADER}  ${PORT}  ${0}
+       ${resp}         GetPersons      ${NEW_LEADER}   ${PORT} ${0}
+  Should Be Equal As Strings    ${resp.status_code}    404
+
+Add cars and get cars from new leader
+    [Documentation]    Add 50 cars and get added cars from Leader
+       ${resp}         AddCar  ${NEW_LEADER}   ${PORT} ${50}
+       Sleep    10
+       ${resp}         Getcars ${NEW_LEADER}   ${PORT} ${0}
+       Should Be Equal As Strings    ${resp.status_code}    200
+       Should Contain     ${resp.content}   manufacturer1
+       Should Contain     ${resp.content}   manufacturer50
+       Should Not Contain     ${resp.content}   manufacturer60
+
+Add people and get people from leader
+    [Documentation]    Add 50 persons and get people
+    [Documentation]    Note: There should be one person added first to enable rpc
+       ${resp}         AddPerson       ${NEW_LEADER}   ${PORT} ${0}
+       ${resp}         AddPerson       ${NEW_LEADER}   ${PORT} ${50}
+       Sleep    10
+       ${resp}         GetPersons      ${NEW_LEADER}   ${PORT} ${0}
+       Should Be Equal As Strings    ${resp.status_code}    200
+       Should Contain     ${resp.content}   user2
+       Should Contain     ${resp.content}   user50
+       Should Not Contain     ${resp.content}   user60
+
+Purchase 50 cars at new leader
+    [Documentation]    Add car-person and get car-person from Leader
+    [Documentation]  Note: This is done to enable working of rpc
+    [Documentation]  Purchase 50 cars using Leader
+  ${resp}              AddCarPerson    ${NEW_LEADER}   ${PORT} ${0}
+       ${resp}         GetCarPersonMappings    ${NEW_LEADER}   ${PORT} ${0}
+       Should Be Equal As Strings    ${resp.status_code}    200
+       Should Contain     ${resp.content}   user0
+       ${resp}         BuyCar  ${NEW_LEADER}   ${PORT} ${50}
+       Sleep    10
+
+Get car-person mappings at new Leader
+   [Documentation]     Get car-person mappings using new leader to see 50 entry
+       ${resp}         GetCarPersonMappings    ${NEW_LEADER}   ${PORT} ${0}
+       Should Be Equal As Strings    ${resp.status_code}    200
+       Should Contain     ${resp.content}   user5
+       Should Contain     ${resp.content}   user50
\ No newline at end of file
diff --git a/test/csit/suites/controller/MD_SAL_Cluster_Datastore/040_failover_read_from_follower.txt b/test/csit/suites/controller/MD_SAL_Cluster_Datastore/040_failover_read_from_follower.txt
new file mode 100644 (file)
index 0000000..9cfd358
--- /dev/null
@@ -0,0 +1,38 @@
+*** Settings ***
+Documentation     This test tries to read the data that was written by the previous test from any one follower
+Library           ../../../libraries/CrudLibrary.py
+Library           ../../../libraries/ClusterStateLibrary.py
+
+*** Variables ***
+${SHARD}    shard-car-config
+
+*** Test Cases ***
+Find follower
+    [Documentation]    find follower
+  ${FOLLOWERS}    GetFollowers  ${SHARD}  ${3}  ${3}  ${2}  ${8181}  ${MEMBER1}  ${MEMBER2}  ${MEMBER3}
+  Log  ${FOLLOWERS}
+  ${LAST_FOLLOWER}  Set Variable  ${FOLLOWERS[0]}
+  Set Suite Variable   ${LAST_FOLLOWER}
+
+Get cars from last follower
+    [Documentation]    get 50 cars from last follower
+       ${resp}         Getcars ${LAST_FOLLOWER}        ${PORT} ${0}
+       Should Be Equal As Strings    ${resp.status_code}    200
+       Should Contain     ${resp.content}   manufacturer1
+       Should Contain     ${resp.content}   manufacturer50
+       Should Not Contain     ${resp.content}   manufacturer60
+
+Get people from last follower
+    [Documentation]    get 50 people
+       ${resp}         GetPersons      ${LAST_FOLLOWER}        ${PORT} ${0}
+       Should Be Equal As Strings    ${resp.status_code}    200
+       Should Contain     ${resp.content}   user2
+       Should Contain     ${resp.content}   user50
+       Should Not Contain     ${resp.content}   user60
+
+Get car-person mappings at last follower
+   [Documentation]     Get car-person mappings using last to see 50 entry
+       ${resp}         GetCarPersonMappings    ${LAST_FOLLOWER}        ${PORT} ${0}
+       Should Be Equal As Strings    ${resp.status_code}    200
+       Should Contain     ${resp.content}   user5
+       Should Contain     ${resp.content}   user50
\ No newline at end of file
diff --git a/test/csit/suites/controller/MD_SAL_Cluster_Datastore/050_failover_crud_on_any_follower.txt b/test/csit/suites/controller/MD_SAL_Cluster_Datastore/050_failover_crud_on_any_follower.txt
new file mode 100644 (file)
index 0000000..89bb931
--- /dev/null
@@ -0,0 +1,67 @@
+*** Settings ***
+Documentation     This test executes CRUD operations on any one follower after the old leader has been brought down
+Library           ../../../libraries/CrudLibrary.py
+Library           ../../../libraries/ClusterStateLibrary.py
+
+*** Variables ***
+${SHARD}    shard-car-config
+
+*** Test Cases ***
+Find follower
+    [Documentation]    find follower
+  ${FOLLOWERS}    GetFollowers  ${SHARD}  ${3}  ${3}  ${2}  ${8181}  ${MEMBER1}  ${MEMBER2}  ${MEMBER3}
+  Log  ${FOLLOWERS}
+  ${LAST_FOLLOWER}  Set Variable  ${FOLLOWERS[0]}
+  Set Suite Variable   ${LAST_FOLLOWER}
+
+Delete cars at last follower
+    [Documentation]    delete cars
+  DeleteAllCars         ${LAST_FOLLOWER}  ${PORT}  ${0}
+  ${resp}              Getcars ${LAST_FOLLOWER}        ${PORT} ${0}
+  Should Be Equal As Strings    ${resp.status_code}    404
+
+Delete people at last follower
+    [Documentation]    delete people
+       DeleteAllPersons  ${LAST_FOLLOWER}  ${PORT}  ${0}
+       ${resp}         GetPersons      ${LAST_FOLLOWER}        ${PORT} ${0}
+  Should Be Equal As Strings    ${resp.status_code}    404
+
+Add cars and get cars from last follower
+    [Documentation]    Add 40 cars and get added cars from last follower
+       ${resp}         AddCar  ${LAST_FOLLOWER}        ${PORT} ${40}
+       Sleep    8
+       ${resp}         Getcars ${LAST_FOLLOWER}        ${PORT} ${0}
+       Should Be Equal As Strings    ${resp.status_code}    200
+       Should Contain     ${resp.content}   manufacturer1
+       Should Contain     ${resp.content}   manufacturer40
+       Should Not Contain     ${resp.content}   manufacturer50
+
+Add people and get people from last follower
+    [Documentation]    Add 40 persons and get people
+    [Documentation]    Note: There should be one person added first to enable rpc
+       ${resp}         AddPerson       ${LAST_FOLLOWER}        ${PORT} ${0}
+       ${resp}         AddPerson       ${LAST_FOLLOWER}        ${PORT} ${40}
+       Sleep    8
+       ${resp}         GetPersons      ${LAST_FOLLOWER}        ${PORT} ${0}
+       Should Be Equal As Strings    ${resp.status_code}    200
+       Should Contain     ${resp.content}   user2
+       Should Contain     ${resp.content}   user40
+       Should Not Contain     ${resp.content}   user50
+
+Purchase 40 cars at last follower
+    [Documentation]    Add car-person and get car-person from last follower
+    [Documentation]  Note: This is done to enable working of rpc
+    [Documentation]  Purchase 40 cars using Leader
+  ${resp}              AddCarPerson    ${LAST_FOLLOWER}        ${PORT} ${0}
+       ${resp}         GetCarPersonMappings    ${LAST_FOLLOWER}        ${PORT} ${0}
+       Should Be Equal As Strings    ${resp.status_code}    200
+       Should Contain     ${resp.content}   user0
+       ${resp}         BuyCar  ${LAST_FOLLOWER}        ${PORT} ${40}
+       Sleep    8
+
+Get car-person mappings at last follower
+   [Documentation]     Get car-person mappings using last follower to see 40 entry
+       ${resp}         GetCarPersonMappings    ${LAST_FOLLOWER}        ${PORT} ${0}
+       Should Be Equal As Strings    ${resp.status_code}    200
+       Should Contain     ${resp.content}   user5
+       Should Contain     ${resp.content}   user40
\ No newline at end of file
diff --git a/test/csit/suites/controller/MD_SAL_Cluster_Datastore/060_failover_read_from_new_leader.txt b/test/csit/suites/controller/MD_SAL_Cluster_Datastore/060_failover_read_from_new_leader.txt
new file mode 100644 (file)
index 0000000..d673aef
--- /dev/null
@@ -0,0 +1,37 @@
+*** Settings ***
+Documentation     This test reads the data from the leader that was written to the follower by the previous test
+Library           ../../../libraries/CrudLibrary.py
+Library           ../../../libraries/ClusterStateLibrary.py
+
+*** Variables ***
+${SHARD}    shard-car-config
+
+*** Test Cases ***
+Find Leader
+    [Documentation]    find new leader
+  ${NEW_LEADER}    GetLeader  ${SHARD}  ${3}  ${3}  ${2}  ${8181}  ${MEMBER1}  ${MEMBER2}  ${MEMBER3}
+  Log  ${NEW_LEADER}
+  Set Suite Variable   ${NEW_LEADER}
+
+Get cars from new leader
+    [Documentation]    get 40 cars from new leader
+       ${resp}         Getcars ${NEW_LEADER}   ${PORT} ${0}
+       Should Be Equal As Strings    ${resp.status_code}    200
+       Should Contain     ${resp.content}   manufacturer1
+       Should Contain     ${resp.content}   manufacturer40
+       Should Not Contain     ${resp.content}   manufacturer50
+
+Get people from new leader
+    [Documentation]    get 40 people from new leader
+       ${resp}         GetPersons      ${NEW_LEADER}   ${PORT} ${0}
+       Should Be Equal As Strings    ${resp.status_code}    200
+       Should Contain     ${resp.content}   user2
+       Should Contain     ${resp.content}   user40
+       Should Not Contain     ${resp.content}   user50
+
+Get car-person mappings at new leader
+   [Documentation]     Get car-person mappings using last to see 40 entry
+       ${resp}         GetCarPersonMappings    ${NEW_LEADER}   ${PORT} ${0}
+       Should Be Equal As Strings    ${resp.status_code}    200
+       Should Contain     ${resp.content}   user5
+       Should Contain     ${resp.content}   user40
\ No newline at end of file
diff --git a/test/csit/suites/controller/MD_SAL_Cluster_Datastore/130_recovery_restart_leader.txt b/test/csit/suites/controller/MD_SAL_Cluster_Datastore/130_recovery_restart_leader.txt
new file mode 100644 (file)
index 0000000..567eb3f
--- /dev/null
@@ -0,0 +1,104 @@
+*** Settings ***
+Documentation     This test kills the leader and verifies that on restart the old leader is able to rejoin the cluster
+Library           Collections
+Library           ../../../libraries/RequestsLibrary.py
+Library           ../../../libraries/Common.py
+Library           ../../../libraries/CrudLibrary.py
+Library           ../../../libraries/SettingsLibrary.py
+Library           ../../../libraries/UtilLibrary.py
+Library           ../../../libraries/ClusterStateLibrary.py
+Variables         ../../../variables/Variables.py
+
+*** Variables ***
+${REST_CONTEXT}    /restconf/config/
+${KARAF_HOME}      /root/odl/dist
+${USER_NAME}       root
+${PASSWORD}        Ecp123
+${CAR_SHARD}      shard-car-config
+
+*** Test Cases *** 
+Stop All Controllers
+    [Documentation]    Stop all the controllers in the cluster
+    Stopcontroller    ${MEMBER1}    ${USER_NAME}    ${PASSWORD}    ${KARAF_HOME}
+    Stopcontroller    ${MEMBER2}    ${USER_NAME}    ${PASSWORD}    ${KARAF_HOME}
+    Stopcontroller    ${MEMBER3}    ${USER_NAME}    ${PASSWORD}    ${KARAF_HOME}
+    Sleep    30
+    KillController    ${MEMBER1}    ${USER_NAME}    ${PASSWORD}    ${KARAF_HOME}
+    KillController    ${MEMBER2}    ${USER_NAME}    ${PASSWORD}    ${KARAF_HOME}
+    KillController    ${MEMBER3}    ${USER_NAME}    ${PASSWORD}    ${KARAF_HOME}
+
+
+Clean All Journals
+    [Documentation]    Clean the journals of all the controllers in the cluster
+    CleanJournal    ${MEMBER1}    ${USER_NAME}    ${PASSWORD}    ${KARAF_HOME}
+    CleanJournal    ${MEMBER2}    ${USER_NAME}    ${PASSWORD}    ${KARAF_HOME}
+    CleanJournal    ${MEMBER3}    ${USER_NAME}    ${PASSWORD}    ${KARAF_HOME}
+    Sleep    5
+
+Start All Controllers
+    [Documentation]    Start all the controllers in the cluster
+    Startcontroller    ${MEMBER1}    ${USER_NAME}    ${PASSWORD}    ${KARAF_HOME}
+    Startcontroller    ${MEMBER2}    ${USER_NAME}    ${PASSWORD}    ${KARAF_HOME}
+    Startcontroller    ${MEMBER3}    ${USER_NAME}    ${PASSWORD}    ${KARAF_HOME}
+    Sleep    120
+
+Delete all cars
+    [Documentation]    Delete all the cars from the system
+       ${resp}         DeleteAllCars   ${MEMBER1}      ${PORT}         0
+       ${resp}         GetCars ${MEMBER1}      ${PORT}         0
+       Should Be Equal As Strings    ${resp.status_code}    404
+       
+
+Delete all people
+    [Documentation]    Delete all the people from the system
+       ${resp}         DeleteAllPersons        ${MEMBER1}      ${PORT}         0
+       ${resp}         GetPersons      ${MEMBER1}      ${PORT}    0    
+       Should Be Equal As Strings    ${resp.status_code}    404
+
+Add 200 cars
+    [Documentation]    Add 200 cars
+       ${resp}         AddCar  ${MEMBER1}      ${PORT}  ${200}
+       Should Be Equal As Strings    ${resp.status_code}    204
+
+Add 200 people
+    [Documentation]    Add 200 people
+       ${resp}         AddPerson       ${MEMBER1}      ${PORT} ${0}    
+       ${resp}         AddPerson       ${MEMBER1}      ${PORT}  ${200}
+       Should Be Equal As Strings    ${resp.status_code}    204
+
+Add Car Person mapping
+    [Documentation]    Add Car Persons
+       ${resp}         AddCarPerson    ${MEMBER1}      ${PORT} ${0}    
+       ${resp}         BuyCar  ${MEMBER1}      ${PORT} ${200}  
+
+Stop the Leader
+    ${CAR_LEADER}  GetLeader  ${CAR_SHARD}  ${3}  ${3}  ${1}  8181  ${MEMBER1}  ${MEMBER2}  ${MEMBER3}
+    Set Suite Variable    ${CAR_LEADER}
+    Stopcontroller    ${CAR_LEADER}    ${USER_NAME}    ${PASSWORD}    ${KARAF_HOME}
+    Sleep    30
+    KillController    ${CAR_LEADER}    ${USER_NAME}    ${PASSWORD}    ${KARAF_HOME}
+
+Get all the cars from Follower 1
+    ${followers}  GetFollowers  ${CAR_SHARD}  ${3}  ${3}  ${1}  8181  ${MEMBER1}  ${MEMBER2}  ${MEMBER3}
+       ${resp}         Getcars ${followers[0]} ${PORT} ${0}
+       Should Be Equal As Strings    ${resp.status_code}    200
+       Should Contain     ${resp.content}   manufacturer1
+
+Restart the Leader
+    Startcontroller   ${CAR_LEADER}    ${USER_NAME}    ${PASSWORD}    ${KARAF_HOME}
+    Sleep    120
+
+Get all the cars from Leader
+       ${resp}         Getcars ${CAR_LEADER}   ${PORT} ${0}
+       Should Be Equal As Strings    ${resp.status_code}    200
+       Should Contain     ${resp.content}   manufacturer1
+
+Cleanup All Controllers 
+    [Documentation]    Stop all the controllers in the cluster
+    Stopcontroller    ${MEMBER1}    ${USER_NAME}    ${PASSWORD}    ${KARAF_HOME}
+    Stopcontroller    ${MEMBER2}    ${USER_NAME}    ${PASSWORD}    ${KARAF_HOME}
+    Stopcontroller    ${MEMBER3}    ${USER_NAME}    ${PASSWORD}    ${KARAF_HOME}
+    Sleep    30
+
+
+
diff --git a/test/csit/suites/controller/MD_SAL_Cluster_Datastore/140_recovery_restart_follower.txt b/test/csit/suites/controller/MD_SAL_Cluster_Datastore/140_recovery_restart_follower.txt
new file mode 100644 (file)
index 0000000..195ef3e
--- /dev/null
@@ -0,0 +1,105 @@
+*** Settings ***
+Documentation     This test kills any of the followers and verifies that when that follower is restarted it can join the cluster
+Library           Collections
+Library           ../../../libraries/RequestsLibrary.py
+Library           ../../../libraries/Common.py
+Library           ../../../libraries/CrudLibrary.py
+Library           ../../../libraries/SettingsLibrary.py
+Library           ../../../libraries/UtilLibrary.py
+Library           ../../../libraries/ClusterStateLibrary.py
+Variables         ../../../variables/Variables.py
+
+*** Variables ***
+${REST_CONTEXT}    /restconf/config/
+${KARAF_HOME}      /root/odl/dist
+${USER_NAME}       root
+${PASSWORD}        Ecp123
+${CAR_SHARD}      shard-car-config
+
+*** Test Cases *** 
+Stop All Controllers
+    [Documentation]    Stop all the controllers in the cluster
+    Stopcontroller    ${MEMBER1}    ${USER_NAME}    ${PASSWORD}    ${KARAF_HOME}
+    Stopcontroller    ${MEMBER2}    ${USER_NAME}    ${PASSWORD}    ${KARAF_HOME}
+    Stopcontroller    ${MEMBER3}    ${USER_NAME}    ${PASSWORD}    ${KARAF_HOME}
+    Sleep    30
+    KillController    ${MEMBER1}    ${USER_NAME}    ${PASSWORD}    ${KARAF_HOME}
+    KillController    ${MEMBER2}    ${USER_NAME}    ${PASSWORD}    ${KARAF_HOME}
+    KillController    ${MEMBER3}    ${USER_NAME}    ${PASSWORD}    ${KARAF_HOME}
+
+
+Clean All Journals
+    [Documentation]    Clean the journals of all the controllers in the cluster
+    CleanJournal    ${MEMBER1}    ${USER_NAME}    ${PASSWORD}    ${KARAF_HOME}
+    CleanJournal    ${MEMBER2}    ${USER_NAME}    ${PASSWORD}    ${KARAF_HOME}
+    CleanJournal    ${MEMBER3}    ${USER_NAME}    ${PASSWORD}    ${KARAF_HOME}
+    Sleep    5
+
+Start All Controllers
+    [Documentation]    Start all the controllers in the cluster
+    Startcontroller    ${MEMBER1}    ${USER_NAME}    ${PASSWORD}    ${KARAF_HOME}
+    Startcontroller    ${MEMBER2}    ${USER_NAME}    ${PASSWORD}    ${KARAF_HOME}
+    Startcontroller    ${MEMBER3}    ${USER_NAME}    ${PASSWORD}    ${KARAF_HOME}
+    Sleep    120
+
+Delete all cars
+    [Documentation]    Delete all the cars from the system
+       ${resp}         DeleteAllCars   ${MEMBER1}      ${PORT}         0
+       ${resp}         GetCars ${MEMBER1}      ${PORT}         0
+       Should Be Equal As Strings    ${resp.status_code}    404
+       
+
+Delete all people
+    [Documentation]    Delete all the people from the system
+       ${resp}         DeleteAllPersons        ${MEMBER1}      ${PORT}         0
+       ${resp}         GetPersons      ${MEMBER1}      ${PORT}    0    
+       Should Be Equal As Strings    ${resp.status_code}    404
+
+Add 200 cars
+    [Documentation]    Add 200 cars
+       ${resp}         AddCar  ${MEMBER1}      ${PORT}  ${200}
+       Should Be Equal As Strings    ${resp.status_code}    204
+
+Add 200 people
+    [Documentation]    Add 200 people
+       ${resp}         AddPerson       ${MEMBER1}      ${PORT} ${0}    
+       ${resp}         AddPerson       ${MEMBER1}      ${PORT}  ${200}
+       Should Be Equal As Strings    ${resp.status_code}    204
+
+Add Car Person mapping
+    [Documentation]    Add Car Persons
+       ${resp}         AddCarPerson    ${MEMBER1}      ${PORT} ${0}    
+       ${resp}         BuyCar  ${MEMBER1}      ${PORT} ${200}  
+
+Stop one of the followers
+    ${followers}  GetFollowers  ${CAR_SHARD}  ${3}  ${3}  ${1}  8181  ${MEMBER1}  ${MEMBER2}  ${MEMBER3}
+    ${CAR_FOLLOWER}    Set Variable    ${followers[0]}
+    Set Suite Variable    ${CAR_FOLLOWER}
+    Stopcontroller    ${CAR_FOLLOWER}    ${USER_NAME}    ${PASSWORD}    ${KARAF_HOME}
+    Sleep    30
+    KillController    ${CAR_FOLLOWER}    ${USER_NAME}    ${PASSWORD}    ${KARAF_HOME}
+
+Get all the cars from the other Follower
+    ${followers}  GetFollowers  ${CAR_SHARD}  ${3}  ${3}  ${1}  8181  ${MEMBER1}  ${MEMBER2}  ${MEMBER3}
+       ${resp}         Getcars ${followers[0]} ${PORT} ${0}
+       Should Be Equal As Strings    ${resp.status_code}    200
+       Should Contain     ${resp.content}   manufacturer1
+
+Restart the Stopped Follower
+    Startcontroller   ${CAR_FOLLOWER}    ${USER_NAME}    ${PASSWORD}    ${KARAF_HOME}
+    Sleep    120
+
+Get all the cars from Stopped Follower
+       ${resp}         Getcars ${CAR_FOLLOWER} ${PORT} ${0}
+       Should Be Equal As Strings    ${resp.status_code}    200
+       Should Contain     ${resp.content}   manufacturer1
+
+Cleanup All Controllers 
+    [Documentation]    Stop all the controllers in the cluster
+    Stopcontroller    ${MEMBER1}    ${USER_NAME}    ${PASSWORD}    ${KARAF_HOME}
+    Stopcontroller    ${MEMBER2}    ${USER_NAME}    ${PASSWORD}    ${KARAF_HOME}
+    Stopcontroller    ${MEMBER3}    ${USER_NAME}    ${PASSWORD}    ${KARAF_HOME}
+    Sleep    30
+
+
+
diff --git a/test/csit/suites/controller/MD_SAL_Cluster_Datastore/__init__.txt b/test/csit/suites/controller/MD_SAL_Cluster_Datastore/__init__.txt
new file mode 100644 (file)
index 0000000..cf422c9
--- /dev/null
@@ -0,0 +1,6 @@
+*** Settings ***
+Documentation     Test suite for Clustering Datastore
+Library     SSHLibrary
+
+
+** Keywords ***
diff --git a/test/csit/suites/controller/MD_SAL_Cluster_Longevity/010__longevity.txt b/test/csit/suites/controller/MD_SAL_Cluster_Longevity/010__longevity.txt
new file mode 100644 (file)
index 0000000..3e6230b
--- /dev/null
@@ -0,0 +1,11 @@
+*** Settings ***
+Documentation     Test suite for Longevity test of cluster datastore
+Library           ../../../../libraries/CrudLibrary.py
+
+*** Variables ***
+
+
+*** Test Cases ***
+Run Tests in Loop for Specified Time
+    [Documentation]    Run CRUD operation from nodes for specified time
+  Testlongevity  ${DURATION}  ${PORT}  ${IP1}  ${IP2}  ${IP3}
diff --git a/test/csit/suites/controller/MD_SAL_Cluster_Longevity/__init__.txt b/test/csit/suites/controller/MD_SAL_Cluster_Longevity/__init__.txt
new file mode 100644 (file)
index 0000000..a26acce
--- /dev/null
@@ -0,0 +1,10 @@
+*** Settings ***
+Documentation     Test suite for Longevity test of cluster datastore
+Suite Setup       Start Suite
+Suite Teardown    Stop Suite
+Library     SSHLibrary
+
+
+** Keywords ***
+Start Suite  
+Stop Suite
diff --git a/test/csit/suites/controller/MD_SAL_Cluster_Routed_RPC/001_start_cluster.txt b/test/csit/suites/controller/MD_SAL_Cluster_Routed_RPC/001_start_cluster.txt
new file mode 100644 (file)
index 0000000..da9264a
--- /dev/null
@@ -0,0 +1,38 @@
+*** Settings ***
+Documentation     Start the controllers
+Library           Collections
+Library           ../../../libraries/RequestsLibrary.py
+Library           ../../../libraries/Common.py
+Library           ../../../libraries/CrudLibrary.py
+Library           ../../../libraries/SettingsLibrary.py
+Library           ../../../libraries/UtilLibrary.py
+Variables         ../../../variables/Variables.py
+
+*** Variables ***
+${REST_CONTEXT}    /restconf/config/
+
+*** Test Cases *** 
+Stop All Controllers
+    [Documentation]    Stop all the controllers in the cluster
+    Stopcontroller    ${MEMBER1}    ${USER_NAME}    ${PASSWORD}    ${KARAF_HOME}
+    Stopcontroller    ${MEMBER2}    ${USER_NAME}    ${PASSWORD}    ${KARAF_HOME}
+    Stopcontroller    ${MEMBER3}    ${USER_NAME}    ${PASSWORD}    ${KARAF_HOME}
+    Sleep    30
+    KillController    ${MEMBER1}    ${USER_NAME}    ${PASSWORD}    ${KARAF_HOME}
+    KillController    ${MEMBER2}    ${USER_NAME}    ${PASSWORD}    ${KARAF_HOME}
+    KillController    ${MEMBER3}    ${USER_NAME}    ${PASSWORD}    ${KARAF_HOME}
+
+
+Clean All Journals
+    [Documentation]    Clean the journals of all the controllers in the cluster
+    CleanJournal    ${MEMBER1}    ${USER_NAME}    ${PASSWORD}    ${KARAF_HOME}
+    CleanJournal    ${MEMBER2}    ${USER_NAME}    ${PASSWORD}    ${KARAF_HOME}
+    CleanJournal    ${MEMBER3}    ${USER_NAME}    ${PASSWORD}    ${KARAF_HOME}
+    Sleep    5
+
+Start All Controllers
+    [Documentation]    Start all the controllers in the cluster
+    Startcontroller    ${MEMBER1}    ${USER_NAME}    ${PASSWORD}    ${KARAF_HOME}
+    Startcontroller    ${MEMBER2}    ${USER_NAME}    ${PASSWORD}    ${KARAF_HOME}
+    Startcontroller    ${MEMBER3}    ${USER_NAME}    ${PASSWORD}    ${KARAF_HOME}
+    Sleep    120
\ No newline at end of file
diff --git a/test/csit/suites/controller/MD_SAL_Cluster_Routed_RPC/023_routed_rpc_crud_test.txt b/test/csit/suites/controller/MD_SAL_Cluster_Routed_RPC/023_routed_rpc_crud_test.txt
new file mode 100644 (file)
index 0000000..2ee99f2
--- /dev/null
@@ -0,0 +1,64 @@
+*** Settings ***
+Documentation     Test suite for Routed RPC. 
+Library           Collections
+Library           ../../../libraries/RequestsLibrary.py
+Library           ../../../libraries/Common.py
+Library           ../../../libraries/CrudLibrary.py
+Library           ../../../libraries/SettingsLibrary.py
+Library           ../../../libraries/UtilLibrary.py
+Variables         ../../../variables/Variables.py
+
+*** Variables ***
+${REST_CONTEXT}    /restconf/config/
+
+
+*** Test Cases *** 
+Add cars and get cars from Leader 
+    [Documentation]    Add 100 cars and get added cars from Leader
+       ${resp}         AddCar  ${MEMBER1}      ${PORT} ${100}  
+       ${resp}         Getcars ${MEMBER1}      ${PORT} ${0}
+       Should Be Equal As Strings    ${resp.status_code}    200
+       Should Contain     ${resp.content}   manufacturer1      
+               
+Add persons and get persons from Leader 
+    [Documentation]    Add 100 persons and get persons
+    [Documentation]    Note: There should be one person added first to enable rpc
+       ${resp}         AddPerson       ${MEMBER1}      ${PORT} ${0}    
+       ${resp}         AddPerson       ${MEMBER1}      ${PORT} ${100}  
+       ${resp}         GetPersons      ${MEMBER1}      ${PORT} ${0}
+       Should Be Equal As Strings    ${resp.status_code}    200
+       Should Contain     ${resp.content}   user5
+       SLEEP   10      
+
+Add car-person mapping and get car-person mapping from Follower1
+    [Documentation]    Add car-person and get car-person from Leader
+    [Documentation]    Note: This is done to enable working of rpc
+        ${resp}                AddCarPerson    ${MEMBER2}      ${PORT} ${0}
+        ${resp}                GetCarPersonMappings    ${MEMBER2}      ${PORT} ${0}
+       Should Be Equal As Strings      ${resp.status_code}     200
+        Should Contain ${resp.content} user0
+       SLEEP   5
+
+Purchase 100 cars using Follower1 
+    [Documentation]  Purchase 100 cars using Follower1
+       ${resp}         BuyCar  ${MEMBER2}      ${PORT} ${100}
+       ${resp}         GetCarPersonMappings    ${MEMBER2}      ${PORT} ${0}
+       Should Be Equal As Strings    ${resp.status_code}    200
+
+Get Cars from Leader
+    [Documentation]    Get 100 using Leader
+       ${resp}         Getcars ${MEMBER1}      ${PORT} ${0}
+        Should Be Equal As Strings    ${resp.status_code}    200
+        Should Contain     ${resp.content}   manufacturer99
+
+Get persons from Leader
+    [Documentation]    Get 101 Persons from Leader
+       ${resp}         GetPersons      ${MEMBER1}      ${PORT} ${0}
+        Should Be Equal As Strings    ${resp.status_code}    200
+        Should Contain     ${resp.content}   user100
+
+Get car-person mappings using Leader
+   [Documentation]     Get 101 car-person mappings using Leader to see 100 entry
+       ${resp}         GetCarPersonMappings    ${MEMBER1}      ${PORT} ${0}
+       Should Be Equal As Strings    ${resp.status_code}    200
+       Should Contain     ${resp.content}   user100
diff --git a/test/csit/suites/controller/MD_SAL_Cluster_Routed_RPC/024_routed_rpc_crud_test.txt b/test/csit/suites/controller/MD_SAL_Cluster_Routed_RPC/024_routed_rpc_crud_test.txt
new file mode 100644 (file)
index 0000000..e29c3f5
--- /dev/null
@@ -0,0 +1,118 @@
+*** Settings ***
+Documentation     Test suite for Routed RPC. 
+Library           Collections
+Library           ../../../libraries/RequestsLibrary.py
+Library           ../../../libraries/Common.py
+Library           ../../../libraries/CrudLibrary.py
+Library           ../../../libraries/SettingsLibrary.py
+Library           ../../../libraries/UtilLibrary.py
+Library           ../../../libraries/ClusterStateLibrary.py
+Variables         ../../../variables/Variables.py
+
+*** Variables ***
+${REST_CONTEXT}    /restconf/config/
+
+*** Test Cases *** 
+Add cars and get cars from Leader 
+    [Documentation]    Add 100 cars and get added cars from Leader
+       ${resp}         AddCar  ${MEMBER1}      ${PORT} ${100}  
+       ${resp}         Getcars ${MEMBER1}      ${PORT} ${0}
+       Should Be Equal As Strings    ${resp.status_code}    200
+       Should Contain     ${resp.content}   manufacturer1      
+       
+Add persons and get persons from Leader 
+    [Documentation]    Add 100 persons and get persons
+    [Documentation]    Note: There should be one person added first to enable rpc
+       ${resp}         AddPerson       ${MEMBER1}      ${PORT} ${0}    
+       ${resp}         AddPerson       ${MEMBER1}      ${PORT} ${100}  
+       ${resp}         GetPersons      ${MEMBER1}      ${PORT} ${0}
+       Should Be Equal As Strings    ${resp.status_code}    200
+       Should Contain     ${resp.content}   user5      
+
+Add car-person mapping and get car-person mapping from Follower1
+    [Documentation]     Add car-person and get car-person from Follower1
+    [Documentation]  Note: This is done to enable working of rpc
+       ${resp}         AddCarPerson    ${MEMBER2}      ${PORT} ${0}
+       ${resp}         GetCarPersonMappings    ${MEMBER2}      ${PORT} ${0}
+       Should Be Equal As Strings    ${resp.status_code}    200
+       Should Contain  ${resp.content} user0
+
+Purchase 100 cars using Follower 
+    [Documentation]  Purchase 100 cars using Follower
+       SLEEP   10
+       ${resp}         BuyCar  ${MEMBER2}      ${PORT} ${100}  
+       ${resp}         GetCarPersonMappings    ${MEMBER2}      ${PORT} ${0}
+       Should Be Equal As Strings    ${resp.status_code}    200
+
+Get Cars from Leader
+    [Documentation]    Get 100 using Leader
+       ${resp}         Getcars ${MEMBER1}      ${PORT} ${0}
+       Should Be Equal As Strings    ${resp.status_code}    200
+       Should Contain  ${resp.content}         manufacturer9
+
+Get persons from Leader
+    [Documentation]    Get 11 Persons from Leader
+       ${resp}         GetPersons      ${MEMBER1}      ${PORT} ${0}
+       Should Be Equal As Strings    ${resp.status_code}    200
+       Should Contain  ${resp.content}         user100
+
+Get car-person mappings using Leader
+   [Documentation]     Get car-person mappings using Leader to see 100 entry
+       ${resp}         GetCarPersonMappings    ${MEMBER1}      ${PORT} ${0}
+       Should Be Equal As Strings    ${resp.status_code}    200
+       Should Contain  ${resp.content}         user100
+
+Stop Leader
+   [Documentation]     Stop Leader controller
+       ${resp}         Stopcontroller  ${MEMBER1}      ${USERNAME}     ${PASSWORD}     ${KARAF_HOME}
+       SLEEP   30
+       ${resp}         Killcontroller  ${MEMBER1}      ${USERNAME}     ${PASSWORD}     ${KARAF_HOME}
+
+       
+Add cars and get cars from Follower1 
+    [Documentation]    Add 100 cars and get added cars from Follower
+       ${resp}         AddCar  ${MEMBER2}      ${PORT} ${100}  
+       ${resp}         Getcars ${MEMBER2}      ${PORT} ${0}
+       Should Be Equal As Strings    ${resp.status_code}    200
+       Should Contain  ${resp.content}         manufacturer1
+
+Add persons and get persons from Follower1
+    [Documentation]    Add 100 persons and get persons
+    [Documentation]    Note: There should be one person added first to enable rpc
+       ${resp}         AddPerson       ${MEMBER2}      ${PORT} ${0}    
+       ${resp}         AddPerson       ${MEMBER2}      ${PORT} ${100}  
+       ${resp}         GetPersons      ${MEMBER2}      ${PORT} ${0}
+       Should Be Equal As Strings    ${resp.status_code}    200
+       Should Contain  ${resp.content}         user5
+       SLEEP   10
+       
+Purchase 100 cars using Follower2 
+    [Documentation]  Purchase 100 cars using Follower2
+       ${resp}         BuyCar  ${MEMBER3}      ${PORT} ${100}
+       SLEEP   10
+       ${resp}         GetCarPersonMappings    ${MEMBER3}      ${PORT} ${0}
+       Should Be Equal As Strings    ${resp.status_code}    200
+
+Get Cars from Follower1
+    [Documentation]    Get 100 using Follower1
+       ${resp}         Getcars ${MEMBER2}      ${PORT} ${0}
+       Should Be Equal As Strings    ${resp.status_code}    200
+       Should Contain  ${resp.content}         manufacturer9
+
+Get persons from Follower1
+    [Documentation]    Get 11 Persons from Follower1
+       ${resp}         GetPersons      ${MEMBER2}      ${PORT} ${0}
+       Should Be Equal As Strings    ${resp.status_code}    200
+       Should Contain  ${resp.content}         user100
+
+Get car-person mappings using Follower1
+   [Documentation]     Get car-person mappings using Follower1 to see 100 entry
+       ${resp}         GetCarPersonMappings    ${MEMBER2}      ${PORT} ${0}
+       Should Be Equal As Strings    ${resp.status_code}    200
+       Should Contain  ${resp.content}         user100
+
+Start Leader
+   [Documentation]     Start Leader controller 
+       ${resp}         Startcontroller ${MEMBER1}      ${USERNAME}     ${PASSWORD}     ${KARAF_HOME}
+       SLEEP   20
+
diff --git a/test/csit/suites/controller/MD_SAL_NSF_OF10/010__restconf_inventory.txt b/test/csit/suites/controller/MD_SAL_NSF_OF10/010__restconf_inventory.txt
new file mode 100644 (file)
index 0000000..447e686
--- /dev/null
@@ -0,0 +1,42 @@
+*** Settings ***
+Documentation     Test suite for RESTCONF inventory
+Suite Setup       Create Session    session    http://${CONTROLLER}:${RESTCONFPORT}    auth=${AUTH}    headers=${HEADERS_XML}
+Suite Teardown    Delete All Sessions
+Library           Collections
+Library           ../../../libraries/RequestsLibrary.py
+Library           ../../../libraries/Common.py
+Variables         ../../../variables/Variables.py
+Resource          ../../../libraries/Utils.txt
+
+*** Variables ***
+${REST_CONTEXT}    /restconf/operational/opendaylight-inventory:nodes
+@{node_list}      openflow:1    openflow:2    openflow:3
+
+*** Test Cases ***
+Get list of nodes
+    [Documentation]    Get the inventory
+    Log    ${start}
+    Wait Until Keyword Succeeds    30s    2s    Ensure All Nodes Are In Response    ${REST_CONTEXT}    ${node_list}
+
+Get nodeconnector for a node 1
+    [Documentation]    Get the inventory for a node
+    ${resp}    RequestsLibrary.Get    session    ${REST_CONTEXT}/node/openflow:1
+    Should Be Equal As Strings    ${resp.status_code}    200
+    Should Contain    ${resp.content}    openflow:1:1
+    Should Contain    ${resp.content}    openflow:1:2
+
+Get nodeconnector for a node 2
+    [Documentation]    Get the inventory for a node
+    ${resp}    RequestsLibrary.Get    session    ${REST_CONTEXT}/node/openflow:2
+    Should Be Equal As Strings    ${resp.status_code}    200
+    Should Contain    ${resp.content}    openflow:2:1
+    Should Contain    ${resp.content}    openflow:2:2
+    Should Contain    ${resp.content}    openflow:2:3
+
+Get nodeconnector for a node 3
+    [Documentation]    Get the inventory for a node
+    ${resp}    RequestsLibrary.Get    session    ${REST_CONTEXT}/node/openflow:3
+    Should Be Equal As Strings    ${resp.status_code}    200
+    Should Contain    ${resp.content}    openflow:3:1
+    Should Contain    ${resp.content}    openflow:3:2
+    Should Contain    ${resp.content}    openflow:3:3
diff --git a/test/csit/suites/controller/MD_SAL_NSF_OF10/020__restconf_topology.txt b/test/csit/suites/controller/MD_SAL_NSF_OF10/020__restconf_topology.txt
new file mode 100644 (file)
index 0000000..d7b8f06
--- /dev/null
@@ -0,0 +1,82 @@
+*** Settings ***
+Documentation     Test suite for RESTCONF Topology
+Suite Setup       Create Session    session    http://${CONTROLLER}:${RESTCONFPORT}    auth=${AUTH}    headers=${HEADERS}
+Suite Teardown    Delete All Sessions
+Library           Collections
+Library           ../../../libraries/RequestsLibrary.py
+Library           ../../../libraries/Common.py
+Variables         ../../../variables/Variables.py
+Resource          ../../../libraries/Utils.txt
+
+*** Variables ***
+${topology1}      "flow:1"
+${node1}          "openflow:1"
+${node2}          "openflow:2"
+${node3}          "openflow:3"
+@{node_list}      openflow:1    openflow:2    openflow:3
+${key}            link
+${REST_CONTEXT_1}    /restconf/operational/network-topology:network-topology
+${REST_CONTEXT_2}    /restconf/operational/network-topology:network-topology/topology/flow:1
+${REST_CONTEXT_3}    /restconf/config/network-topology:network-topology/topology/flow:1/link/userlink
+
+*** Test Cases ***
+Get RESTCONF Topology
+    [Documentation]    Get RESTCONF Topology and validate the result.
+    Wait Until Keyword Succeeds    30s    2s    Ensure All Nodes Are In Response    ${REST_CONTEXT_1}    ${node_list}
+    ${resp}    RequestsLibrary.Get    session    ${REST_CONTEXT_1}
+    Should Be Equal As Strings    ${resp.status_code}    200
+    Log    ${resp.content}
+    Should Contain    ${resp.content}    ${topology1}
+
+List all the links
+    [Documentation]    List all the links in the topology.
+    ${body1}    Create Dictionary    dest-node=openflow:1    dest-tp=openflow:1:2
+    ${body2}    Create Dictionary    source-node=openflow:3    source-tp=openflow:3:3
+    ${link2}    Create Dictionary    link-id=openflow:3:3    destination=${body1}    source=${body2}
+    ${body1}    Create Dictionary    dest-node=openflow:1    dest-tp=openflow:1:1
+    ${body2}    Create Dictionary    source-node=openflow:2    source-tp=openflow:2:3
+    ${link1}    Create Dictionary    link-id=openflow:2:3    destination=${body1}    source=${body2}
+    ${body1}    Create Dictionary    dest-node=openflow:3    dest-tp=openflow:3:3
+    ${body2}    Create Dictionary    source-node=openflow:1    source-tp=openflow:1:2
+    ${link4}    Create Dictionary    link-id=openflow:1:2    destination=${body1}    source=${body2}
+    ${body1}    Create Dictionary    dest-node=openflow:2    dest-tp=openflow:2:3
+    ${body2}    Create Dictionary    source-node=openflow:1    source-tp=openflow:1:1
+    ${link3}    Create Dictionary    link-id=openflow:1:1    destination=${body1}    source=${body2}
+    ${links}    Create List    ${link1}    ${link2}    ${link3}    ${link4}
+    Wait Until Keyword Succeeds    30s    2s    Verify Links    ${links}
+
+Add a link
+    [Documentation]    Add a link, list to validate the result.
+    ${body1}    Create Dictionary    dest-node=openflow:3    dest-tp=openflow:3:1
+    ${body2}    Create Dictionary    source-node=openflow:2    source-tp=openflow:2:1
+    ${body3}    Create Dictionary    link-id=userlink    destination=${body1}    source=${body2}
+    ${links}    Create List    ${body3}
+    ${body}    Create Dictionary    link=${links}
+    ${resp}    RequestsLibrary.Put    session    ${REST_CONTEXT_3}    data=${body}
+    Should Be Equal As Strings    ${resp.status_code}    200
+    ${resp}    RequestsLibrary.Get    session    ${REST_CONTEXT_3}
+    Should Be Equal As Strings    ${resp.status_code}    200
+    ${result}    To JSON    ${resp.content}
+    ${link}    Get From Dictionary    ${result}    link
+    Lists Should be Equal    ${link}    ${links}
+
+Remove a link
+    [Documentation]    Remove a link, list to validate the result.
+    ${resp}    RequestsLibrary.Delete    session    ${REST_CONTEXT_3}
+    Should Be Equal As Strings    ${resp.status_code}    200
+    ${resp}    RequestsLibrary.Get    session    ${REST_CONTEXT_3}
+    Should Be Equal As Strings    ${resp.status_code}    404
+
+*** Keywords ***
+Verify Links
+    [Arguments]    ${expected_links}
+    ${resp}    RequestsLibrary.Get    session    ${REST_CONTEXT_2}
+    Log    ${resp.content}
+    Should Be Equal As Strings    ${resp.status_code}    200
+    ${result}    To JSON    ${resp.content}
+    Log    ${result}
+    ${content}    Get From Dictionary    ${result}    topology
+    ${topology}    Get From List    ${content}    0
+    ${link}    Get From Dictionary    ${topology}    link
+    Sort List    ${link}
+    Lists Should be Equal    ${link}    ${expected_links}
diff --git a/test/csit/suites/controller/MD_SAL_NSF_OF10/030__restconf_statistics.txt b/test/csit/suites/controller/MD_SAL_NSF_OF10/030__restconf_statistics.txt
new file mode 100644 (file)
index 0000000..d225cea
--- /dev/null
@@ -0,0 +1,29 @@
+*** Settings ***
+Documentation     Test suite for RESTCONF statistics
+Suite Setup       Create Session    session    http://${CONTROLLER}:${RESTCONFPORT}    auth=${AUTH}    headers=${HEADERS_XML}
+Suite Teardown    Delete All Sessions
+Library           Collections
+Library           ../../../libraries/RequestsLibrary.py
+Library           ../../../libraries/Common.py
+Variables         ../../../variables/Variables.py
+Resource          ../../../libraries/Utils.txt
+
+*** Variables ***
+${REST_CONTEXT}    /restconf/operational/opendaylight-inventory:nodes
+@{node_list}      openflow:1    openflow:2    openflow:3
+
+*** Test Cases ***
+Get Stats for all nodes
+    [Documentation]    Get the stats for all nodes
+    Wait Until Keyword Succeeds    30s    2s    Ensure All Nodes Are In Response    ${REST_CONTEXT}    ${node_list}
+Get Stats for node 1
+    [Documentation]    Get the stats for a node
+    Wait Until Keyword Succeeds    60s    2s    Check Nodes Stats    openflow:1
+
+Get Stats for node 2
+    [Documentation]    Get the stats for a node
+    Wait Until Keyword Succeeds    60s    2s    Check Nodes Stats    openflow:2
+
+Get Stats for node 3
+    [Documentation]    Get the stats for a node
+    Wait Until Keyword Succeeds    60s    2s    Check Nodes Stats    openflow:3
diff --git a/test/csit/suites/controller/MD_SAL_NSF_OF10/040__restconf_frm.txt b/test/csit/suites/controller/MD_SAL_NSF_OF10/040__restconf_frm.txt
new file mode 100644 (file)
index 0000000..b3daa30
--- /dev/null
@@ -0,0 +1,48 @@
+*** Settings ***
+Documentation     Test suite for RESTCONF FRM
+Suite Setup       Create Session    session    http://${CONTROLLER}:${RESTCONFPORT}    auth=${AUTH}    headers=${HEADERS_XML}
+Suite Teardown    Delete All Sessions
+Library           Collections
+Library           ../../../libraries/RequestsLibrary.py
+Library           ../../../libraries/Common.py
+Variables         ../../../variables/Variables.py
+Resource          ../../../libraries/Utils.txt
+
+*** Variables ***
+${REST_CON}       /restconf/config/opendaylight-inventory:nodes
+${REST_OPR}       /restconf/operational/opendaylight-inventory:nodes
+${BODY2}          <flow xmlns="urn:opendaylight:flow:inventory"><priority>2</priority><flow-name>Foo</flow-name><match><ethernet-match><ethernet-type><type>2048</type></ethernet-type></ethernet-match><ipv4-destination>10.0.20.1/32</ipv4-destination></match><id>152</id><table_id>0</table_id><instructions><instruction><order>0</order><apply-actions><action><order>0</order><output-action><output-node-connector>openflow:1:1</output-node-connector></output-action></action></apply-actions></instruction></instructions></flow>
+
+*** Test Cases ***
+Add a flow - Output to physical port#
+    [Documentation]    Push a flow through REST-API
+    ${resp}    Putxml    session    ${REST_CON}/node/openflow:1/table/0/flow/152    data=${BODY2}
+    Should Be Equal As Strings    ${resp.status_code}    200
+
+Verify after adding flow config - Output to physical port#
+    [Documentation]    Verify the flow
+    ${resp}    RequestsLibrary.Get    session    ${REST_CON}/node/openflow:1/table/0
+    Should Be Equal As Strings    ${resp.status_code}    200
+    Should Contain    ${resp.content}    152
+
+Verify after adding flow operational - Output to physical port#
+    [Documentation]    Verify the flow
+    ${elements}=    Create List    10.0.20.1
+    Wait Until Keyword Succeeds    60s    2s    Check For Elements At URI    ${REST_OPR}/node/openflow:1/table/0    ${elements}
+
+Remove a flow - Output to physical port#
+    [Documentation]    Remove a flow
+    ${resp}    RequestsLibrary.Delete    session    ${REST_CON}/node/openflow:1/table/0/flow/152
+    Should Be Equal As Strings    ${resp.status_code}    200
+
+Verify after deleting flow config - Output to physical port#
+    [Documentation]    Verify the flow
+    ${resp}    RequestsLibrary.Get    session    ${REST_CON}/node/openflow:1/table/0
+    Should Be Equal As Strings    ${resp.status_code}    200
+    Should Not Contain    ${resp.content}    152
+    #    Standing bug #368 - This has been fixed
+
+Verify after deleting flow operational - Output to physical port#
+    [Documentation]    Verify the flow
+    ${elements}=    Create List    10.0.20.1
+    Wait Until Keyword Succeeds    60s    2s    Check For Elements Not At URI    ${REST_OPR}/node/openflow:1/table/0    ${elements}
diff --git a/test/csit/suites/controller/MD_SAL_NSF_OF10/__init__.txt b/test/csit/suites/controller/MD_SAL_NSF_OF10/__init__.txt
new file mode 100644 (file)
index 0000000..c8f389c
--- /dev/null
@@ -0,0 +1,9 @@
+*** Settings ***
+Documentation     Test suite for MD-SAL NSF
+Suite Setup       Start Suite
+Suite Teardown    Stop Suite
+Library           SSHLibrary
+Resource          ../../../libraries/Utils.txt
+
+*** Variables ***
+${start}          sudo mn --controller=remote,ip=${CONTROLLER} --topo tree,2
diff --git a/test/csit/suites/controller/MD_SAL_NSF_OF13/010__restconf_inventory.txt b/test/csit/suites/controller/MD_SAL_NSF_OF13/010__restconf_inventory.txt
new file mode 100644 (file)
index 0000000..50a50e3
--- /dev/null
@@ -0,0 +1,42 @@
+*** Settings ***
+Documentation     Test suite for RESTCONF inventory
+Suite Setup       Create Session    session    http://${CONTROLLER}:${RESTCONFPORT}    auth=${AUTH}    headers=${HEADERS_XML}
+Suite Teardown    Delete All Sessions
+Library           Collections
+Library           ../../../libraries/RequestsLibrary.py
+Library           ../../../libraries/Common.py
+Variables         ../../../variables/Variables.py
+Resource          ../../../libraries/Utils.txt
+
+*** Variables ***
+${REST_CONTEXT}    /restconf/operational/opendaylight-inventory:nodes
+@{node_list}      openflow:1    openflow:2    openflow:3
+
+*** Test Cases ***
+Get list of nodes
+    [Documentation]    Get the inventory
+    ${resp}    RequestsLibrary.Get    session    ${REST_CONTEXT}
+    Wait Until Keyword Succeeds    30s    2s    Ensure All Nodes Are In Response    ${REST_CONTEXT}    ${node_list}
+
+Get nodeconnector for a node 1
+    [Documentation]    Get the inventory for a node
+    ${resp}    RequestsLibrary.Get    session    ${REST_CONTEXT}/node/openflow:1
+    Should Be Equal As Strings    ${resp.status_code}    200
+    Should Contain    ${resp.content}    openflow:1:1
+    Should Contain    ${resp.content}    openflow:1:2
+
+Get nodeconnector for a node 2
+    [Documentation]    Get the inventory for a node
+    ${resp}    RequestsLibrary.Get    session    ${REST_CONTEXT}/node/openflow:2
+    Should Be Equal As Strings    ${resp.status_code}    200
+    Should Contain    ${resp.content}    openflow:2:1
+    Should Contain    ${resp.content}    openflow:2:2
+    Should Contain    ${resp.content}    openflow:2:3
+
+Get nodeconnector for a node 3
+    [Documentation]    Get the inventory for a node
+    ${resp}    RequestsLibrary.Get    session    ${REST_CONTEXT}/node/openflow:3
+    Should Be Equal As Strings    ${resp.status_code}    200
+    Should Contain    ${resp.content}    openflow:3:1
+    Should Contain    ${resp.content}    openflow:3:2
+    Should Contain    ${resp.content}    openflow:3:3
diff --git a/test/csit/suites/controller/MD_SAL_NSF_OF13/020__restconf_topology.txt b/test/csit/suites/controller/MD_SAL_NSF_OF13/020__restconf_topology.txt
new file mode 100644 (file)
index 0000000..f6d3f60
--- /dev/null
@@ -0,0 +1,82 @@
+*** Settings ***
+Documentation     Test suite RESTCONF Topology
+Suite Setup       Create Session    session    http://${CONTROLLER}:${RESTCONFPORT}    auth=${AUTH}    headers=${HEADERS}
+Suite Teardown    Delete All Sessions
+Library           Collections
+Library           ../../../libraries/RequestsLibrary.py
+Library           ../../../libraries/Common.py
+Variables         ../../../variables/Variables.py
+Resource          ../../../libraries/Utils.txt
+
+*** Variables ***
+${topology1}      "flow:1"
+${node1}          "openflow:1"
+${node2}          "openflow:2"
+${node3}          "openflow:3"
+@{node_list}      openflow:1    openflow:2    openflow:3
+${key}            link
+${REST_CONTEXT_1}    /restconf/operational/network-topology:network-topology
+${REST_CONTEXT_2}    /restconf/operational/network-topology:network-topology/topology/flow:1
+${REST_CONTEXT_3}    /restconf/config/network-topology:network-topology/topology/flow:1/link/userlink
+
+*** Test Cases ***
+Get RESTCONF Topology
+    [Documentation]    Get RESTCONF Topology and validate the result.
+    Wait Until Keyword Succeeds    30s    2s    Ensure All Nodes Are In Response    ${REST_CONTEXT_1}    ${node_list}
+    ${resp}    RequestsLibrary.Get    session    ${REST_CONTEXT_1}
+    Log    ${resp.content}
+    Should Be Equal As Strings    ${resp.status_code}    200
+    Should Contain    ${resp.content}    ${topology1}
+
+List all the links
+    [Documentation]    List all the links in the topology.
+    ${body1}    Create Dictionary    dest-node=openflow:1    dest-tp=openflow:1:2
+    ${body2}    Create Dictionary    source-node=openflow:3    source-tp=openflow:3:3
+    ${link2}    Create Dictionary    link-id=openflow:3:3    destination=${body1}    source=${body2}
+    ${body1}    Create Dictionary    dest-node=openflow:1    dest-tp=openflow:1:1
+    ${body2}    Create Dictionary    source-node=openflow:2    source-tp=openflow:2:3
+    ${link1}    Create Dictionary    link-id=openflow:2:3    destination=${body1}    source=${body2}
+    ${body1}    Create Dictionary    dest-node=openflow:3    dest-tp=openflow:3:3
+    ${body2}    Create Dictionary    source-node=openflow:1    source-tp=openflow:1:2
+    ${link4}    Create Dictionary    link-id=openflow:1:2    destination=${body1}    source=${body2}
+    ${body1}    Create Dictionary    dest-node=openflow:2    dest-tp=openflow:2:3
+    ${body2}    Create Dictionary    source-node=openflow:1    source-tp=openflow:1:1
+    ${link3}    Create Dictionary    link-id=openflow:1:1    destination=${body1}    source=${body2}
+    ${links}    Create List    ${link1}    ${link2}    ${link3}    ${link4}
+    Wait Until Keyword Succeeds    30s    2s    Verify Links    ${links}
+
+Add a link
+    [Documentation]    Add a link, list to validate the result.
+    ${body1}    Create Dictionary    dest-node=openflow:3    dest-tp=openflow:3:1
+    ${body2}    Create Dictionary    source-node=openflow:2    source-tp=openflow:2:1
+    ${body3}    Create Dictionary    link-id=userlink    destination=${body1}    source=${body2}
+    ${links}    Create List    ${body3}
+    ${body}    Create Dictionary    link=${links}
+    ${resp}    RequestsLibrary.Put    session    ${REST_CONTEXT_3}    data=${body}
+    Should Be Equal As Strings    ${resp.status_code}    200
+    ${resp}    RequestsLibrary.Get    session    ${REST_CONTEXT_3}
+    Should Be Equal As Strings    ${resp.status_code}    200
+    ${result}    To JSON    ${resp.content}
+    ${link}    Get From Dictionary    ${result}    link
+    Lists Should be Equal    ${link}    ${links}
+
+Remove a link
+    [Documentation]    Remove a link, list to validate the result.
+    ${resp}    RequestsLibrary.Delete    session    ${REST_CONTEXT_3}
+    Should Be Equal As Strings    ${resp.status_code}    200
+    ${resp}    RequestsLibrary.Get    session    ${REST_CONTEXT_3}
+    Should Be Equal As Strings    ${resp.status_code}    404
+
+*** Keywords ***
+Verify Links
+    [Arguments]    ${expected_links}
+    ${resp}    RequestsLibrary.Get    session    ${REST_CONTEXT_2}
+    Log    ${resp.content}
+    Should Be Equal As Strings    ${resp.status_code}    200
+    ${result}    To JSON    ${resp.content}
+    Log    ${result}
+    ${content}    Get From Dictionary    ${result}    topology
+    ${topology}    Get From List    ${content}    0
+    ${link}    Get From Dictionary    ${topology}    link
+    Sort List    ${link}
+    Lists Should be Equal    ${link}    ${expected_links}
diff --git a/test/csit/suites/controller/MD_SAL_NSF_OF13/030__restconf_statistics.txt b/test/csit/suites/controller/MD_SAL_NSF_OF13/030__restconf_statistics.txt
new file mode 100644 (file)
index 0000000..f842c5a
--- /dev/null
@@ -0,0 +1,29 @@
+*** Settings ***
+Documentation     Test suite for RESTCONF statistics
+Suite Setup       Create Session    session    http://${CONTROLLER}:${RESTCONFPORT}    auth=${AUTH}    headers=${HEADERS_XML}
+Suite Teardown    Delete All Sessions
+Library           Collections
+Library           ../../../libraries/RequestsLibrary.py
+Library           ../../../libraries/Common.py
+Variables         ../../../variables/Variables.py
+Resource          ../../../libraries/Utils.txt
+
+*** Variables ***
+${REST_CONTEXT}    /restconf/operational/opendaylight-inventory:nodes
+@{node_list}      openflow:1    openflow:2    openflow:3
+
+*** Test Cases ***
+Get Stats for all nodes
+    [Documentation]    Get the stats for a node
+    Wait Until Keyword Succeeds    30s    2s    Ensure All Nodes Are In Response    ${REST_CONTEXT}    ${node_list}
+Get Stats for node 1
+    [Documentation]    Get the stats for a node
+    Wait Until Keyword Succeeds    60s    2s    Check Nodes Stats    openflow:1
+
+Get Stats for node 2
+    [Documentation]    Get the stats for a node
+    Wait Until Keyword Succeeds    60s    2s    Check Nodes Stats    openflow:2
+
+Get Stats for node 3
+    [Documentation]    Get the stats for a node
+    Wait Until Keyword Succeeds    60s    2s    Check Nodes Stats    openflow:3
diff --git a/test/csit/suites/controller/MD_SAL_NSF_OF13/040__restconf_frm.txt b/test/csit/suites/controller/MD_SAL_NSF_OF13/040__restconf_frm.txt
new file mode 100644 (file)
index 0000000..214186e
--- /dev/null
@@ -0,0 +1,64 @@
+*** Settings ***
+Documentation     Test suite for RESTCONF FRM
+Suite Setup       Create Session    session    http://${CONTROLLER}:${RESTCONFPORT}    auth=${AUTH}    headers=${HEADERS_XML}
+Suite Teardown    Delete All Sessions
+Library           Collections
+Library           ../../../libraries/RequestsLibrary.py
+Library           ../../../libraries/Common.py
+Variables         ../../../variables/Variables.py
+Resource          ../../../libraries/Utils.txt
+
+*** Variables ***
+${REST_CON}       /restconf/config/opendaylight-inventory:nodes
+${REST_OPR}       /restconf/operational/opendaylight-inventory:nodes
+${BODY1}          <flow xmlns="urn:opendaylight:flow:inventory"><priority>2</priority><flow-name>Foo</flow-name><match><ethernet-match><ethernet-type><type>2048</type></ethernet-type></ethernet-match><ipv4-destination>10.0.10.1/32</ipv4-destination></match><id>139</id><table_id>2</table_id><instructions><instruction><order>0</order><apply-actions><action><order>0</order><dec-nw-ttl/></action></apply-actions></instruction></instructions></flow>
+${BODY2}          <flow xmlns="urn:opendaylight:flow:inventory"><priority>2</priority><flow-name>Foo</flow-name><match><ethernet-match><ethernet-type><type>2048</type></ethernet-type></ethernet-match><ipv4-destination>10.0.20.1/32</ipv4-destination></match><id>139</id><table_id>2</table_id><instructions><instruction><order>0</order><apply-actions><action><order>0</order><output-action><output-node-connector>1</output-node-connector><max-length>60</max-length></output-action></action></apply-actions></instruction></instructions></flow>
+
+*** Test Cases ***
+Add a flow - Sending IPv4 Dest Address and Eth type
+    [Documentation]    Push a flow through REST-API
+    ${resp}    Putxml    session    ${REST_CON}/node/openflow:1/table/2/flow/139    data=${BODY1}
+    Should Be Equal As Strings    ${resp.status_code}    200
+
+Verify after adding flow config - Sending IPv4 Dest Address and Eth type
+    [Documentation]    Verify the flow
+    ${resp}    RequestsLibrary.Get    session    ${REST_CON}/node/openflow:1/table/2
+    Should Be Equal As Strings    ${resp.status_code}    200
+    Should Contain    ${resp.content}    139
+
+Verify after adding flow operational - Sending IPv4 Dest Address and Eth type
+    [Documentation]    Verify the flow
+    ${elements}=    Create List    10.0.10.1
+    Wait Until Keyword Succeeds    60s    2s    Check For Elements At URI    ${REST_OPR}/node/openflow:1/table/2    ${elements}
+
+Modify a flow - Output to physical port#
+    [Documentation]    Push a flow through REST-API
+    ${resp}    Putxml    session    ${REST_CON}/node/openflow:1/table/2/flow/139    data=${BODY2}
+    Should Be Equal As Strings    ${resp.status_code}    200
+
+Verify after modifying flow config - Output to physical port#
+    [Documentation]    Verify the flow
+    ${resp}    RequestsLibrary.Get    session    ${REST_CON}/node/openflow:1/table/2
+    Should Be Equal As Strings    ${resp.status_code}    200
+    Should Contain    ${resp.content}    10.0.20.1
+
+Verify after modifying flow operational - Output to physical port#
+    [Documentation]    Verify the flow
+    ${elements}=    Create List    10.0.20.1
+    Wait Until Keyword Succeeds    90s    2s    Check For Elements At URI    ${REST_OPR}/node/openflow:1/table/2/flow/139    ${elements}
+
+Remove a flow - Output to physical port#
+    [Documentation]    Remove a flow
+    ${resp}    RequestsLibrary.Delete    session    ${REST_CON}/node/openflow:1/table/2/flow/139
+    Should Be Equal As Strings    ${resp.status_code}    200
+
+Verify after deleting flow config - Output to physical port#
+    [Documentation]    Verify the flow
+    ${resp}    RequestsLibrary.Get    session    ${REST_CON}/node/openflow:1/table/2
+    Should Be Equal As Strings    ${resp.status_code}    200
+    Should Not Contain    ${resp.content}    139
+
+Verify after deleting flow operational - Output to physical port#
+    [Documentation]    Verify the flow
+    ${elements}=    Create List    10.0.20.1
+    Wait Until Keyword Succeeds    60s    2s    Check For Elements Not At URI    ${REST_OPR}/node/openflow:1/table/2    ${elements}
diff --git a/test/csit/suites/controller/MD_SAL_NSF_OF13/__init__.txt b/test/csit/suites/controller/MD_SAL_NSF_OF13/__init__.txt
new file mode 100644 (file)
index 0000000..b46e60a
--- /dev/null
@@ -0,0 +1,11 @@
+*** Settings ***
+Documentation     Test suite for MD-SAL NSF mininet OF13
+Suite Setup       Start Suite
+Suite Teardown    Stop Suite
+Library     SSHLibrary
+Resource          ../../../libraries/Utils.txt
+
+*** Variables ***
+${start}=   sudo mn --controller=remote,ip=${CONTROLLER} --topo tree,2 --switch ovsk,protocols=OpenFlow13 
+
+** Keywords ***
diff --git a/test/csit/suites/controller/NETCONF/010__netconf_inventory.txt b/test/csit/suites/controller/NETCONF/010__netconf_inventory.txt
new file mode 100644 (file)
index 0000000..dd6b523
--- /dev/null
@@ -0,0 +1,62 @@
+*** Settings ***
+Documentation     Test suite for NETCONF
+Suite Setup       Create Session    session    http://${CONTROLLER}:${RESTCONFPORT}    auth=${AUTH}    headers=${HEADERS_XML}
+Suite Teardown    Delete All Sessions
+Library           Collections
+Library           OperatingSystem
+Library           String
+Library           ../../../libraries/RequestsLibrary.py
+Library           ../../../libraries/Common.py
+Variables         ../../../variables/Variables.py
+
+*** Variables ***
+${FILE}                 ${CURDIR}/../../../variables/xmls/netconf.xml
+${REST_CONT_CONF}       /restconf/config/opendaylight-inventory:nodes
+${REST_CONT_OPER}       /restconf/operational/opendaylight-inventory:nodes 
+${REST_NTPR_CONF}       node/controller-config/yang-ext:mount/config:modules
+${REST_NTPR_MOUNT}      node/netopeer/yang-ext:mount/
+
+*** Test Cases ***
+Add NetConf device
+    [Documentation]    Add NetConf device using REST
+    [Tags]     netconf
+    ${XML1}    Get File    ${FILE}
+    ${XML2}    Replace String    ${XML1}    127.0.0.1    ${MININET}
+    ${body}    Replace String    ${XML2}    mininet      ${MININET_USER}
+    Log    ${body}
+    ${resp}    Post    session    ${REST_CONT_CONF}/${REST_NTPR_CONF}    data=${body}
+    Log    ${resp.content}
+    Should Be Equal As Strings    ${resp.status_code}    204
+
+Get Controller Inventory
+    [Documentation]    Get Controller operational inventory
+    [Tags]    netconf
+    Wait Until Keyword Succeeds    10s    2s    Get Inventory 
+
+Pull External Device configuration
+    [Documentation]    Pull Netopeer configuration
+    [Tags]    netconf
+    ${resp}   Get    session    ${REST_CONT_CONF}/${REST_NTPR_MOUNT}
+    Log    ${resp.content}
+    Should Be Equal As Strings    ${resp.status_code}    200
+    Should Contain    ${resp.content}    {}
+
+Verify Device Operational data
+    [Documentation]    Verify Netopeer operational data
+    [Tags]    netconf
+    ${resp}   Get    session    ${REST_CONT_OPER}/${REST_NTPR_MOUNT}
+    Log    ${resp.content}
+    Should Be Equal As Strings    ${resp.status_code}    200
+    Should Contain    ${resp.content}    schema
+    Should Contain    ${resp.content}    statistics
+    Should Contain    ${resp.content}    datastores
+
+*** Keywords ***
+Get Inventory
+    ${resp}   Get    session    ${REST_CONT_OPER}
+    Log    ${resp.content}
+    Should Be Equal As Strings    ${resp.status_code}    200
+    Should Contain    ${resp.content}    "id":"netopeer"
+    Should Contain    ${resp.content}    "netconf-node-inventory:connected":true
+    Should Contain    ${resp.content}    "netconf-node-inventory:initial-capability"
+
diff --git a/test/csit/suites/l2switch/Address_Tracking_OF13/010__restconf_inv_addresses.txt b/test/csit/suites/l2switch/Address_Tracking_OF13/010__restconf_inv_addresses.txt
new file mode 100644 (file)
index 0000000..a083de4
--- /dev/null
@@ -0,0 +1,70 @@
+*** Settings ***
+Documentation     Test suite for AddressObservations in RESTCONF inventory
+Suite Setup       Create Session   session   http://${CONTROLLER}:${PORT}   auth=${AUTH}   headers=${HEADERS_XML}
+Suite Teardown    Delete All Sessions
+Library           SSHLibrary
+Library           Collections
+Library           ../../../libraries/RequestsLibrary.py
+Library           ../../../libraries/Common.py
+Variables         ../../../variables/Variables.py
+
+*** Variables ***
+${REST_CONTEXT}    /restconf/operational/opendaylight-inventory:nodes
+${IP_1}           "10.0.0.1"
+${IP_2}           "10.0.0.2"
+${IP_3}           "10.0.0.3"
+
+*** Test Cases ***
+Get list of nodes
+    [Documentation]    Get the inventory, should not contain address observations
+        ${resp}    Get    session    ${REST_CONTEXT}
+        Should Be Equal As Strings    ${resp.status_code}    200
+        Should Contain     ${resp.content}     openflow:1
+        Should Contain     ${resp.content}     openflow:2
+        Should Contain     ${resp.content}     openflow:3
+        Should Contain X Times    ${resp.content}   forwarding  4
+        Should Not Contain    ${resp.content}    ${IP_1}
+        Should Not Contain    ${resp.content}    ${IP_2}
+        Should Not Contain    ${resp.content}    ${IP_3}
+
+Ping All
+    [Documentation]    Pingall, verify no packet loss
+        Write   pingall
+        ${result}    Read Until                mininet>
+        Should Contain   ${result}   0% dropped
+        Should Not Contain    ${result}    X
+        Sleep  3 
+
+Get node 1 addresses
+    [Documentation]    Get the address observations for node 1
+        ${resp}    Get    session    ${REST_CONTEXT}/node/openflow:1
+        Should Be Equal As Strings   ${resp.status_code}    200
+        Should Contain     ${resp.content}      openflow:1:1
+        Should Contain     ${resp.content}      openflow:1:2
+        Should Contain     ${resp.content}      addresses
+        Should Contain X Times    ${resp.content}   ${IP_1}  1
+        Should Not Contain    ${resp.content}    ${IP_2}
+        Should Not Contain    ${resp.content}    ${IP_3}
+
+Get node 2 addresses
+    [Documentation]    Get the address observations for node 2
+        ${resp}    Get    session    ${REST_CONTEXT}/node/openflow:2
+        Should Be Equal As Strings   ${resp.status_code}    200
+        Should Contain     ${resp.content}      openflow:2:1
+        Should Contain     ${resp.content}      openflow:2:2
+        Should Contain     ${resp.content}      openflow:2:3
+        Should Contain     ${resp.content}      addresses
+        Should Not Contain    ${resp.content}    ${IP_1}
+        Should Contain X Times    ${resp.content}   ${IP_2}  1
+        Should Not Contain    ${resp.content}    ${IP_3}
+
+Get node 3 addresses
+    [Documentation]    Get the address observations for node 3
+       ${resp}    Get    session    ${REST_CONTEXT}/node/openflow:3
+        Should Be Equal As Strings   ${resp.status_code}    200
+        Should Contain     ${resp.content}     openflow:3:1
+        Should Contain     ${resp.content}     openflow:3:2
+        Should Contain     ${resp.content}      addresses
+        Should Not Contain    ${resp.content}    ${IP_1}
+        Should Not Contain    ${resp.content}    ${IP_2}
+        Should Contain X Times    ${resp.content}   ${IP_3}  1
diff --git a/test/csit/suites/l2switch/Address_Tracking_OF13/__init__.txt b/test/csit/suites/l2switch/Address_Tracking_OF13/__init__.txt
new file mode 100644 (file)
index 0000000..a2f58f4
--- /dev/null
@@ -0,0 +1,26 @@
+*** Settings ***
+Documentation     Test suite for L2switch's Address Tracking using mininet OF13
+Suite Setup       Start Suite
+Suite Teardown    Stop Suite
+Library     SSHLibrary
+
+*** Variables ***
+${start}=  sudo mn --controller=remote,ip=${CONTROLLER} --topo=linear,3 --switch ovsk,protocols=OpenFlow13
+
+** Keywords ***
+Start Suite
+    Log    Start mininet
+    Open Connection   ${MININET}     prompt=>  timeout=20
+    Login With Public Key    ${MININET_USER}   ${USER_HOME}/.ssh/id_rsa   any
+    Write    sudo ovs-vsctl set-manager ptcp:6644
+    Write    sudo mn -c
+    Read Until         >
+    Write    ${start}
+    Read Until         mininet>
+    Sleep      30
+Stop Suite
+    Log    Stop mininet
+    Read
+    Write    exit
+    Read Until         >
+    Close Connection
diff --git a/test/csit/suites/l2switch/Flow_Programming_OF13/010__restconf_inv_flows.txt b/test/csit/suites/l2switch/Flow_Programming_OF13/010__restconf_inv_flows.txt
new file mode 100644 (file)
index 0000000..7302ebf
--- /dev/null
@@ -0,0 +1,58 @@
+** Settings ***
+Documentation     Test suite for FlowProgramming in RESTCONF inventory
+Suite Setup       Create Session   session   http://${CONTROLLER}:${PORT}   auth=${AUTH}   headers=${HEADERS_XML}
+Suite Teardown    Delete All Sessions
+Library           SSHLibrary
+Library           Collections
+Library           ../../../libraries/RequestsLibrary.py
+Library           ../../../libraries/Common.py
+Variables         ../../../variables/Variables.py
+
+*** Variables ***
+${REST_CONTEXT}    /restconf/operational/opendaylight-inventory:nodes
+
+*** Test Cases ***
+Get flows before ping through console
+    [Documentation]    Dump flows should list initial flows (drop, arp, lldp, flood per port)
+        Write   sh ovs-ofctl dump-flows s1 -O OpenFlow13
+        ${result}    Read Until                mininet>
+        Should Contain X Times    ${result}    actions    4
+        Write   sh ovs-ofctl dump-flows s2 -O OpenFlow13
+        ${result}    Read Until        mininet>
+        Should Contain X Times    ${result}    actions    5
+        Write   sh ovs-ofctl dump-flows s3 -O OpenFlow13
+        ${result}    Read Until        mininet>
+        Should Contain X Times    ${result}    actions    4
+
+# Get flows before ping through restconf
+#    [Documentation]    Get the inventory, should not contain flows
+#        ${resp}    Get    session    ${REST_CONTEXT}/node/openflow:1/table/0
+#        Should Be Equal As Strings    ${resp.status_code}    200
+#        Should Not Contain    ${resp.content}    flow
+
+Ping All
+    [Documentation]    Pingall, verify no packet loss
+        Write   pingall
+        ${result}    Read Until                mininet>
+        Should Contain   ${result}   0% dropped
+        Should Not Contain    ${result}    X
+
+#Get flows after ping through console
+#    [Documentation]    Dump flows should list flows
+#        Write   sh ovs-ofctl dump-flows s1 -O OpenFlow13
+#        ${result}    Read Until       mininet>
+#        Should Contain X Times    ${result}    actions    4
+#        Write   sh ovs-ofctl dump-flows s2 -O OpenFlow13
+#        Sleep   5
+#        ${result}    Read Until       mininet>
+#        Should Contain X Times    ${result}    actions    6
+#        Write   sh ovs-ofctl dump-flows s3 -O OpenFlow13
+#        Sleep   5
+#        ${result}    Read Until       mininet>
+#        Should Contain X Times    ${result}    actions    4
+
+
+#Get flows after ping through restconf
+#    [Documentation]    Get the inventory, should not contain flows
+#        ${resp}    Get    session    ${REST_CONTEXT}/node/openflow:1/table/0
+#        Should Be Equal As Strings    ${resp.status_code}    200
diff --git a/test/csit/suites/l2switch/Flow_Programming_OF13/__init__.txt b/test/csit/suites/l2switch/Flow_Programming_OF13/__init__.txt
new file mode 100644 (file)
index 0000000..a48347d
--- /dev/null
@@ -0,0 +1,26 @@
+*** Settings ***
+Documentation     Test suite for L2switch's Flow Programming using mininet OF13
+Suite Setup       Start Suite
+Suite Teardown    Stop Suite
+Library     SSHLibrary
+
+*** Variables ***
+${start}=  sudo mn --controller=remote,ip=${CONTROLLER} --topo=linear,3 --switch ovsk,protocols=OpenFlow13
+
+** Keywords ***
+Start Suite
+    Log    Start mininet
+    Open Connection   ${MININET}     prompt=>  timeout=10
+    Login With Public Key    ${MININET_USER}   ${USER_HOME}/.ssh/id_rsa   any
+    Write    sudo ovs-vsctl set-manager ptcp:6644
+    Write    sudo mn -c
+    Read Until         >
+    Write    ${start}
+    Read Until         mininet>
+    Sleep      15
+Stop Suite
+    Log    Stop mininet
+    Read
+    Write    exit
+    Read Until         >
+    Close All Connections
diff --git a/test/csit/suites/l2switch/Host_Tracking_OF13/010__restconf_topo_nodes.txt b/test/csit/suites/l2switch/Host_Tracking_OF13/010__restconf_topo_nodes.txt
new file mode 100644 (file)
index 0000000..09d2731
--- /dev/null
@@ -0,0 +1,59 @@
+*** Settings ***
+Documentation     Test suite for Address in RESTCONF topology
+Suite Setup       Create Session    session    http://${CONTROLLER}:${PORT}    auth=${AUTH}    headers=${HEADERS_XML}
+Suite Teardown    Delete All Sessions
+Library           SSHLibrary
+Library           Collections
+Library           ../../../libraries/RequestsLibrary.py
+Library           ../../../libraries/Common.py
+Variables         ../../../variables/Variables.py
+
+*** Variables ***
+${REST_TOPO}      /restconf/operational/network-topology:network-topology
+${MAC_1}          00:00:00:00:00:01
+${MAC_2}          00:00:00:00:00:02
+${MAC_3}          00:00:00:00:00:03
+${IP_1}           10.0.0.1
+${IP_2}           10.0.0.2
+${IP_3}           10.0.0.3
+
+*** Test Cases ***
+Get list of host from network topology
+    [Documentation]    Get the network topology, should not contain any host address
+    ${resp}    Get    session    ${REST_TOPO}
+    Should Be Equal As Strings    ${resp.status_code}    200
+    Should Contain    ${resp.content}    openflow:1
+    Should Contain    ${resp.content}    openflow:2
+    Should Contain    ${resp.content}    openflow:3
+    Should Contain X Times    ${resp.content}    link-id    4
+    Should Not Contain    ${resp.content}    ${MAC_1}
+    Should Not Contain    ${resp.content}    ${MAC_2}
+    Should Not Contain    ${resp.content}    ${MAC_3}
+
+Ping All
+    [Documentation]    Pingall, verify no packet loss
+    Write    pingall
+    ${result}    Read Until    mininet>
+    Should Contain    ${result}    0% dropped
+    Should Not Contain    ${result}    X
+    Sleep    3
+
+Host Tracker
+    [Documentation]    Get the network topology,
+    ${resp}    Get    session    ${REST_TOPO}/topology/flow:1
+    Should Be Equal As Strings    ${resp.status_code}    200
+    Log    ${resp.content}
+    Should Contain X Times    ${resp.content}    "node-id":"host:${MAC_1}"    1
+    Should Contain X Times    ${resp.content}    "node-id":"host:${MAC_2}"    1
+    Should Contain X Times    ${resp.content}    "node-id":"host:${MAC_3}"    1
+
+Check host are deleted
+    [Documentation]    Closing mininet this will remove the switch and the host should also be deleted
+    Log    closing mininet
+    write    exit
+    Read Until    >
+    sleep    5
+    ${resp}    Get    session    ${REST_TOPO}/topology/flow:1
+    Should Be Equal as Strings    ${resp.status_code}    200
+    Should not Contain    ${resp.content}    "node-id":"host
+    Log    ${resp.content}
diff --git a/test/csit/suites/l2switch/Host_Tracking_OF13/__init__.txt b/test/csit/suites/l2switch/Host_Tracking_OF13/__init__.txt
new file mode 100644 (file)
index 0000000..22872b9
--- /dev/null
@@ -0,0 +1,22 @@
+*** Settings ***
+Documentation     Test suite for L2switch's Address Tracking using mininet OF13
+Suite Setup       Start Suite
+Suite Teardown    Stop Suite
+Library     SSHLibrary
+
+*** Variables ***
+${start}=  sudo mn --controller=remote,ip=${CONTROLLER} --topo=linear,3 --switch ovsk,protocols=OpenFlow13 --mac
+
+** Keywords ***
+Start Suite
+    Log    Start mininet
+    Open Connection   ${MININET}     prompt=>   timeout=20
+    Login With Public Key    ${MININET_USER}   ${USER_HOME}/.ssh/id_rsa   any
+    Write    sudo ovs-vsctl set-manager ptcp:6644
+    Write    sudo mn -c
+    Read Until          >
+    Write    ${start}
+    Read Until          mininet>
+    Sleep               30
+Stop Suite
+    Close Connection
diff --git a/test/csit/suites/l2switch/Inventory_Scalability_OF13/010__restconf_inventory.txt b/test/csit/suites/l2switch/Inventory_Scalability_OF13/010__restconf_inventory.txt
new file mode 100644 (file)
index 0000000..797334a
--- /dev/null
@@ -0,0 +1,71 @@
+*** Settings ***
+Documentation     Test suite for RESTCONF inventory
+Suite Setup       Create Session    session    http://${CONTROLLER}:${RESTCONFPORT}    auth=${AUTH}    headers=${HEADERS_XML}
+Suite Teardown    Delete All Sessions
+Library           Collections
+Library           ../../../libraries/RequestsLibrary.py
+Library           ../../../libraries/Common.py
+Variables         ../../../variables/Variables.py
+
+*** Variables ***
+${REST_CONTEXT}    /restconf/operational/opendaylight-inventory:nodes
+
+*** Test Cases ***
+Get list of nodes
+    [Documentation]    Get the inventory
+    ${TOPO_TREE_DEPTH}    Convert To Integer    ${TOPO_TREE_DEPTH}
+    ${TOPO_TREE_FANOUT}    Convert To Integer    ${TOPO_TREE_FANOUT}
+    ${numnodes}    Num Of Nodes    ${TOPO_TREE_DEPTH}    ${TOPO_TREE_FANOUT}
+    Wait Until Keyword Succeeds    30s    2s    Check Every Nodes    ${numnodes}
+
+Get nodeconnector for the root node
+    [Documentation]    Get the inventory for the root node
+    ${TOPO_TREE_FANOUT}    Convert To Integer    ${TOPO_TREE_FANOUT}
+    ${resp}    RequestsLibrary.Get    session    ${REST_CONTEXT}/node/openflow:1
+    Log    ${resp.content}
+    Should Be Equal As Strings    ${resp.status_code}    200
+    Wait Until Keyword Succeeds    30s    2s    Check conn loop    ${TOPO_TREE_FANOUT}    1    ${resp.content}
+
+Get nodeconnector for a node
+    [Documentation]    Get the inventory for a node
+    ${TOPO_TREE_DEPTH}    Convert To Integer    ${TOPO_TREE_DEPTH}
+    ${TOPO_TREE_FANOUT}    Convert To Integer    ${TOPO_TREE_FANOUT}
+    ${numnodes}    Num Of Nodes    ${TOPO_TREE_DEPTH}    ${TOPO_TREE_FANOUT}
+    Wait Until Keyword Succeeds    30s    2s    Check Every Nodes Nodeconnector    ${numnodes}
+
+Get Stats for a node
+    [Documentation]    Get the stats for a node
+    ${TOPO_TREE_DEPTH}    Convert To Integer    ${TOPO_TREE_DEPTH}
+    ${TOPO_TREE_FANOUT}    Convert To Integer    ${TOPO_TREE_FANOUT}
+    ${numnodes}    Num Of Nodes    ${TOPO_TREE_DEPTH}    ${TOPO_TREE_FANOUT}
+    Wait Until Keyword Succeeds    120s    2s    Check Every Nodes Stats    ${numnodes}
+
+*** Keywords ***
+Check Every Nodes
+    [Arguments]    ${numnodes}
+    ${resp}    RequestsLibrary.Get    session    ${REST_CONTEXT}
+    Should Be Equal As Strings    ${resp.status_code}    200
+    : FOR    ${IND}    IN RANGE    1    ${numnodes+1}
+    \    Should Contain    ${resp.content}    openflow:${IND}
+
+Check Every Nodes Stats
+    [Arguments]    ${numnodes}
+    : FOR    ${IND}    IN RANGE    1    ${numnodes+1}
+    \    ${resp}    RequestsLibrary.Get    session    ${REST_CONTEXT}/node/openflow:${IND}
+    \    Log    ${resp.content}
+    \    Should Be Equal As Strings    ${resp.status_code}    200
+    \    Should Contain    ${resp.content}    flow-capable-node-connector-statistics
+    \    Should Contain    ${resp.content}    flow-table-statistics
+
+Check Every Nodes Nodeconnector
+    [Arguments]    ${numnodes}
+    : FOR    ${IND}    IN RANGE    2    ${numnodes+1}
+    \    ${resp}    RequestsLibrary.Get    session    ${REST_CONTEXT}/node/openflow:${IND}
+    \    Log    ${resp.content}
+    \    Should Be Equal As Strings    ${resp.status_code}    200
+    \    Check conn loop    ${TOPO_TREE_FANOUT+1}    ${IND}    ${resp.content}
+
+Check conn loop
+    [Arguments]    ${arg}    ${outerind}    ${content}
+    : FOR    ${var}    IN RANGE    1    ${arg+1}
+    \    Should Contain    ${content}    openflow:${outerind}:${var}
diff --git a/test/csit/suites/l2switch/Inventory_Scalability_OF13/020__restconf_topology.txt b/test/csit/suites/l2switch/Inventory_Scalability_OF13/020__restconf_topology.txt
new file mode 100644 (file)
index 0000000..8ad05ed
--- /dev/null
@@ -0,0 +1,37 @@
+*** Settings ***
+Documentation     Test suite for RESTCONF topology
+Suite Setup       Create Session    session    http://${CONTROLLER}:${RESTCONFPORT}    auth=${AUTH}    headers=${HEADERS_XML}
+Suite Teardown    Delete All Sessions
+Library           Collections
+Library           XML
+Library           ../../../libraries/RequestsLibrary.py
+Library           ../../../libraries/Common.py
+Variables         ../../../variables/Variables.py
+
+*** Variables ***
+${REST_CONTEXT}    /restconf/operational/network-topology:network-topology/topology/flow:1
+
+*** Test Cases ***
+Get Nodes Count
+    [Documentation]    Checks the number of switches
+    ${TOPO_TREE_DEPTH}    Convert To Integer    ${TOPO_TREE_DEPTH}
+    ${TOPO_TREE_FANOUT}    Convert To Integer    ${TOPO_TREE_FANOUT}
+    ${numnodes}    Num Of Nodes    ${TOPO_TREE_DEPTH}    ${TOPO_TREE_FANOUT}
+    Wait Until Keyword Succeeds    60s    2s    Verify Element Count    ${REST_CONTEXT}    node    ${numnodes}
+
+Get Links Count
+    [Documentation]    Checks the number of links
+    ${TOPO_TREE_DEPTH}    Convert To Integer    ${TOPO_TREE_DEPTH}
+    ${TOPO_TREE_FANOUT}    Convert To Integer    ${TOPO_TREE_FANOUT}
+    ${numnodes}    Num Of Nodes    ${TOPO_TREE_DEPTH}    ${TOPO_TREE_FANOUT}
+    ${numlinks}    Evaluate    (${numnodes}-1)*2
+    Wait Until Keyword Succeeds    60s    2s    Verify Element Count    ${REST_CONTEXT}    link    ${numlinks}
+
+*** Keywords ***
+Verify Element Count
+    [Arguments]    ${URI}    ${xpath_location}    ${expected_count}
+    ${resp}    RequestsLibrary.Get    session    ${REST_CONTEXT}    headers=${ACCEPT_XML}
+    Log    ${resp.content}
+    Should Be Equal As Strings    ${resp.status_code}    200
+    ${count}=    Get Element Count    ${resp.content}    xpath=${xpath_location}
+    Should Be Equal As Numbers    ${count}    ${expected_count}
diff --git a/test/csit/suites/l2switch/Inventory_Scalability_OF13/030__ping_test.txt b/test/csit/suites/l2switch/Inventory_Scalability_OF13/030__ping_test.txt
new file mode 100644 (file)
index 0000000..14a093e
--- /dev/null
@@ -0,0 +1,20 @@
+*** Settings ***
+Documentation     Test suite for do pingall test
+Library           SSHLibrary
+Library           Collections
+Library           ../../../libraries/RequestsLibrary.py
+Library           ../../../libraries/Common.py
+Variables         ../../../variables/Variables.py
+
+*** Variables ***
+
+*** Test Cases ***
+Ping all
+    [Documentation]    Do ping all test, verify no packet loss
+    ${TOPO_TREE_DEPTH}    Convert To Integer    ${TOPO_TREE_DEPTH}
+    ${TOPO_TREE_FANOUT}    Convert To Integer    ${TOPO_TREE_FANOUT}
+    ${numnodes}    Num Of Nodes    ${TOPO_TREE_DEPTH}    ${TOPO_TREE_FANOUT}
+    Write    pingall
+    Sleep    ${numnodes}
+    ${result}    Read
+    Should Not Contain    ${result}    X
diff --git a/test/csit/suites/l2switch/Inventory_Scalability_OF13/__init__.txt b/test/csit/suites/l2switch/Inventory_Scalability_OF13/__init__.txt
new file mode 100644 (file)
index 0000000..2f1d3dc
--- /dev/null
@@ -0,0 +1,31 @@
+*** Settings ***
+Documentation     Test suite for Inventory Scalability
+Suite Setup       Start Suite
+Suite Teardown    Stop Suite
+Library           SSHLibrary
+Library           ../../../libraries/Common.py
+Variables         ../../../variables/Variables.py
+
+*** Variables ***
+${start}          sudo mn --controller=remote,ip=${CONTROLLER} --topo tree,${TOPO_TREE_DEPTH},${TOPO_TREE_FANOUT} --switch ovsk,protocols=OpenFlow13
+
+*** Keywords ***
+Start Suite
+    Log    Start mininet
+    ${TOPO_TREE_DEPTH}    Convert To Integer    ${TOPO_TREE_DEPTH}
+    ${TOPO_TREE_FANOUT}    Convert To Integer    ${TOPO_TREE_FANOUT}
+    ${numnodes}    Num Of Nodes    ${TOPO_TREE_DEPTH}    ${TOPO_TREE_FANOUT}
+    Open Connection    ${MININET}    prompt=>    timeout=${numnodes*2}
+    Login With Public Key    ${MININET_USER}    ${USER_HOME}/.ssh/id_rsa    any
+    Write    sudo ovs-vsctl set-manager ptcp:6644
+    Write    sudo mn -c
+    Read Until    >
+    Write    ${start}
+    Read Until    mininet>
+
+Stop Suite
+    Log    Stop mininet
+    Read
+    Write    exit
+    Read Until    >
+    Close Connection
diff --git a/test/csit/suites/l2switch/Loop_Removal_OF13/010__loop_of_3.txt b/test/csit/suites/l2switch/Loop_Removal_OF13/010__loop_of_3.txt
new file mode 100644 (file)
index 0000000..58a7e2f
--- /dev/null
@@ -0,0 +1,47 @@
+*** Settings ***
+Documentation     Test suite for Ring/Loop topology of size 3
+Suite Setup       Create Session   session   http://${CONTROLLER}:${PORT}   auth=${AUTH}   headers=${HEADERS_XML}
+Suite Teardown    Delete All Sessions
+Library           Collections
+Library           ../../../libraries/RequestsLibrary.py
+Library           ../../../libraries/Common.py
+Variables         ../../../variables/Variables.py
+
+*** Variables ***
+${REST_CONTEXT}    /restconf/operational/opendaylight-inventory:nodes
+
+*** Test Cases ***
+Get opendaylight-inventory
+    [Documentation]    Get all nodes and all link states (forwarding/discarding)
+       ${resp}    Get    session    ${REST_CONTEXT}
+        Should Be Equal As Strings    ${resp.status_code}    200
+        Should Contain     ${resp.content}     openflow:1
+        Should Contain     ${resp.content}     openflow:2
+        Should Contain     ${resp.content}     openflow:3
+        Should Contain X Times    ${resp.content}   forwarding  4
+        Should Contain X Times    ${resp.content}   discarding  2
+
+Get nodeconnectors for node 1
+    [Documentation]    Get the inventory for node 1
+        ${resp}    Get    session    ${REST_CONTEXT}/node/openflow:1
+        Should Be Equal As Strings   ${resp.status_code}    200
+        Should Contain     ${resp.content}      openflow:1:1
+        Should Contain     ${resp.content}      openflow:1:2
+        Should Contain     ${resp.content}      openflow:1:3
+
+Get nodeconnectors for node 2
+    [Documentation]    Get the inventory for node 2
+        ${resp}    Get    session    ${REST_CONTEXT}/node/openflow:2
+        Should Be Equal As Strings   ${resp.status_code}    200
+        Should Contain     ${resp.content}      openflow:2:1
+        Should Contain     ${resp.content}      openflow:2:2
+        Should Contain     ${resp.content}      openflow:2:3
+
+Get nodeconnectors for node 3
+    [Documentation]    Get the inventory for node 3
+        ${resp}    Get    session    ${REST_CONTEXT}/node/openflow:3
+        Should Be Equal As Strings   ${resp.status_code}    200
+        Should Contain     ${resp.content}      openflow:3:1
+        Should Contain     ${resp.content}      openflow:3:2
+        Should Contain     ${resp.content}      openflow:3:3
+
diff --git a/test/csit/suites/l2switch/Loop_Removal_OF13/020__ping.txt b/test/csit/suites/l2switch/Loop_Removal_OF13/020__ping.txt
new file mode 100644 (file)
index 0000000..be343b0
--- /dev/null
@@ -0,0 +1,34 @@
+*** Settings ***
+Documentation     Test suite for Pinging in Ring/Loop topology of size 3
+Suite Setup       Create Session   session   http://${CONTROLLER}:${PORT}   auth=${AUTH}   headers=${HEADERS_XML}
+Suite Teardown    Delete All Sessions
+Library           SSHLibrary
+Library           Collections
+Library           ../../../libraries/RequestsLibrary.py
+Library           ../../../libraries/Common.py
+Variables         ../../../variables/Variables.py
+
+*** Variables ***
+${REST_CONTEXT}    /restconf/operational/opendaylight-inventory:nodes
+
+*** Test Cases ***
+Ping All
+    [Documentation]    Pingall, verify no packet loss
+        Write   pingall
+        ${result}    Read Until                mininet>
+        Should Contain   ${result}   0% dropped
+        Should Contain X Times    ${result}   h1    3
+        Should Contain X Times    ${result}   h2    3
+        Should Contain X Times    ${result}   h3    3
+        Should Not Contain    ${result}    X
+
+
+Ping h1 to h2
+    [Documentation]    Ping h1 to h2, verify no packet loss or duplicates
+        Write   h1 ping -w 6 h2
+        Read Until     mininet>
+        Write   h2 ping -w 6 h1
+        ${result}    Read Until                mininet>
+        Should Contain   ${result}   0% packet loss
+        Should Not Contain    ${result}    duplicates
+
diff --git a/test/csit/suites/l2switch/Loop_Removal_OF13/__init__.txt b/test/csit/suites/l2switch/Loop_Removal_OF13/__init__.txt
new file mode 100644 (file)
index 0000000..5ed99db
--- /dev/null
@@ -0,0 +1,29 @@
+*** Settings ***
+Documentation     Test suite for L2switch's LoopRemoval using mininet OF13
+Suite Setup       Start Suite
+Suite Teardown    Stop Suite
+Library     SSHLibrary
+Library     OperatingSystem
+
+*** Variables ***
+${start}=  sudo mn --controller=remote,ip=${CONTROLLER} --custom customtopo.py --topo ring --switch ovsk,protocols=OpenFlow13
+
+** Keywords ***
+Start Suite
+    Log    Start mininet
+    Open Connection   ${MININET}     prompt=>  timeout=10
+    Login With Public Key    ${MININET_USER}   ${USER_HOME}/.ssh/id_rsa   any
+    Write    sudo ovs-vsctl set-manager ptcp:6644
+    Write    sudo mn -c
+    Read Until         >
+    Put File    ${CURDIR}/../topologies/customtopo.py
+    Write    ${start}
+    Read Until         mininet>
+    Sleep      10
+Stop Suite
+    Log    Stop mininet
+    Read
+    Write    exit
+    Read Until         >
+    Read
+    Close Connection
diff --git a/test/csit/suites/l2switch/topologies/customtopo.py b/test/csit/suites/l2switch/topologies/customtopo.py
new file mode 100755 (executable)
index 0000000..53327ad
--- /dev/null
@@ -0,0 +1,54 @@
+# !/usr/bin/python
+
+# usage: sudo mn --controller=remote,ip=<controller_ip> --switch=ovsk,protocols=OpenFlow13 --custom <path to customtopo.py> --topo ring ...
+
+from mininet.topo import Topo
+
+
+def add_hosts_to_switch(self, switch, hosts, start_host_suffix):
+    host_suffix = start_host_suffix
+    for _ in range(hosts):
+        host = self.addHost("h%s" % host_suffix)
+        self.addLink(switch, host)
+        host_suffix += 1
+
+
+class RingTopo(Topo):
+    def __init__(self, switches=3, hosts_per_switch=1, **opts):
+        Topo.__init__(self, **opts)
+        host_suffix = 1
+        switch = self.addSwitch('s%s' % 1)
+        first_switch = switch
+        for i in range(1, switches):
+            # add hosts to switch
+            add_hosts_to_switch(self, switch, hosts_per_switch, host_suffix)
+            host_suffix += hosts_per_switch
+
+            new_switch = self.addSwitch('s%s' % (i + 1))
+            self.addLink(new_switch, switch)
+            switch = new_switch
+
+        add_hosts_to_switch(self, switch, hosts_per_switch, host_suffix)
+        self.addLink(switch, first_switch)
+
+
+class MeshTopo(Topo):
+    def __init__(self, switches=3, hosts_per_switch=1, **opts):
+        Topo.__init__(self, **opts)
+        created_switches = []
+        host_suffix = 1
+        for i in range(switches):
+            new_switch = self.addSwitch('s%s' % (i + 1))
+
+            # add hosts to new switch
+            add_hosts_to_switch(self, new_switch, hosts_per_switch, host_suffix)
+            host_suffix += hosts_per_switch
+
+            for switch in created_switches:
+                self.addLink(new_switch, switch)
+
+            created_switches.append(new_switch)
+
+
+topos = {'ring': RingTopo,
+         'mesh': MeshTopo}
diff --git a/test/csit/suites/openflowplugin/Flows_OF13/300__dst_ip.txt b/test/csit/suites/openflowplugin/Flows_OF13/300__dst_ip.txt
new file mode 100644 (file)
index 0000000..cdc3502
--- /dev/null
@@ -0,0 +1,66 @@
+*** Settings ***
+Documentation     Test suite for pushing/verify/remove a flow through RESTCONF
+Suite Setup       Create Session    session    http://${CONTROLLER}:${RESTCONFPORT}    auth=${AUTH}    headers=${HEADERS_XML}
+Suite Teardown    Delete All Sessions
+Library           SSHLibrary
+Library           Collections
+Library           OperatingSystem
+Library           ../../../libraries/RequestsLibrary.py
+Library           ../../../libraries/Common.py
+Variables         ../../../variables/Variables.py
+
+*** Variables ***
+${REST_CON}       /restconf/config/opendaylight-inventory:nodes
+${REST_OPR}       /restconf/operational/opendaylight-inventory:nodes
+${FILE}           ${CURDIR}/../../../variables/xmls/f1.xml
+${FLOW}           124
+${TABLE}          2
+@{FLOWELMENTS}    nw_dst=10.0.1.0    table=2    dec_ttl
+
+*** Test Cases ***
+Add a flow - Output to physical port#
+    [Documentation]    Push a flow through REST-API
+    [Tags]    Push
+    ${body}    OperatingSystem.Get File    ${FILE}
+    Set Suite Variable    ${body}
+    ${resp}    Putxml    session    ${REST_CON}/node/openflow:1/table/${TABLE}/flow/${FLOW}    data=${body}
+    Should Be Equal As Strings    ${resp.status_code}    200
+
+Verify after adding flow config - Output to physical port#
+    [Documentation]    Verify the flow
+    [Tags]    Get
+    ${resp}    RequestsLibrary.get    session    ${REST_CON}/node/openflow:1/table/${TABLE}/flow/${FLOW}    headers=${ACCEPT_XML}
+    Should Be Equal As Strings    ${resp.status_code}    200
+    compare xml    ${body}    ${resp.content}
+
+Verify flows after adding flow config on OVS
+    [Documentation]    Checking Flows on switch
+    [Tags]    Switch
+    sleep    1
+    write    dpctl dump-flows -O OpenFlow13
+    ${body}    OperatingSystem.Get File    ${FILE}
+    ${switchouput}    Read Until    >
+    : FOR    ${flowElement}    IN    @{FLOWELMENTS}
+    \    should Contain    ${switchouput}    ${flowElement}
+
+Remove a flow - Output to physical port#
+    [Documentation]    Remove a flow
+    [Tags]    remove
+    ${resp}    RequestsLibrary.Delete    session    ${REST_CON}/node/openflow:1/table/${TABLE}/flow/${FLOW}
+    Should Be Equal As Strings    ${resp.status_code}    200
+
+Verify after deleting flow config - Output to physical port#
+    [Documentation]    Verify the flow
+    [Tags]    Get
+    ${resp}    RequestsLibrary.Get    session    ${REST_CON}/node/openflow:1/table/${TABLE}
+    Should Not Contain    ${resp.content}    ${FLOW}
+
+Verify flows after deleting flow config on OVS
+    [Documentation]    Checking Flows on switch
+    [Tags]    Switch
+    sleep    1
+    write    dpctl dump-flows -O OpenFlow13
+    ${body}    OperatingSystem.Get File    ${FILE}
+    ${switchouput}    Read Until    >
+    : FOR    ${flowElement}    IN    @{FLOWELMENTS}
+    \    should Not Contain    ${switchouput}    ${flowElement}
diff --git a/test/csit/suites/openflowplugin/Flows_OF13/301__src_ip.txt b/test/csit/suites/openflowplugin/Flows_OF13/301__src_ip.txt
new file mode 100644 (file)
index 0000000..16cd6d6
--- /dev/null
@@ -0,0 +1,66 @@
+*** Settings ***
+Documentation     Test suite for pushing/verify/remove a flow through RESTCONF
+Suite Setup       Create Session    session    http://${CONTROLLER}:${RESTCONFPORT}    auth=${AUTH}    headers=${HEADERS_XML}
+Suite Teardown    Delete All Sessions
+Library           SSHLibrary
+Library           Collections
+Library           OperatingSystem
+Library           ../../../libraries/RequestsLibrary.py
+Library           ../../../libraries/Common.py
+Variables         ../../../variables/Variables.py
+
+*** Variables ***
+${REST_CON}       /restconf/config/opendaylight-inventory:nodes
+${REST_OPR}       /restconf/operational/opendaylight-inventory:nodes
+${FILE}           ${CURDIR}/../../../variables/xmls/f2.xml
+${FLOW}           125
+${TABLE}          2
+@{FLOWELMENTS}    nw_src=10.0.0.1    table=2    drop
+
+*** Test Cases ***
+Add a flow - Output to physical port#
+    [Documentation]    Push a flow through REST-API
+    [Tags]    Push
+    ${body}    OperatingSystem.Get File    ${FILE}
+    Set Suite Variable    ${body}
+    ${resp}    Putxml    session    ${REST_CON}/node/openflow:1/table/${TABLE}/flow/${FLOW}    data=${body}
+    Should Be Equal As Strings    ${resp.status_code}    200
+
+Verify after adding flow config - Output to physical port#
+    [Documentation]    Verify the flow
+    [Tags]    Get
+    ${resp}    get    session    ${REST_CON}/node/openflow:1/table/${TABLE}/flow/${FLOW}    headers=${ACCEPT_XML}
+    Should Be Equal As Strings    ${resp.status_code}    200
+    compare xml    ${body}    ${resp.content}
+
+Verify flows after adding flow config on OVS
+    [Documentation]    Checking Flows on switch
+    [Tags]    Switch
+    sleep    1
+    write    dpctl dump-flows -O OpenFlow13
+    ${body}    OperatingSystem.Get File    ${FILE}
+    ${switchouput}    Read Until    >
+    : FOR    ${flowElement}    IN    @{FLOWELMENTS}
+    \    should Contain    ${switchouput}    ${flowElement}
+
+Remove a flow - Output to physical port#
+    [Documentation]    Remove a flow
+    [Tags]    remove
+    ${resp}    Delete    session    ${REST_CON}/node/openflow:1/table/${TABLE}/flow/${FLOW}
+    Should Be Equal As Strings    ${resp.status_code}    200
+
+Verify after deleting flow config - Output to physical port#
+    [Documentation]    Verify the flow
+    [Tags]    Get
+    ${resp}    Get    session    ${REST_CON}/node/openflow:1/table/${TABLE}
+    Should Not Contain    ${resp.content}    ${FLOW}
+
+Verify flows after deleting flow config on OVS
+    [Documentation]    Checking Flows on switch
+    [Tags]    Switch
+    sleep    1
+    write    dpctl dump-flows -O OpenFlow13
+    ${body}    OperatingSystem.Get File    ${FILE}
+    ${switchouput}    Read Until    >
+    : FOR    ${flowElement}    IN    @{FLOWELMENTS}
+    \    should Not Contain    ${switchouput}    ${flowElement}
diff --git a/test/csit/suites/openflowplugin/Flows_OF13/302__dst_mac.txt b/test/csit/suites/openflowplugin/Flows_OF13/302__dst_mac.txt
new file mode 100644 (file)
index 0000000..1b61f74
--- /dev/null
@@ -0,0 +1,66 @@
+*** Settings ***
+Documentation     Test suite for pushing/verify/remove a flow through RESTCONF
+Suite Setup       Create Session    session    http://${CONTROLLER}:${RESTCONFPORT}    auth=${AUTH}    headers=${HEADERS_XML}
+Suite Teardown    Delete All Sessions
+Library           SSHLibrary
+Library           Collections
+Library           OperatingSystem
+Library           ../../../libraries/RequestsLibrary.py
+Library           ../../../libraries/Common.py
+Variables         ../../../variables/Variables.py
+
+*** Variables ***
+${REST_CON}       /restconf/config/opendaylight-inventory:nodes
+${REST_OPR}       /restconf/operational/opendaylight-inventory:nodes
+${FILE}           ${CURDIR}/../../../variables/xmls/f3.xml
+${FLOW}           126
+${TABLE}          2
+@{FLOWELMENTS}    dl_src=00:00:00:00:00:01    table=2    drop
+
+*** Test Cases ***
+Add a flow - Output to physical port#
+    [Documentation]    Push a flow through REST-API
+    [Tags]    Push
+    ${body}    OperatingSystem.Get File    ${FILE}
+    Set Suite Variable    ${body}
+    ${resp}    Putxml    session    ${REST_CON}/node/openflow:1/table/${TABLE}/flow/${FLOW}    data=${body}
+    Should Be Equal As Strings    ${resp.status_code}    200
+
+Verify after adding flow config - Output to physical port#
+    [Documentation]    Verify the flow
+    [Tags]    Get
+    ${resp}    get    session    ${REST_CON}/node/openflow:1/table/${TABLE}/flow/${FLOW}    headers=${ACCEPT_XML}
+    Should Be Equal As Strings    ${resp.status_code}    200
+    compare xml    ${body}    ${resp.content}
+
+Verify flows after adding flow config on OVS
+    [Documentation]    Checking Flows on switch
+    [Tags]    Switch
+    sleep    1
+    write    dpctl dump-flows -O OpenFlow13
+    ${body}    OperatingSystem.Get File    ${FILE}
+    ${switchouput}    Read Until    >
+    : FOR    ${flowElement}    IN    @{FLOWELMENTS}
+    \    should Contain    ${switchouput}    ${flowElement}
+
+Remove a flow - Output to physical port#
+    [Documentation]    Remove a flow
+    [Tags]    remove
+    ${resp}    Delete    session    ${REST_CON}/node/openflow:1/table/${TABLE}/flow/${FLOW}
+    Should Be Equal As Strings    ${resp.status_code}    200
+
+Verify after deleting flow config - Output to physical port#
+    [Documentation]    Verify the flow
+    [Tags]    Get
+    ${resp}    Get    session    ${REST_CON}/node/openflow:1/table/${TABLE}
+    Should Not Contain    ${resp.content}    ${FLOW}
+
+Verify flows after deleting flow config on OVS
+    [Documentation]    Checking Flows on switch
+    [Tags]    Switch
+    sleep    1
+    write    dpctl dump-flows -O OpenFlow13
+    ${body}    OperatingSystem.Get File    ${FILE}
+    ${switchouput}    Read Until    >
+    : FOR    ${flowElement}    IN    @{FLOWELMENTS}
+    \    should Not Contain    ${switchouput}    ${flowElement}
diff --git a/test/csit/suites/openflowplugin/Flows_OF13/304__eth_ip_port.txt b/test/csit/suites/openflowplugin/Flows_OF13/304__eth_ip_port.txt
new file mode 100644 (file)
index 0000000..2177cec
--- /dev/null
@@ -0,0 +1,66 @@
+*** Settings ***
+Documentation     Test suite for IP,Ethernet and port
+Suite Setup       Create Session    session    http://${CONTROLLER}:${RESTCONFPORT}    auth=${AUTH}    headers=${HEADERS_XML}
+Suite Teardown    Delete All Sessions
+Library           SSHLibrary
+Library           Collections
+Library           OperatingSystem
+Library           ../../../libraries/RequestsLibrary.py
+Library           ../../../libraries/Common.py
+Variables         ../../../variables/Variables.py
+
+*** Variables ***
+${REST_CON}       /restconf/config/opendaylight-inventory:nodes
+${REST_OPR}       /restconf/operational/opendaylight-inventory:nodes
+${FILE}           ${CURDIR}/../../../variables/xmls/f5.xml
+${FLOW}           128
+${TABLE}          2
+@{FLOWELMENTS}    dl_dst=ff:ff:ff:ff:ff:ff    table=2    dec_ttl    dl_src=00:00:00:00:23:ae    nw_src=10.1.2.0    nw_dst=20.4.0.0    in_port=0
+
+*** Test Cases ***
+Add a flow - Output to physical port#
+    [Documentation]    Push a flow through REST-API
+    [Tags]    Push
+    ${body}    OperatingSystem.Get File    ${FILE}
+    Set Suite Variable    ${body}
+    ${resp}    Putxml    session    ${REST_CON}/node/openflow:1/table/${TABLE}/flow/${FLOW}    data=${body}
+    Should Be Equal As Strings    ${resp.status_code}    200
+
+Verify after adding flow config - Output to physical port#
+    [Documentation]    Verify the flow
+    [Tags]    Get
+    ${resp}    get    session    ${REST_CON}/node/openflow:1/table/${TABLE}/flow/${FLOW}    headers=${ACCEPT_XML}
+    Should Be Equal As Strings    ${resp.status_code}    200
+    compare xml    ${body}    ${resp.content}
+
+Verify flows after adding flow config on OVS
+    [Documentation]    Checking Flows on switch
+    [Tags]    Switch    mpls-ttl
+    sleep    1
+    write    dpctl dump-flows -O OpenFlow13
+    ${body}    OperatingSystem.Get File    ${FILE}
+    ${switchouput}    Read Until    >
+    : FOR    ${flowElement}    IN    @{FLOWELMENTS}
+    \    should Contain    ${switchouput}    ${flowElement}
+
+Remove a flow - Output to physical port#
+    [Documentation]    Remove a flow
+    [Tags]    remove
+    ${resp}    Delete    session    ${REST_CON}/node/openflow:1/table/${TABLE}/flow/${FLOW}
+    Should Be Equal As Strings    ${resp.status_code}    200
+
+Verify after deleting flow config - Output to physical port#
+    [Documentation]    Verify the flow
+    [Tags]    Get
+    ${resp}    Get    session    ${REST_CON}/node/openflow:1/table/${TABLE}
+    Should Not Contain    ${resp.content}    ${FLOW}
+
+Verify flows after deleting flow config on OVS
+    [Documentation]    Checking Flows on switch
+    [Tags]    Switch
+    sleep    1
+    write    dpctl dump-flows -O OpenFlow13
+    ${body}    OperatingSystem.Get File    ${FILE}
+    ${switchouput}    Read Until    >
+    : FOR    ${flowElement}    IN    @{FLOWELMENTS}
+    \    should Not Contain    ${switchouput}    ${flowElement}
diff --git a/test/csit/suites/openflowplugin/Flows_OF13/305__ttl.txt b/test/csit/suites/openflowplugin/Flows_OF13/305__ttl.txt
new file mode 100644 (file)
index 0000000..8420815
--- /dev/null
@@ -0,0 +1,89 @@
+*** Settings ***
+Documentation     OF1.3 Suite to cover TTL Actions
+...               - Set IP TTL
+...               - Decrement IP TTL
+...               - Copy TTL outwards
+...               - Copy TTL inwards
+...               - Set MPLS TTL
+...               - Decrement MPLS TTL
+...
+...               NOTE: for OVS, it appears that set_ttl, and both copy in/out are not supported, so need to skip those checks for now.
+Suite Setup       Create Session    session    http://${CONTROLLER}:${RESTCONFPORT}    auth=${AUTH}    headers=${HEADERS_XML}
+Suite Teardown    Delete All Sessions
+Test Template     Create And Remove Flow
+Library           SSHLibrary
+Library           Collections
+Library           OperatingSystem
+Library           String
+Library           XML
+Resource          ../../../libraries/FlowLib.txt
+Library           ../../../libraries/RequestsLibrary.py
+Library           ../../../libraries/Common.py
+Variables         ../../../variables/Variables.py
+
+*** Variables ***
+${REST_CON}       /restconf/config/opendaylight-inventory:nodes
+${REST_OPR}       /restconf/operational/opendaylight-inventory:nodes
+${GENERIC_ACTION_FLOW_FILE}    ${CURDIR}/../../../variables/xmls/genericActionFlow.xml
+${ipv4_src}       10.1.2.0/24
+${ipv4_dst}       40.4.0.0/16
+${eth_type}       0x800
+${eth_src}        00:00:00:01:23:ae
+${eth_dst}        ff:ff:ff:ff:ff:ff
+${node_id}        openflow:1
+${set_ip_ttl_doc}    OF1.3: \ OFPAT_SET_NW_TTL = 23, /* IP TTL. */\n(currently not supported on OVS)
+${dec_ttl_doc}    OF1.3: \ OFPAT_DEC_NW_TTL = 24, /* Decrement IP TTL. */
+${copy_ttl_in_doc}    OFPAT_COPY_TTL_IN = 12, /* Copy TTL "inwards" -- from outermost to\nnext-to-outermost */\n(currently NOT supported in OVS)\n
+${copy_ttl_out_doc}    OFPAT_COPY_TTL_OUT = 11, /* Copy TTL "outwards" -- from next-to-outermost\nto outermost */\n(currently NOT suported in OVS)
+${set_mpls_ttl_doc}    OFPAT_SET_MPLS_TTL = 15, /* MPLS TTL */
+${dec_mpls_ttl_doc}    OFPAT_DEC_MPLS_TTL = 16, /* Decrement MPLS TTL */
+
+*** Test Cases ***    ODL flow action        action key             action value    tableID    flowID    verify OVS?    OVS specific string?
+Set_IP_TTL            [Documentation]        ${set_ip_ttl_doc}
+                      [Tags]                 ttl                    set
+                      set-nw-ttl-action      nw-ttl                 1               2          101       no             set_ttl
+
+Dec_TTL               [Documentation]        ${dec_ttl_doc}
+                      [Tags]                 ttl                    dec
+                      dec-nw-ttl             none                   none            3          305       yes            dec_ttl
+
+Copy_TTL_In           [Documentation]        ${copy_ttl_in_doc}
+                      [Tags]                 ttl                    copyin
+                      copy-ttl-in            none                   none            9          202       no             copy_ttl_in
+
+Copy_TTL_Out          [Documentation]        ${copy_ttl_out_doc}
+                      [Tags]                 ttl                    copyout
+                      copy-ttl-out           none                   none            8          909       no             copy_ttl_out
+
+Set_MPLS_TTL          [Documentation]        ${set_mpls_ttl_doc}
+                      [Tags]                 ttl                    setmpls
+                      set-mpls-ttl-action    mpls-ttl               1               4          505       yes            set_mpls_ttl
+
+Dec_MPLS_TTL          [Documentation]        ${dec_mpls_ttl_doc}
+                      [Tags]                 ttl                    decmpls
+                      dec-mpls-ttl           none                   none            2          1001      yes            dec_mpls_ttl
+
+*** Keywords ***
+Create And Remove Flow
+    [Arguments]    ${flow_action}    ${action_key}    ${action_value}    ${table_id}    ${flow_id}    ${verify_switch_flag}
+    ...    ${additional_ovs_flowelements}
+    @{OVS_FLOWELEMENTS}    Create List    dl_dst=${eth_dst}    table=${table_id}    dl_src=${eth_src}    nw_src=${ipv4_src}    nw_dst=${ipv4_dst}
+    ...    ${additional_ovs_flowelements}
+    ##The dictionaries here will be used to populate the match and action elements of the flow mod
+    ${ethernet_match_dict}=    Create Dictionary    type=${eth_type}    destination=${eth_dst}    source=${eth_src}
+    ${ipv4_match_dict}=    Create Dictionary    source=${ipv4_src}    destination=${ipv4_dst}
+    ##flow is a python Object to build flow details, including the xml format to send to controller
+    ${flow}=    Create Inventory Flow
+    Set "${flow}" "table_id" With "${table_id}"
+    Set "${flow}" "id" With "${flow_id}"
+    Clear Flow Actions    ${flow}
+    Set Flow Action    ${flow}    0    0    ${flow_action}
+    Set Flow Ethernet Match    ${flow}    ${ethernet_match_dict}
+    Set Flow IPv4 Match    ${flow}    ${ipv4_match_dict}
+    ##If the ${flow_action} contains the string "set" we need to include a deeper action detail (e.g. set-ttl needs a element to indicate the value to set it to)
+    Run Keyword If    "set" in "${flow_action}"    Add Flow XML Element    ${flow}    ${action_key}    ${action_value}    instructions/instruction/apply-actions/action/${flow_action}
+    Log    Flow XML is ${flow.xml}
+    Add Flow To Controller And Verify    ${flow.xml}    ${node_id}    ${flow.table_id}    ${flow.id}
+    Run Keyword If    "${verify_switch_flag}" == "yes"    Verify Flow On Mininet Switch    ${OVS_FLOWELEMENTS}
+    Remove Flow From Controller And Verify    ${flow.xml}    ${node_id}    ${flow.table_id}    ${flow.id}
+    Run Keyword If    "${verify_switch_flag}" == "yes"    Verify Flow Does Not Exist On Mininet Switch    ${OVS_FLOWELEMENTS}
diff --git a/test/csit/suites/openflowplugin/Flows_OF13/306__eth_ip_qos.txt b/test/csit/suites/openflowplugin/Flows_OF13/306__eth_ip_qos.txt
new file mode 100644 (file)
index 0000000..0df55e4
--- /dev/null
@@ -0,0 +1,67 @@
+*** Settings ***
+Documentation     Test suite for IP,Ethernet,DSCP and Action dec TTL
+Suite Setup       Create Session    session    http://${CONTROLLER}:${RESTCONFPORT}    auth=${AUTH}    headers=${HEADERS_XML}
+Suite Teardown    Delete All Sessions
+Library           SSHLibrary
+Library           Collections
+Library           OperatingSystem
+Library           ../../../libraries/RequestsLibrary.py
+Library           ../../../libraries/Common.py
+Variables         ../../../variables/Variables.py
+
+*** Variables ***
+${REST_CON}       /restconf/config/opendaylight-inventory:nodes
+${REST_OPR}       /restconf/operational/opendaylight-inventory:nodes
+${FILE}           ${CURDIR}/../../../variables/xmls/f7.xml
+${FLOW}           130
+${TABLE}          2
+@{FLOWELMENTS}    dl_dst=ff:ff:ff:ff:ff:aa    table=2    nw_ecn=1    dl_src=00:00:00:11:23:ae    nw_src=10.1.2.0    nw_dst=20.4.0.0    dec_ttl
+...               nw_proto=56    nw_tos=60
+
+*** Test Cases ***
+Add a flow - Output to physical port#
+    [Documentation]    Push a flow through REST-API
+    [Tags]    Push
+    ${body}    OperatingSystem.Get File    ${FILE}
+    Set Suite Variable    ${body}
+    ${resp}    Putxml    session    ${REST_CON}/node/openflow:1/table/${TABLE}/flow/${FLOW}    data=${body}
+    Should Be Equal As Strings    ${resp.status_code}    200
+
+Verify after adding flow config - Output to physical port#
+    [Documentation]    Verify the flow
+    [Tags]    Get
+    ${resp}    get    session    ${REST_CON}/node/openflow:1/table/${TABLE}/flow/${FLOW}    headers=${ACCEPT_XML}
+    Should Be Equal As Strings    ${resp.status_code}    200
+    compare xml    ${body}    ${resp.content}
+
+Verify flows after adding flow config on OVS
+    [Documentation]    Checking Flows on switch
+    [Tags]    Switch    ${EMPTY}
+    sleep    1
+    write    dpctl dump-flows -O OpenFlow13
+    ${body}    OperatingSystem.Get File    ${FILE}
+    ${switchouput}    Read Until    >
+    : FOR    ${flowElement}    IN    @{FLOWELMENTS}
+    \    should Contain    ${switchouput}    ${flowElement}
+
+Remove a flow - Output to physical port#
+    [Documentation]    Remove a flow
+    [Tags]    remove
+    ${resp}    Delete    session    ${REST_CON}/node/openflow:1/table/${TABLE}/flow/${FLOW}
+    Should Be Equal As Strings    ${resp.status_code}    200
+
+Verify after deleting flow config - Output to physical port#
+    [Documentation]    Verify the flow
+    [Tags]    Get
+    ${resp}    Get    session    ${REST_CON}/node/openflow:1/table/${TABLE}
+    Should Not Contain    ${resp.content}    ${FLOW}
+
+Verify flows after deleting flow config on OVS
+    [Documentation]    Checking Flows on switch
+    [Tags]    Switch
+    sleep    1
+    write    dpctl dump-flows -O OpenFlow13
+    ${body}    OperatingSystem.Get File    ${FILE}
+    ${switchouput}    Read Until    >
+    : FOR    ${flowElement}    IN    @{FLOWELMENTS}
+    \    should Not Contain    ${switchouput}    ${flowElement}
diff --git a/test/csit/suites/openflowplugin/Flows_OF13/307__eth_ip_qos_port_tcpport.txt b/test/csit/suites/openflowplugin/Flows_OF13/307__eth_ip_qos_port_tcpport.txt
new file mode 100644 (file)
index 0000000..6683e04
--- /dev/null
@@ -0,0 +1,67 @@
+*** Settings ***
+Documentation     Test suite for IP,Ethernet,QoS, TCP dst/src port and Action dec MPLS TTL
+Suite Setup       Create Session    session    http://${CONTROLLER}:${RESTCONFPORT}    auth=${AUTH}    headers=${HEADERS_XML}
+Suite Teardown    Delete All Sessions
+Library           SSHLibrary
+Library           Collections
+Library           OperatingSystem
+Library           ../../../libraries/RequestsLibrary.py
+Library           ../../../libraries/Common.py
+Variables         ../../../variables/Variables.py
+
+*** Variables ***
+${REST_CON}       /restconf/config/opendaylight-inventory:nodes
+${REST_OPR}       /restconf/operational/opendaylight-inventory:nodes
+${FILE}           ${CURDIR}/../../../variables/xmls/f8.xml
+${FLOW}           131
+${TABLE}          2
+@{FLOWELMENTS}    dl_dst=ff:ff:29:01:19:61    table=2    nw_ecn=2    dl_src=00:00:00:11:23:ae    nw_src=17.0.0.0    nw_dst=172.168.0.0    dec_ttl
+...               tcp    nw_tos=8    in_port=0    tp_dst=8080    tp_src=25364
+
+*** Test Cases ***
+Add a flow - Output to physical port#
+    [Documentation]    Push a flow through REST-API
+    [Tags]    Push
+    ${body}    OperatingSystem.Get File    ${FILE}
+    Set Suite Variable    ${body}
+    ${resp}    Putxml    session    ${REST_CON}/node/openflow:1/table/${TABLE}/flow/${FLOW}    data=${body}
+    Should Be Equal As Strings    ${resp.status_code}    200
+
+Verify after adding flow config - Output to physical port#
+    [Documentation]    Verify the flow
+    [Tags]    Get
+    ${resp}    get    session    ${REST_CON}/node/openflow:1/table/${TABLE}/flow/${FLOW}    headers=${ACCEPT_XML}
+    Should Be Equal As Strings    ${resp.status_code}    200
+    compare xml    ${body}    ${resp.content}
+
+Verify flows after adding flow config on OVS
+    [Documentation]    Checking Flows on switch
+    [Tags]    Switch    ${EMPTY}
+    sleep    1
+    write    dpctl dump-flows -O OpenFlow13
+    ${body}    OperatingSystem.Get File    ${FILE}
+    ${switchouput}    Read Until    >
+    : FOR    ${flowElement}    IN    @{FLOWELMENTS}
+    \    should Contain    ${switchouput}    ${flowElement}
+
+Remove a flow - Output to physical port#
+    [Documentation]    Remove a flow
+    [Tags]    remove
+    ${resp}    Delete    session    ${REST_CON}/node/openflow:1/table/${TABLE}/flow/${FLOW}
+    Should Be Equal As Strings    ${resp.status_code}    200
+
+Verify after deleting flow config - Output to physical port#
+    [Documentation]    Verify the flow
+    [Tags]    Get
+    ${resp}    Get    session    ${REST_CON}/node/openflow:1/table/${TABLE}
+    Should Not Contain    ${resp.content}    ${FLOW}
+
+Verify flows after deleting flow config on OVS
+    [Documentation]    Checking Flows on switch
+    [Tags]    Switch
+    sleep    1
+    write    dpctl dump-flows -O OpenFlow13
+    ${body}    OperatingSystem.Get File    ${FILE}
+    ${switchouput}    Read Until    >
+    : FOR    ${flowElement}    IN    @{FLOWELMENTS}
+    \    should Not Contain    ${switchouput}    ${flowElement}
diff --git a/test/csit/suites/openflowplugin/Flows_OF13/308__eth_ip_qos_port_tcpport_mpls.txt b/test/csit/suites/openflowplugin/Flows_OF13/308__eth_ip_qos_port_tcpport_mpls.txt
new file mode 100644 (file)
index 0000000..1c0cc7d
--- /dev/null
@@ -0,0 +1,67 @@
+*** Settings ***
+Documentation     Test suite for IP,Ethernet,QoS, TCP dst/src port and Action dec MPLS TTL
+Suite Setup       Create Session    session    http://${CONTROLLER}:${RESTCONFPORT}    auth=${AUTH}    headers=${HEADERS_XML}
+Suite Teardown    Delete All Sessions
+Library           SSHLibrary
+Library           Collections
+Library           OperatingSystem
+Library           ../../../libraries/RequestsLibrary.py
+Library           ../../../libraries/Common.py
+Variables         ../../../variables/Variables.py
+
+*** Variables ***
+${REST_CON}       /restconf/config/opendaylight-inventory:nodes
+${REST_OPR}       /restconf/operational/opendaylight-inventory:nodes
+${FILE}           ${CURDIR}/../../../variables/xmls/f9.xml
+${FLOW}           132
+${TABLE}          2
+@{FLOWELMENTS}    dl_dst=20:14:29:01:19:61    table=2    nw_ecn=3    dl_src=00:00:00:11:23:ae    nw_src=19.1.0.0    nw_dst=172.168.5.0    dec_ttl
+...               udp    nw_tos=32    in_port=0    tp_dst=8080    tp_src=25364
+
+*** Test Cases ***
+Add a flow - Output to physical port#
+    [Documentation]    Push a flow through REST-API
+    [Tags]    Push
+    ${body}    OperatingSystem.Get File    ${FILE}
+    Set Suite Variable    ${body}
+    ${resp}    Putxml    session    ${REST_CON}/node/openflow:1/table/${TABLE}/flow/${FLOW}    data=${body}
+    Should Be Equal As Strings    ${resp.status_code}    200
+
+Verify after adding flow config - Output to physical port#
+    [Documentation]    Verify the flow
+    [Tags]    Get
+    ${resp}    get    session    ${REST_CON}/node/openflow:1/table/${TABLE}/flow/${FLOW}    headers=${ACCEPT_XML}
+    Should Be Equal As Strings    ${resp.status_code}    200
+    compare xml    ${body}    ${resp.content}
+
+Verify flows after adding flow config on OVS
+    [Documentation]    Checking Flows on switch
+    [Tags]    Switch
+    sleep    1
+    write    dpctl dump-flows -O OpenFlow13
+    ${body}    OperatingSystem.Get File    ${FILE}
+    ${switchouput}    Read Until    >
+    : FOR    ${flowElement}    IN    @{FLOWELMENTS}
+    \    should Contain    ${switchouput}    ${flowElement}
+
+Remove a flow - Output to physical port#
+    [Documentation]    Remove a flow
+    [Tags]    remove
+    ${resp}    Delete    session    ${REST_CON}/node/openflow:1/table/${TABLE}/flow/${FLOW}
+    Should Be Equal As Strings    ${resp.status_code}    200
+
+Verify after deleting flow config - Output to physical port#
+    [Documentation]    Verify the flow
+    [Tags]    Get
+    ${resp}    Get    session    ${REST_CON}/node/openflow:1/table/${TABLE}
+    Should Not Contain    ${resp.content}    ${FLOW}
+
+Verify flows after deleting flow config on OVS
+    [Documentation]    Checking Flows on switch
+    [Tags]    Switch
+    sleep    1
+    write    dpctl dump-flows -O OpenFlow13
+    ${body}    OperatingSystem.Get File    ${FILE}
+    ${switchouput}    Read Until    >
+    : FOR    ${flowElement}    IN    @{FLOWELMENTS}
+    \    should Not Contain    ${switchouput}    ${flowElement}
diff --git a/test/csit/suites/openflowplugin/Flows_OF13/309__eth_ip_qos_sctp.txt b/test/csit/suites/openflowplugin/Flows_OF13/309__eth_ip_qos_sctp.txt
new file mode 100644 (file)
index 0000000..c2504ee
--- /dev/null
@@ -0,0 +1,67 @@
+*** Settings ***
+Documentation     Test suite for IP,Ethernet,QoS, SCTP dst/src port and Action dec TTL
+Suite Setup       Create Session    session    http://${CONTROLLER}:${RESTCONFPORT}    auth=${AUTH}    headers=${HEADERS_XML}
+Suite Teardown    Delete All Sessions
+Library           SSHLibrary
+Library           Collections
+Library           OperatingSystem
+Library           ../../../libraries/RequestsLibrary.py
+Library           ../../../libraries/Common.py
+Variables         ../../../variables/Variables.py
+
+*** Variables ***
+${REST_CON}       /restconf/config/opendaylight-inventory:nodes
+${REST_OPR}       /restconf/operational/opendaylight-inventory:nodes
+${FILE}           ${CURDIR}/../../../variables/xmls/f10.xml
+${FLOW}           133
+${TABLE}          2
+@{FLOWELMENTS}    dl_dst=ff:ff:29:01:19:61    table=2    nw_ecn=0    dl_src=00:00:00:11:23:ae    nw_src=17.0.0.0    nw_dst=172.168.0.0    dec_ttl
+...               sctp    nw_tos=0    in_port=0    tp_dst=384    tp_src=768
+
+*** Test Cases ***
+Add a flow - Output to physical port#
+    [Documentation]    Push a flow through REST-API
+    [Tags]    Push
+    ${body}    OperatingSystem.Get File    ${FILE}
+    Set Suite Variable    ${body}
+    ${resp}    Putxml    session    ${REST_CON}/node/openflow:1/table/${TABLE}/flow/${FLOW}    data=${body}
+    Should Be Equal As Strings    ${resp.status_code}    200
+
+Verify after adding flow config - Output to physical port#
+    [Documentation]    Verify the flow
+    [Tags]    Get
+    ${resp}    get    session    ${REST_CON}/node/openflow:1/table/${TABLE}/flow/${FLOW}    headers=${ACCEPT_XML}
+    Should Be Equal As Strings    ${resp.status_code}    200
+    compare xml    ${body}    ${resp.content}
+
+Verify flows after adding flow config on OVS
+    [Documentation]    Checking Flows on switch
+    [Tags]    Switch
+    sleep    1
+    write    dpctl dump-flows -O OpenFlow13
+    ${body}    OperatingSystem.Get File    ${FILE}
+    ${switchouput}    Read Until    >
+    : FOR    ${flowElement}    IN    @{FLOWELMENTS}
+    \    should Contain    ${switchouput}    ${flowElement}
+
+Remove a flow - Output to physical port#
+    [Documentation]    Remove a flow
+    [Tags]    remove
+    ${resp}    Delete    session    ${REST_CON}/node/openflow:1/table/${TABLE}/flow/${FLOW}
+    Should Be Equal As Strings    ${resp.status_code}    200
+
+Verify after deleting flow config - Output to physical port#
+    [Documentation]    Verify the flow
+    [Tags]    Get
+    ${resp}    Get    session    ${REST_CON}/node/openflow:1/table/${TABLE}
+    Should Not Contain    ${resp.content}    ${FLOW}
+
+Verify flows after deleting flow config on OVS
+    [Documentation]    Checking Flows on switch
+    [Tags]    Switch
+    sleep    1
+    write    dpctl dump-flows -O OpenFlow13
+    ${body}    OperatingSystem.Get File    ${FILE}
+    ${switchouput}    Read Until    >
+    : FOR    ${flowElement}    IN    @{FLOWELMENTS}
+    \    should Not Contain    ${switchouput}    ${flowElement}
diff --git a/test/csit/suites/openflowplugin/Flows_OF13/310__eth_ip_qos_icmp.txt b/test/csit/suites/openflowplugin/Flows_OF13/310__eth_ip_qos_icmp.txt
new file mode 100644 (file)
index 0000000..25a9e41
--- /dev/null
@@ -0,0 +1,67 @@
+*** Settings ***
+Documentation     Test suite for IP,Ethernet,QoS, SCTP dst/src port and Action dec TTL
+Suite Setup       Create Session    session    http://${CONTROLLER}:${RESTCONFPORT}    auth=${AUTH}    headers=${HEADERS_XML}
+Suite Teardown    Delete All Sessions
+Library           SSHLibrary
+Library           Collections
+Library           OperatingSystem
+Library           ../../../libraries/RequestsLibrary.py
+Library           ../../../libraries/Common.py
+Variables         ../../../variables/Variables.py
+
+*** Variables ***
+${REST_CON}       /restconf/config/opendaylight-inventory:nodes
+${REST_OPR}       /restconf/operational/opendaylight-inventory:nodes
+${FILE}           ${CURDIR}/../../../variables/xmls/f11.xml
+${FLOW}           134
+${TABLE}          2
+@{FLOWELMENTS}    dl_dst=ff:ff:29:01:19:61    table=2    nw_ecn=3    dl_src=00:00:00:11:23:ae    nw_src=17.0.0.0    nw_dst=172.168.0.0    dec_ttl
+...               icmp    nw_tos=108    in_port=0    icmp_type=6    icmp_code=3
+
+*** Test Cases ***
+Add a flow - Output to physical port#
+    [Documentation]    Push a flow through REST-API
+    [Tags]    Push
+    ${body}    OperatingSystem.Get File    ${FILE}
+    Set Suite Variable    ${body}
+    ${resp}    Putxml    session    ${REST_CON}/node/openflow:1/table/${TABLE}/flow/${FLOW}    data=${body}
+    Should Be Equal As Strings    ${resp.status_code}    200
+
+Verify after adding flow config - Output to physical port#
+    [Documentation]    Verify the flow
+    [Tags]    Get
+    ${resp}    get    session    ${REST_CON}/node/openflow:1/table/${TABLE}/flow/${FLOW}    headers=${ACCEPT_XML}
+    Should Be Equal As Strings    ${resp.status_code}    200
+    compare xml    ${body}    ${resp.content}
+
+Verify flows after adding flow config on OVS
+    [Documentation]    Checking Flows on switch
+    [Tags]    Switch
+    sleep    1
+    write    dpctl dump-flows -O OpenFlow13
+    ${body}    OperatingSystem.Get File    ${FILE}
+    ${switchouput}    Read Until    >
+    : FOR    ${flowElement}    IN    @{FLOWELMENTS}
+    \    should Contain    ${switchouput}    ${flowElement}
+
+Remove a flow - Output to physical port#
+    [Documentation]    Remove a flow
+    [Tags]    remove
+    ${resp}    Delete    session    ${REST_CON}/node/openflow:1/table/${TABLE}/flow/${FLOW}
+    Should Be Equal As Strings    ${resp.status_code}    200
+
+Verify after deleting flow config - Output to physical port#
+    [Documentation]    Verify the flow
+    [Tags]    Get
+    ${resp}    Get    session    ${REST_CON}/node/openflow:1/table/${TABLE}
+    Should Not Contain    ${resp.content}    ${FLOW}
+
+Verify flows after deleting flow config on OVS
+    [Documentation]    Checking Flows on switch
+    [Tags]    Switch
+    Sleep    1
+    write    dpctl dump-flows -O OpenFlow13
+    ${body}    OperatingSystem.Get File    ${FILE}
+    ${switchouput}    Read Until    >
+    : FOR    ${flowElement}    IN    @{FLOWELMENTS}
+    \    should Not Contain    ${switchouput}    ${flowElement}
diff --git a/test/csit/suites/openflowplugin/Flows_OF13/311__eth_arp.txt b/test/csit/suites/openflowplugin/Flows_OF13/311__eth_arp.txt
new file mode 100644 (file)
index 0000000..104277e
--- /dev/null
@@ -0,0 +1,66 @@
+*** Settings ***
+Documentation     Test suite for Ethernet,QoS, ARP and Action drop
+Suite Setup       Create Session    session    http://${CONTROLLER}:${RESTCONFPORT}    auth=${AUTH}    headers=${HEADERS_XML}
+Suite Teardown    Delete All Sessions
+Library           SSHLibrary
+Library           Collections
+Library           OperatingSystem
+Library           ../../../libraries/RequestsLibrary.py
+Library           ../../../libraries/Common.py
+Variables         ../../../variables/Variables.py
+
+*** Variables ***
+${REST_CON}       /restconf/config/opendaylight-inventory:nodes
+${REST_OPR}       /restconf/operational/opendaylight-inventory:nodes
+${FILE}           ${CURDIR}/../../../variables/xmls/f12.xml
+${FLOW}           135
+${TABLE}          2
+@{FLOWELMENTS}    dl_dst=ff:ff:ff:ff:ff:ff    table=2    dl_src=00:00:00:01:23:ae    drop    arp    arp_op=1
+
+*** Test Cases ***
+Add a flow - Output to physical port#
+    [Documentation]    Push a flow through REST-API
+    [Tags]    Push
+    ${body}    OperatingSystem.Get File    ${FILE}
+    Set Suite Variable    ${body}
+    ${resp}    Putxml    session    ${REST_CON}/node/openflow:1/table/${TABLE}/flow/${FLOW}    data=${body}
+    Should Be Equal As Strings    ${resp.status_code}    200
+
+Verify after adding flow config - Output to physical port#
+    [Documentation]    Verify the flow
+    [Tags]    Get
+    ${resp}    get    session    ${REST_CON}/node/openflow:1/table/${TABLE}/flow/${FLOW}    headers=${ACCEPT_XML}
+    Should Be Equal As Strings    ${resp.status_code}    200
+    compare xml    ${body}    ${resp.content}
+
+Verify flows after adding flow config on OVS
+    [Documentation]    Checking Flows on switch
+    [Tags]    Switch
+    sleep    1
+    write    dpctl dump-flows -O OpenFlow13
+    ${body}    OperatingSystem.Get File    ${FILE}
+    ${switchouput}    Read Until    >
+    : FOR    ${flowElement}    IN    @{FLOWELMENTS}
+    \    should Contain    ${switchouput}    ${flowElement}
+
+Remove a flow - Output to physical port#
+    [Documentation]    Remove a flow
+    [Tags]    remove
+    ${resp}    Delete    session    ${REST_CON}/node/openflow:1/table/${TABLE}/flow/${FLOW}
+    Should Be Equal As Strings    ${resp.status_code}    200
+
+Verify after deleting flow config - Output to physical port#
+    [Documentation]    Verify the flow
+    [Tags]    Get
+    ${resp}    Get    session    ${REST_CON}/node/openflow:1/table/${TABLE}
+    Should Not Contain    ${resp.content}    ${FLOW}
+
+Verify flows after deleting flow config on OVS
+    [Documentation]    Checking Flows on switch
+    [Tags]    Switch
+    Sleep    1
+    write    dpctl dump-flows -O OpenFlow13
+    ${body}    OperatingSystem.Get File    ${FILE}
+    ${switchouput}    Read Until    >
+    : FOR    ${flowElement}    IN    @{FLOWELMENTS}
+    \    should Not Contain    ${switchouput}    ${flowElement}
diff --git a/test/csit/suites/openflowplugin/Flows_OF13/312__eth_arp_transport.txt b/test/csit/suites/openflowplugin/Flows_OF13/312__eth_arp_transport.txt
new file mode 100644 (file)
index 0000000..410538c
--- /dev/null
@@ -0,0 +1,67 @@
+*** Settings ***
+Documentation     Test suite for Ethernet,QoS, ARP and Action drop
+Suite Setup       Create Session    session    http://${CONTROLLER}:${RESTCONFPORT}    auth=${AUTH}    headers=${HEADERS_XML}
+Suite Teardown    Delete All Sessions
+Library           SSHLibrary
+Library           Collections
+Library           OperatingSystem
+Library           ../../../libraries/RequestsLibrary.py
+Library           ../../../libraries/Common.py
+Variables         ../../../variables/Variables.py
+
+*** Variables ***
+${REST_CON}       /restconf/config/opendaylight-inventory:nodes
+${REST_OPR}       /restconf/operational/opendaylight-inventory:nodes
+${FILE}           ${CURDIR}/../../../variables/xmls/f13.xml
+${FLOW}           136
+${TABLE}          2
+@{FLOWELMENTS}    dl_dst=ff:ff:ff:ff:ff:ff    table=2    dl_src=00:00:00:01:23:ae    drop    arp    arp_op=1    arp_spa=192.168.4.1
+...               arp_tpa=10.21.22.23
+
+*** Test Cases ***
+Add a flow - Output to physical port#
+    [Documentation]    Push a flow through REST-API
+    [Tags]    Push
+    ${body}    OperatingSystem.Get File    ${FILE}
+    Set Suite Variable    ${body}
+    ${resp}    Putxml    session    ${REST_CON}/node/openflow:1/table/${TABLE}/flow/${FLOW}    data=${body}
+    Should Be Equal As Strings    ${resp.status_code}    200
+
+Verify after adding flow config - Output to physical port#
+    [Documentation]    Verify the flow
+    [Tags]    Get
+    ${resp}    get    session    ${REST_CON}/node/openflow:1/table/${TABLE}/flow/${FLOW}    headers=${ACCEPT_XML}
+    Should Be Equal As Strings    ${resp.status_code}    200
+    compare xml    ${body}    ${resp.content}
+
+Verify flows after adding flow config on OVS
+    [Documentation]    Checking Flows on switch
+    [Tags]    Switch
+    sleep    1
+    write    dpctl dump-flows -O OpenFlow13
+    ${body}    OperatingSystem.Get File    ${FILE}
+    ${switchouput}    Read Until    >
+    : FOR    ${flowElement}    IN    @{FLOWELMENTS}
+    \    should Contain    ${switchouput}    ${flowElement}
+
+Remove a flow - Output to physical port#
+    [Documentation]    Remove a flow
+    [Tags]    remove
+    ${resp}    Delete    session    ${REST_CON}/node/openflow:1/table/${TABLE}/flow/${FLOW}
+    Should Be Equal As Strings    ${resp.status_code}    200
+
+Verify after deleting flow config - Output to physical port#
+    [Documentation]    Verify the flow
+    [Tags]    Get
+    ${resp}    Get    session    ${REST_CON}/node/openflow:1/table/${TABLE}
+    Should Not Contain    ${resp.content}    ${FLOW}
+
+Verify flows after deleting flow config on OVS
+    [Documentation]    Checking Flows on switch
+    [Tags]    Switch
+    Sleep    1
+    write    dpctl dump-flows -O OpenFlow13
+    ${body}    OperatingSystem.Get File    ${FILE}
+    ${switchouput}    Read Until    >
+    : FOR    ${flowElement}    IN    @{FLOWELMENTS}
+    \    should Not Contain    ${switchouput}    ${flowElement}
diff --git a/test/csit/suites/openflowplugin/Flows_OF13/313__eth_arp_transport_hardware.txt b/test/csit/suites/openflowplugin/Flows_OF13/313__eth_arp_transport_hardware.txt
new file mode 100644 (file)
index 0000000..ca10e53
--- /dev/null
@@ -0,0 +1,67 @@
+*** Settings ***
+Documentation     Test suite for Ethernet,QoS, ARP and Action drop
+Suite Setup       Create Session    session    http://${CONTROLLER}:${RESTCONFPORT}    auth=${AUTH}    headers=${HEADERS_XML}
+Suite Teardown    Delete All Sessions
+Library           SSHLibrary
+Library           Collections
+Library           OperatingSystem
+Library           ../../../libraries/RequestsLibrary.py
+Library           ../../../libraries/Common.py
+Variables         ../../../variables/Variables.py
+
+*** Variables ***
+${REST_CON}       /restconf/config/opendaylight-inventory:nodes
+${REST_OPR}       /restconf/operational/opendaylight-inventory:nodes
+${FILE}           ${CURDIR}/../../../variables/xmls/f14.xml
+${FLOW}           137
+${TABLE}          2
+@{FLOWELMENTS}    dl_dst=ff:ff:ff:ff:ff:ff    table=2    dl_src=00:00:fc:01:23:ae    CONTROLLER:60    arp    arp_op=1    arp_spa=192.168.4.1
+...               arp_tpa=10.21.22.23    arp_tha=fe:dc:ba:98:76:54    arp_sha=12:34:56:78:98:ab
+
+*** Test Cases ***
+Add a flow - Output to physical port#
+    [Documentation]    Push a flow through REST-API
+    [Tags]    Push
+    ${body}    OperatingSystem.Get File    ${FILE}
+    Set Suite Variable    ${body}
+    ${resp}    Putxml    session    ${REST_CON}/node/openflow:1/table/${TABLE}/flow/${FLOW}    data=${body}
+    Should Be Equal As Strings    ${resp.status_code}    200
+
+Verify after adding flow config - Output to physical port#
+    [Documentation]    Verify the flow
+    [Tags]    Get
+    ${resp}    get    session    ${REST_CON}/node/openflow:1/table/${TABLE}/flow/${FLOW}    headers=${ACCEPT_XML}
+    Should Be Equal As Strings    ${resp.status_code}    200
+    compare xml    ${body}    ${resp.content}
+
+Verify flows after adding flow config on OVS
+    [Documentation]    Checking Flows on switch
+    [Tags]    Switch
+    sleep    1
+    write    dpctl dump-flows -O OpenFlow13
+    ${body}    OperatingSystem.Get File    ${FILE}
+    ${switchouput}    Read Until    >
+    : FOR    ${flowElement}    IN    @{FLOWELMENTS}
+    \    should Contain    ${switchouput}    ${flowElement}
+
+Remove a flow - Output to physical port#
+    [Documentation]    Remove a flow
+    [Tags]    remove
+    ${resp}    Delete    session    ${REST_CON}/node/openflow:1/table/${TABLE}/flow/${FLOW}
+    Should Be Equal As Strings    ${resp.status_code}    200
+
+Verify after deleting flow config - Output to physical port#
+    [Documentation]    Verify the flow
+    [Tags]    Get
+    ${resp}    Get    session    ${REST_CON}/node/openflow:1/table/${TABLE}
+    Should Not Contain    ${resp.content}    ${FLOW}
+
+Verify flows after deleting flow config on OVS
+    [Documentation]    Checking Flows on switch
+    [Tags]    Switch
+    Sleep    1
+    write    dpctl dump-flows -O OpenFlow13
+    ${body}    OperatingSystem.Get File    ${FILE}
+    ${switchouput}    Read Until    >
+    : FOR    ${flowElement}    IN    @{FLOWELMENTS}
+    \    should Not Contain    ${switchouput}    ${flowElement}
diff --git a/test/csit/suites/openflowplugin/Flows_OF13/314__eth_vlan.txt b/test/csit/suites/openflowplugin/Flows_OF13/314__eth_vlan.txt
new file mode 100644 (file)
index 0000000..4e7cddd
--- /dev/null
@@ -0,0 +1,66 @@
+*** Settings ***
+Documentation     Test suite for Ethernet,QoS, ARP and Action drop
+Suite Setup       Create Session    session    http://${CONTROLLER}:${RESTCONFPORT}    auth=${AUTH}    headers=${HEADERS_XML}
+Suite Teardown    Delete All Sessions
+Library           SSHLibrary
+Library           Collections
+Library           OperatingSystem
+Library           ../../../libraries/RequestsLibrary.py
+Library           ../../../libraries/Common.py
+Variables         ../../../variables/Variables.py
+
+*** Variables ***
+${REST_CON}       /restconf/config/opendaylight-inventory:nodes
+${REST_OPR}       /restconf/operational/opendaylight-inventory:nodes
+${FILE}           ${CURDIR}/../../../variables/xmls/f15.xml
+${FLOW}           138
+${TABLE}          2
+@{FLOWELMENTS}    dl_dst=ff:ff:29:01:19:61    table=2    dl_src=00:00:00:11:23:ae    dec_mpls_ttl    mpls    dl_vlan=78
+
+*** Test Cases ***
+Add a flow - Output to physical port#
+    [Documentation]    Push a flow through REST-API
+    [Tags]    Push
+    ${body}    OperatingSystem.Get File    ${FILE}
+    Set Suite Variable    ${body}
+    ${resp}    Putxml    session    ${REST_CON}/node/openflow:1/table/${TABLE}/flow/${FLOW}    data=${body}
+    Should Be Equal As Strings    ${resp.status_code}    200
+
+Verify after adding flow config - Output to physical port#
+    [Documentation]    Verify the flow
+    [Tags]    Get
+    ${resp}    get    session    ${REST_CON}/node/openflow:1/table/${TABLE}/flow/${FLOW}    headers=${ACCEPT_XML}
+    Should Be Equal As Strings    ${resp.status_code}    200
+    compare xml    ${body}    ${resp.content}
+
+Verify flows after adding flow config on OVS
+    [Documentation]    Checking Flows on switch
+    [Tags]    Switch
+    sleep    1
+    write    dpctl dump-flows -O OpenFlow13
+    ${body}    OperatingSystem.Get File    ${FILE}
+    ${switchouput}    Read Until    >
+    : FOR    ${flowElement}    IN    @{FLOWELMENTS}
+    \    should Contain    ${switchouput}    ${flowElement}
+
+Remove a flow - Output to physical port#
+    [Documentation]    Remove a flow
+    [Tags]    remove
+    ${resp}    Delete    session    ${REST_CON}/node/openflow:1/table/${TABLE}/flow/${FLOW}
+    Should Be Equal As Strings    ${resp.status_code}    200
+
+Verify after deleting flow config - Output to physical port#
+    [Documentation]    Verify the flow
+    [Tags]    Get
+    ${resp}    Get    session    ${REST_CON}/node/openflow:1/table/${TABLE}
+    Should Not Contain    ${resp.content}    ${FLOW}
+
+Verify flows after deleting flow config on OVS
+    [Documentation]    Checking Flows on switch
+    [Tags]    Switch
+    Sleep    1
+    write    dpctl dump-flows -O OpenFlow13
+    ${body}    OperatingSystem.Get File    ${FILE}
+    ${switchouput}    Read Until    >
+    : FOR    ${flowElement}    IN    @{FLOWELMENTS}
+    \    should Not Contain    ${switchouput}    ${flowElement}
diff --git a/test/csit/suites/openflowplugin/Flows_OF13/315__timeout_vlan_pcp_vlan.txt b/test/csit/suites/openflowplugin/Flows_OF13/315__timeout_vlan_pcp_vlan.txt
new file mode 100644 (file)
index 0000000..d2c2990
--- /dev/null
@@ -0,0 +1,65 @@
+*** Settings ***
+Documentation     Test suite for Time our values and Vlan and PCP Vlan
+Suite Setup       Create Session    session    http://${CONTROLLER}:${RESTCONFPORT}    auth=${AUTH}    headers=${HEADERS_XML}
+Suite Teardown    Delete All Sessions
+Library           SSHLibrary
+Library           Collections
+Library           OperatingSystem
+Library           ../../../libraries/RequestsLibrary.py
+Library           ../../../libraries/Common.py
+Variables         ../../../variables/Variables.py
+
+*** Variables ***
+${REST_CON}       /restconf/config/opendaylight-inventory:nodes
+${REST_OPR}       /restconf/operational/opendaylight-inventory:nodes
+${FILE}           ${CURDIR}/../../../variables/xmls/f16.xml
+${FLOW}           139
+${TABLE}          2
+@{FLOWELMENTS}    table=2    idle_timeout=300    hard_timeout=600    priority=16    dl_vlan=78    dl_vlan_pcp=3
+...               dl_src=00:00:00:11:23:ae    dl_dst=ff:ff:29:01:19:61    dec_ttl
+
+*** Test Cases ***
+Add a flow - Output to physical port#
+    [Documentation]    Push a flow through REST-API
+    [Tags]    Push
+    ${body}    OperatingSystem.Get File    ${FILE}
+    Set Suite Variable    ${body}
+    ${resp}    Putxml    session    ${REST_CON}/node/openflow:1/table/${TABLE}/flow/${FLOW}    data=${body}
+    Should Be Equal As Strings    ${resp.status_code}    200
+
+Verify after adding flow config - Output to physical port#
+    [Documentation]    Verify the flow
+    [Tags]    Get
+    ${resp}    get    session    ${REST_CON}/node/openflow:1/table/${TABLE}/flow/${FLOW}    headers=${ACCEPT_XML}
+    Should Be Equal As Strings    ${resp.status_code}    200
+    compare xml    ${body}    ${resp.content}
+
+Verify flows after adding flow config on OVS
+    [Documentation]    Checking Flows on switch
+    [Tags]    Switch
+    sleep    1
+    write    dpctl dump-flows -O OpenFlow13
+    ${switchoutput}    Read Until     mininet>
+    : FOR    ${flowElement}    IN    @{FLOWELMENTS}
+    \    should Contain    ${switchoutput}    ${flowElement}
+
+Remove a flow - Output to physical port#
+    [Documentation]    Remove a flow
+    [Tags]    remove
+    ${resp}    Delete    session    ${REST_CON}/node/openflow:1/table/${TABLE}/flow/${FLOW}
+    Should Be Equal As Strings    ${resp.status_code}    200
+
+Verify after deleting flow config - Output to physical port#
+    [Documentation]    Verify the flow
+    [Tags]    Get
+    ${resp}    Get    session    ${REST_CON}/node/openflow:1/table/${TABLE}
+    Should Not Contain    ${resp.content}    ${FLOW}
+
+Verify flows after deleting flow config on OVS
+    [Documentation]    Checking Flows on switch
+    [Tags]    Switch
+    Sleep    1
+    write    dpctl dump-flows -O OpenFlow13
+    ${switchoutput}    Read Until     mininet>
+    : FOR    ${flowElement}    IN    @{FLOWELMENTS}
+    \    should Not Contain    ${switchoutput}    ${flowElement}
diff --git a/test/csit/suites/openflowplugin/Flows_OF13/316__eth_mpls_tc_bos.txt b/test/csit/suites/openflowplugin/Flows_OF13/316__eth_mpls_tc_bos.txt
new file mode 100644 (file)
index 0000000..8ace090
--- /dev/null
@@ -0,0 +1,67 @@
+*** Settings ***
+Documentation     Test suite for Ethernet,QoS, ARP and Action drop
+Suite Setup       Create Session    session    http://${CONTROLLER}:${RESTCONFPORT}    auth=${AUTH}    headers=${HEADERS_XML}
+Suite Teardown    Delete All Sessions
+Library           SSHLibrary
+Library           Collections
+Library           OperatingSystem
+Library           ../../../libraries/RequestsLibrary.py
+Library           ../../../libraries/Common.py
+Variables         ../../../variables/Variables.py
+
+*** Variables ***
+${REST_CON}       /restconf/config/opendaylight-inventory:nodes
+${REST_OPR}       /restconf/operational/opendaylight-inventory:nodes
+${FILE}           ${CURDIR}/../../../variables/xmls/f17.xml
+${FLOW}           140
+${TABLE}          2
+@{FLOWELMENTS}    dl_dst=ff:ff:29:01:19:61    table=2    dl_src=00:00:00:11:23:ae    dec_mpls_ttl    mpls    mpls_label=567    mpls_tc=3
+...               mpls_bos=1    # mpls_label=567,mpls_tc=3,mpls_bos=1
+
+*** Test Cases ***
+Add a flow - Output to physical port#
+    [Documentation]    Push a flow through REST-API
+    [Tags]    Push
+    ${body}    OperatingSystem.Get File    ${FILE}
+    Set Suite Variable    ${body}
+    ${resp}    Putxml    session    ${REST_CON}/node/openflow:1/table/${TABLE}/flow/${FLOW}    data=${body}
+    Should Be Equal As Strings    ${resp.status_code}    200
+
+Verify after adding flow config - Output to physical port#
+    [Documentation]    Verify the flow
+    [Tags]    Get
+    ${resp}    get    session    ${REST_CON}/node/openflow:1/table/${TABLE}/flow/${FLOW}    headers=${ACCEPT_XML}
+    Should Be Equal As Strings    ${resp.status_code}    200
+    compare xml    ${body}    ${resp.content}
+
+Verify flows after adding flow config on OVS
+    [Documentation]    Checking Flows on switch
+    [Tags]    Switch
+    sleep    1
+    write    dpctl dump-flows -O OpenFlow13
+    ${body}    OperatingSystem.Get File    ${FILE}
+    ${switchouput}    Read Until    >
+    : FOR    ${flowElement}    IN    @{FLOWELMENTS}
+    \    should Contain    ${switchouput}    ${flowElement}
+
+Remove a flow - Output to physical port#
+    [Documentation]    Remove a flow
+    [Tags]    remove
+    ${resp}    Delete    session    ${REST_CON}/node/openflow:1/table/${TABLE}/flow/${FLOW}
+    Should Be Equal As Strings    ${resp.status_code}    200
+
+Verify after deleting flow config - Output to physical port#
+    [Documentation]    Verify the flow
+    [Tags]    Get
+    ${resp}    Get    session    ${REST_CON}/node/openflow:1/table/${TABLE}
+    Should Not Contain    ${resp.content}    ${FLOW}
+
+Verify flows after deleting flow config on OVS
+    [Documentation]    Checking Flows on switch
+    [Tags]    Switch
+    Sleep    1
+    write    dpctl dump-flows -O OpenFlow13
+    ${body}    OperatingSystem.Get File    ${FILE}
+    ${switchouput}    Read Until    >
+    : FOR    ${flowElement}    IN    @{FLOWELMENTS}
+    \    should Not Contain    ${switchouput}    ${flowElement}
diff --git a/test/csit/suites/openflowplugin/Flows_OF13/317__eth_ipv6.txt b/test/csit/suites/openflowplugin/Flows_OF13/317__eth_ipv6.txt
new file mode 100644 (file)
index 0000000..fb31499
--- /dev/null
@@ -0,0 +1,66 @@
+*** Settings ***
+Documentation     Test suite for IPv6
+Suite Setup       Create Session    session    http://${CONTROLLER}:${RESTCONFPORT}    auth=${AUTH}    headers=${HEADERS_XML}
+Suite Teardown    Delete All Sessions
+Library           SSHLibrary
+Library           Collections
+Library           OperatingSystem
+Library           ../../../libraries/RequestsLibrary.py
+Library           ../../../libraries/Common.py
+Variables         ../../../variables/Variables.py
+
+*** Variables ***
+${REST_CON}       /restconf/config/opendaylight-inventory:nodes
+${REST_OPR}       /restconf/operational/opendaylight-inventory:nodes
+${FILE}           ${CURDIR}/../../../variables/xmls/f18.xml
+${FLOW}           141
+${TABLE}          2
+@{FLOWELMENTS}    ipv6    ipv6_src=fe80::2acf:e9ff:fe21:6431,    ipv6_dst=aabb:1234:2acf:e9ff::/64    dec_ttl
+
+*** Test Cases ***
+Add a flow - Output to physical port#
+    [Documentation]    Push a flow through REST-API
+    [Tags]    Push
+    ${body}    OperatingSystem.Get File    ${FILE}
+    Set Suite Variable    ${body}
+    ${resp}    Putxml    session    ${REST_CON}/node/openflow:1/table/${TABLE}/flow/${FLOW}    data=${body}
+    Should Be Equal As Strings    ${resp.status_code}    200
+
+Verify after adding flow config - Output to physical port#
+    [Documentation]    Verify the flow
+    [Tags]    Get
+    ${resp}    get    session    ${REST_CON}/node/openflow:1/table/${TABLE}/flow/${FLOW}    headers=${ACCEPT_XML}
+    Should Be Equal As Strings    ${resp.status_code}    200
+    compare xml    ${body}    ${resp.content}
+
+Verify flows after adding flow config on OVS
+    [Documentation]    Checking Flows on switch
+    [Tags]    Switch
+    Sleep    1
+    write    dpctl dump-flows -O OpenFlow13
+    ${body}    OperatingSystem.Get File    ${FILE}
+    ${switchouput}    Read Until    >
+    : FOR    ${flowElement}    IN    @{FLOWELMENTS}
+    \    should Contain    ${switchouput}    ${flowElement}
+
+Remove a flow - Output to physical port#
+    [Documentation]    Remove a flow
+    [Tags]    remove
+    ${resp}    Delete    session    ${REST_CON}/node/openflow:1/table/${TABLE}/flow/${FLOW}
+    Should Be Equal As Strings    ${resp.status_code}    200
+
+Verify after deleting flow config - Output to physical port#
+    [Documentation]    Verify the flow
+    [Tags]    Get
+    ${resp}    Get    session    ${REST_CON}/node/openflow:1/table/${TABLE}
+    Should Not Contain    ${resp.content}    ${FLOW}
+
+Verify flows after deleting flow config on OVS
+    [Documentation]    Checking Flows on switch
+    [Tags]    Switch
+    Sleep    1
+    write    dpctl dump-flows -O OpenFlow13
+    ${body}    OperatingSystem.Get File    ${FILE}
+    ${switchouput}    Read Until    >
+    : FOR    ${flowElement}    IN    @{FLOWELMENTS}
+    \    should Not Contain    ${switchouput}    ${flowElement}
diff --git a/test/csit/suites/openflowplugin/Flows_OF13/318__metadata.txt b/test/csit/suites/openflowplugin/Flows_OF13/318__metadata.txt
new file mode 100644 (file)
index 0000000..84084bd
--- /dev/null
@@ -0,0 +1,66 @@
+*** Settings ***
+Documentation     Test suite for metadata
+Suite Setup       Create Session    session    http://${CONTROLLER}:${RESTCONFPORT}    auth=${AUTH}    headers=${HEADERS_XML}
+Suite Teardown    Delete All Sessions
+Library           SSHLibrary
+Library           Collections
+Library           OperatingSystem
+Library           ../../../libraries/RequestsLibrary.py
+Library           ../../../libraries/Common.py
+Variables         ../../../variables/Variables.py
+
+*** Variables ***
+${REST_CON}       /restconf/config/opendaylight-inventory:nodes
+${REST_OPR}       /restconf/operational/opendaylight-inventory:nodes
+${FILE}           ${CURDIR}/../../../variables/xmls/f19.xml
+${FLOW}           142
+${TABLE}          2
+@{FLOWELMENTS}    metadata=0x3039    IN_PORT
+
+*** Test Cases ***
+Add a flow - Output to physical port#
+    [Documentation]    Push a flow through REST-API
+    [Tags]    Push
+    ${body}    OperatingSystem.Get File    ${FILE}
+    Set Suite Variable    ${body}
+    ${resp}    Putxml    session    ${REST_CON}/node/openflow:1/table/${TABLE}/flow/${FLOW}    data=${body}
+    Should Be Equal As Strings    ${resp.status_code}    200
+
+Verify after adding flow config - Output to physical port#
+    [Documentation]    Verify the flow
+    [Tags]    Get
+    ${resp}    get    session    ${REST_CON}/node/openflow:1/table/${TABLE}/flow/${FLOW}    headers=${ACCEPT_XML}
+    Should Be Equal As Strings    ${resp.status_code}    200
+    compare xml    ${body}    ${resp.content}
+
+Verify flows after adding flow config on OVS
+    [Documentation]    Checking Flows on switch
+    [Tags]    Switch
+    sleep    1
+    write    dpctl dump-flows -O OpenFlow13
+    ${body}    OperatingSystem.Get File    ${FILE}
+    ${switchouput}    Read Until    >
+    : FOR    ${flowElement}    IN    @{FLOWELMENTS}
+    \    should Contain    ${switchouput}    ${flowElement}
+
+Remove a flow - Output to physical port#
+    [Documentation]    Remove a flow
+    [Tags]    remove
+    ${resp}    Delete    session    ${REST_CON}/node/openflow:1/table/${TABLE}/flow/${FLOW}
+    Should Be Equal As Strings    ${resp.status_code}    200
+
+Verify after deleting flow config - Output to physical port#
+    [Documentation]    Verify the flow
+    [Tags]    Get
+    ${resp}    Get    session    ${REST_CON}/node/openflow:1/table/${TABLE}
+    Should Not Contain    ${resp.content}    ${FLOW}
+
+Verify flows after deleting flow config on OVS
+    [Documentation]    Checking Flows on switch
+    [Tags]    Switch
+    Sleep    1
+    write    dpctl dump-flows -O OpenFlow13
+    ${body}    OperatingSystem.Get File    ${FILE}
+    ${switchouput}    Read Until    >
+    : FOR    ${flowElement}    IN    @{FLOWELMENTS}
+    \    should Not Contain    ${switchouput}    ${flowElement}
diff --git a/test/csit/suites/openflowplugin/Flows_OF13/319__metadata_mask.txt b/test/csit/suites/openflowplugin/Flows_OF13/319__metadata_mask.txt
new file mode 100644 (file)
index 0000000..e0ebe04
--- /dev/null
@@ -0,0 +1,66 @@
+*** Settings ***
+Documentation     Test suite for metadata and mask
+Suite Setup       Create Session    session    http://${CONTROLLER}:${RESTCONFPORT}    auth=${AUTH}    headers=${HEADERS_XML}
+Suite Teardown    Delete All Sessions
+Library           SSHLibrary
+Library           Collections
+Library           OperatingSystem
+Library           ../../../libraries/RequestsLibrary.py
+Library           ../../../libraries/Common.py
+Variables         ../../../variables/Variables.py
+
+*** Variables ***
+${REST_CON}       /restconf/config/opendaylight-inventory:nodes
+${REST_OPR}       /restconf/operational/opendaylight-inventory:nodes
+${FILE}           ${CURDIR}/../../../variables/xmls/f20.xml
+${FLOW}           143
+${TABLE}          2
+@{FLOWELMENTS}    metadata=0x1010/0x12d692    LOCAL
+
+*** Test Cases ***
+Add a flow - Output to physical port#
+    [Documentation]    Push a flow through REST-API
+    [Tags]    Push
+    ${body}    OperatingSystem.Get File    ${FILE}
+    Set Suite Variable    ${body}
+    ${resp}    Putxml    session    ${REST_CON}/node/openflow:1/table/${TABLE}/flow/${FLOW}    data=${body}
+    Should Be Equal As Strings    ${resp.status_code}    200
+
+Verify after adding flow config - Output to physical port#
+    [Documentation]    Verify the flow
+    [Tags]    Get
+    ${resp}    get    session    ${REST_CON}/node/openflow:1/table/${TABLE}/flow/${FLOW}    headers=${ACCEPT_XML}
+    Should Be Equal As Strings    ${resp.status_code}    200
+    compare xml    ${body}    ${resp.content}
+
+Verify flows after adding flow config on OVS
+    [Documentation]    Checking Flows on switch
+    [Tags]    Switch
+    sleep    1
+    write    dpctl dump-flows -O OpenFlow13
+    ${body}    OperatingSystem.Get File    ${FILE}
+    ${switchouput}    Read Until    >
+    : FOR    ${flowElement}    IN    @{FLOWELMENTS}
+    \    should Contain    ${switchouput}    ${flowElement}
+
+Remove a flow - Output to physical port#
+    [Documentation]    Remove a flow
+    [Tags]    remove
+    ${resp}    Delete    session    ${REST_CON}/node/openflow:1/table/${TABLE}/flow/${FLOW}
+    Should Be Equal As Strings    ${resp.status_code}    200
+
+Verify after deleting flow config - Output to physical port#
+    [Documentation]    Verify the flow
+    [Tags]    Get
+    ${resp}    Get    session    ${REST_CON}/node/openflow:1/table/${TABLE}
+    Should Not Contain    ${resp.content}    ${FLOW}
+
+Verify flows after deleting flow config on OVS
+    [Documentation]    Checking Flows on switch
+    [Tags]    Switch
+    Sleep    1
+    write    dpctl dump-flows -O OpenFlow13
+    ${body}    OperatingSystem.Get File    ${FILE}
+    ${switchouput}    Read Until    >
+    : FOR    ${flowElement}    IN    @{FLOWELMENTS}
+    \    should Not Contain    ${switchouput}    ${flowElement}
diff --git a/test/csit/suites/openflowplugin/Flows_OF13/320__ipv6_meta_qos_udp.txt b/test/csit/suites/openflowplugin/Flows_OF13/320__ipv6_meta_qos_udp.txt
new file mode 100644 (file)
index 0000000..460bb8f
--- /dev/null
@@ -0,0 +1,67 @@
+*** Settings ***
+Documentation     Test suite for metadata and mask
+Suite Setup       Create Session    session    http://${CONTROLLER}:${RESTCONFPORT}    auth=${AUTH}    headers=${HEADERS_XML}
+Suite Teardown    Delete All Sessions
+Library           SSHLibrary
+Library           Collections
+Library           OperatingSystem
+Library           ../../../libraries/RequestsLibrary.py
+Library           ../../../libraries/Common.py
+Variables         ../../../variables/Variables.py
+
+*** Variables ***
+${REST_CON}       /restconf/config/opendaylight-inventory:nodes
+${REST_OPR}       /restconf/operational/opendaylight-inventory:nodes
+${FILE}           ${CURDIR}/../../../variables/xmls/f21.xml
+${FLOW}           144
+${TABLE}          2
+@{FLOWELMENTS}    metadata=0x3039    udp6    ipv6    ipv6_dst=fe80::2acf:e9ff:fe21:6431    nw_tos=32    nw_ecn=3    tp_src=25364
+...               tp_dst=8080    ipv6_src=1234:5678:9abc:def0:fdc0::/76    dec_ttl
+
+*** Test Cases ***
+Add a flow - Output to physical port#
+    [Documentation]    Push a flow through REST-API
+    [Tags]    Push
+    ${body}    OperatingSystem.Get File    ${FILE}
+    Set Suite Variable    ${body}
+    ${resp}    Putxml    session    ${REST_CON}/node/openflow:1/table/${TABLE}/flow/${FLOW}    data=${body}
+    Should Be Equal As Strings    ${resp.status_code}    200
+
+Verify after adding flow config - Output to physical port#
+    [Documentation]    Verify the flow
+    [Tags]    Get
+    ${resp}    get    session    ${REST_CON}/node/openflow:1/table/${TABLE}/flow/${FLOW}    headers=${ACCEPT_XML}
+    Should Be Equal As Strings    ${resp.status_code}    200
+    compare xml    ${body}    ${resp.content}
+
+Verify flows after adding flow config on OVS
+    [Documentation]    Checking Flows on switch
+    [Tags]    Switch
+    sleep    1
+    write    dpctl dump-flows -O OpenFlow13
+    ${body}    OperatingSystem.Get File    ${FILE}
+    ${switchouput}    Read Until    >
+    : FOR    ${flowElement}    IN    @{FLOWELMENTS}
+    \    should Contain    ${switchouput}    ${flowElement}
+
+Remove a flow - Output to physical port#
+    [Documentation]    Remove a flow
+    [Tags]    remove
+    ${resp}    Delete    session    ${REST_CON}/node/openflow:1/table/${TABLE}/flow/${FLOW}
+    Should Be Equal As Strings    ${resp.status_code}    200
+
+Verify after deleting flow config - Output to physical port#
+    [Documentation]    Verify the flow
+    [Tags]    Get
+    ${resp}    Get    session    ${REST_CON}/node/openflow:1/table/${TABLE}
+    Should Not Contain    ${resp.content}    ${FLOW}
+
+Verify flows after deleting flow config on OVS
+    [Documentation]    Checking Flows on switch
+    [Tags]    Switch
+    Sleep    1
+    write    dpctl dump-flows -O OpenFlow13
+    ${body}    OperatingSystem.Get File    ${FILE}
+    ${switchouput}    Read Until    >
+    : FOR    ${flowElement}    IN    @{FLOWELMENTS}
+    \    should Not Contain    ${switchouput}    ${flowElement}
diff --git a/test/csit/suites/openflowplugin/Flows_OF13/321__ipv6_meta_qos_tcp.txt b/test/csit/suites/openflowplugin/Flows_OF13/321__ipv6_meta_qos_tcp.txt
new file mode 100644 (file)
index 0000000..887e585
--- /dev/null
@@ -0,0 +1,67 @@
+*** Settings ***
+Documentation     Test suite for metadata and mask
+Suite Setup       Create Session    session    http://${CONTROLLER}:${RESTCONFPORT}    auth=${AUTH}    headers=${HEADERS_XML}
+Suite Teardown    Delete All Sessions
+Library           SSHLibrary
+Library           Collections
+Library           OperatingSystem
+Library           ../../../libraries/RequestsLibrary.py
+Library           ../../../libraries/Common.py
+Variables         ../../../variables/Variables.py
+
+*** Variables ***
+${REST_CON}       /restconf/config/opendaylight-inventory:nodes
+${REST_OPR}       /restconf/operational/opendaylight-inventory:nodes
+${FILE}           ${CURDIR}/../../../variables/xmls/f22.xml
+${FLOW}           145
+${TABLE}          2
+@{FLOWELMENTS}    metadata=0x3039    tcp6    ipv6    ipv6_dst=fe80:2acf:e9ff:fe21::/94    nw_tos=240    nw_ecn=3    tp_src=183
+...               tp_dst=8080    ipv6_src=1234:5678:9abc:def0:fdc0::/76    dec_ttl
+
+*** Test Cases ***
+Add a flow - Output to physical port#
+    [Documentation]    Push a flow through REST-API
+    [Tags]    Push
+    ${body}    OperatingSystem.Get File    ${FILE}
+    Set Suite Variable    ${body}
+    ${resp}    Putxml    session    ${REST_CON}/node/openflow:1/table/${TABLE}/flow/${FLOW}    data=${body}
+    Should Be Equal As Strings    ${resp.status_code}    200
+
+Verify after adding flow config - Output to physical port#
+    [Documentation]    Verify the flow
+    [Tags]    Get
+    ${resp}    get    session    ${REST_CON}/node/openflow:1/table/${TABLE}/flow/${FLOW}    headers=${ACCEPT_XML}
+    Should Be Equal As Strings    ${resp.status_code}    200
+    compare xml    ${body}    ${resp.content}
+
+Verify flows after adding flow config on OVS
+    [Documentation]    Checking Flows on switch
+    [Tags]    Switch
+    sleep    1
+    write    dpctl dump-flows -O OpenFlow13
+    ${body}    OperatingSystem.Get File    ${FILE}
+    ${switchouput}    Read Until    >
+    : FOR    ${flowElement}    IN    @{FLOWELMENTS}
+    \    should Contain    ${switchouput}    ${flowElement}
+
+Remove a flow - Output to physical port#
+    [Documentation]    Remove a flow
+    [Tags]    remove
+    ${resp}    Delete    session    ${REST_CON}/node/openflow:1/table/${TABLE}/flow/${FLOW}
+    Should Be Equal As Strings    ${resp.status_code}    200
+
+Verify after deleting flow config - Output to physical port#
+    [Documentation]    Verify the flow
+    [Tags]    Get
+    ${resp}    Get    session    ${REST_CON}/node/openflow:1/table/${TABLE}
+    Should Not Contain    ${resp.content}    ${FLOW}
+
+Verify flows after deleting flow config on OVS
+    [Documentation]    Checking Flows on switch
+    [Tags]    Switch
+    Sleep    1
+    write    dpctl dump-flows -O OpenFlow13
+    ${body}    OperatingSystem.Get File    ${FILE}
+    ${switchouput}    Read Until    >
+    : FOR    ${flowElement}    IN    @{FLOWELMENTS}
+    \    should Not Contain    ${switchouput}    ${flowElement}
diff --git a/test/csit/suites/openflowplugin/Flows_OF13/322__ipv6_flow.txt b/test/csit/suites/openflowplugin/Flows_OF13/322__ipv6_flow.txt
new file mode 100644 (file)
index 0000000..a633e28
--- /dev/null
@@ -0,0 +1,67 @@
+*** Settings ***
+Documentation     Test suite for IPv6 flow labelk
+Suite Setup       Create Session    session    http://${CONTROLLER}:${RESTCONFPORT}    auth=${AUTH}    headers=${HEADERS_XML}
+Suite Teardown    Delete All Sessions
+Library           SSHLibrary
+Library           Collections
+Library           OperatingSystem
+Library           ../../../libraries/RequestsLibrary.py
+Library           ../../../libraries/Common.py
+Variables         ../../../variables/Variables.py
+
+*** Variables ***
+${REST_CON}       /restconf/config/opendaylight-inventory:nodes
+${REST_OPR}       /restconf/operational/opendaylight-inventory:nodes
+${FILE}           ${CURDIR}/../../../variables/xmls/f23.xml
+${FLOW}           146
+${TABLE}          2
+@{FLOWELMENTS}    metadata=0x3039    tcp6    ipv6    ipv6_dst=fe80:2acf:e9ff:fe21::/94    nw_tos=240    nw_ecn=3    tp_src=183
+...               tp_dst=8080    ipv6_src=1234:5678:9abc:def0:fdc0::/76    dec_ttl    ipv6_label=0x00021
+
+*** Test Cases ***
+Add a flow - Output to physical port#
+    [Documentation]    Push a flow through REST-API
+    [Tags]    Push
+    ${body}    OperatingSystem.Get File    ${FILE}
+    Set Suite Variable    ${body}
+    ${resp}    Putxml    session    ${REST_CON}/node/openflow:1/table/${TABLE}/flow/${FLOW}    data=${body}
+    Should Be Equal As Strings    ${resp.status_code}    200
+
+Verify after adding flow config - Output to physical port#
+    [Documentation]    Verify the flow
+    [Tags]    Get
+    ${resp}    get    session    ${REST_CON}/node/openflow:1/table/${TABLE}/flow/${FLOW}    headers=${ACCEPT_XML}
+    Should Be Equal As Strings    ${resp.status_code}    200
+    compare xml    ${body}    ${resp.content}
+
+Verify flows after adding flow config on OVS
+    [Documentation]    Checking Flows on switch
+    [Tags]    Switch
+    sleep    1
+    write    dpctl dump-flows -O OpenFlow13
+    ${body}    OperatingSystem.Get File    ${FILE}
+    ${switchouput}    Read Until    >
+    : FOR    ${flowElement}    IN    @{FLOWELMENTS}
+    \    should Contain    ${switchouput}    ${flowElement}
+
+Remove a flow - Output to physical port#
+    [Documentation]    Remove a flow
+    [Tags]    remove
+    ${resp}    Delete    session    ${REST_CON}/node/openflow:1/table/${TABLE}/flow/${FLOW}
+    Should Be Equal As Strings    ${resp.status_code}    200
+
+Verify after deleting flow config - Output to physical port#
+    [Documentation]    Verify the flow
+    [Tags]    Get
+    ${resp}    Get    session    ${REST_CON}/node/openflow:1/table/${TABLE}
+    Should Not Contain    ${resp.content}    ${FLOW}
+
+Verify flows after deleting flow config on OVS
+    [Documentation]    Checking Flows on switch
+    [Tags]    Switch
+    Sleep    1
+    write    dpctl dump-flows -O OpenFlow13
+    ${body}    OperatingSystem.Get File    ${FILE}
+    ${switchouput}    Read Until    >
+    : FOR    ${flowElement}    IN    @{FLOWELMENTS}
+    \    should Not Contain    ${switchouput}    ${flowElement}
diff --git a/test/csit/suites/openflowplugin/Flows_OF13/323__tunnel.txt b/test/csit/suites/openflowplugin/Flows_OF13/323__tunnel.txt
new file mode 100644 (file)
index 0000000..702e999
--- /dev/null
@@ -0,0 +1,66 @@
+*** Settings ***
+Documentation     Test suite for Tunnel ID
+Suite Setup       Create Session    session    http://${CONTROLLER}:${RESTCONFPORT}    auth=${AUTH}    headers=${HEADERS_XML}
+Suite Teardown    Delete All Sessions
+Library           SSHLibrary
+Library           Collections
+Library           OperatingSystem
+Library           ../../../libraries/RequestsLibrary.py
+Library           ../../../libraries/Common.py
+Variables         ../../../variables/Variables.py
+
+*** Variables ***
+${REST_CON}       /restconf/config/opendaylight-inventory:nodes
+${REST_OPR}       /restconf/operational/opendaylight-inventory:nodes
+${FILE}           ${CURDIR}/../../../variables/xmls/f24.xml
+${FLOW}           147
+${TABLE}          2
+@{FLOWELMENTS}    tun_id=0xa1f    TABLE
+
+*** Test Cases ***
+Add a flow - Output to physical port#
+    [Documentation]    Push a flow through REST-API
+    [Tags]    Push
+    ${body}    OperatingSystem.Get File    ${FILE}
+    Set Suite Variable    ${body}
+    ${resp}    Putxml    session    ${REST_CON}/node/openflow:1/table/${TABLE}/flow/${FLOW}    data=${body}
+    Should Be Equal As Strings    ${resp.status_code}    200
+
+Verify after adding flow config - Output to physical port#
+    [Documentation]    Verify the flow
+    [Tags]    Get
+    ${resp}    get    session    ${REST_CON}/node/openflow:1/table/${TABLE}/flow/${FLOW}    headers=${ACCEPT_XML}
+    Should Be Equal As Strings    ${resp.status_code}    200
+    compare xml    ${body}    ${resp.content}
+
+Verify flows after adding flow config on OVS
+    [Documentation]    Checking Flows on switch
+    [Tags]    Switch
+    sleep    1
+    write    dpctl dump-flows -O OpenFlow13
+    ${body}    OperatingSystem.Get File    ${FILE}
+    ${switchouput}    Read Until    >
+    : FOR    ${flowElement}    IN    @{FLOWELMENTS}
+    \    should Contain    ${switchouput}    ${flowElement}
+
+Remove a flow - Output to physical port#
+    [Documentation]    Remove a flow
+    [Tags]    remove
+    ${resp}    Delete    session    ${REST_CON}/node/openflow:1/table/${TABLE}/flow/${FLOW}
+    Should Be Equal As Strings    ${resp.status_code}    200
+
+Verify after deleting flow config - Output to physical port#
+    [Documentation]    Verify the flow
+    [Tags]    Get
+    ${resp}    Get    session    ${REST_CON}/node/openflow:1/table/${TABLE}
+    Should Not Contain    ${resp.content}    ${FLOW}
+
+Verify flows after deleting flow config on OVS
+    [Documentation]    Checking Flows on switch
+    [Tags]    Switch
+    Sleep    1
+    write    dpctl dump-flows -O OpenFlow13
+    ${body}    OperatingSystem.Get File    ${FILE}
+    ${switchouput}    Read Until    >
+    : FOR    ${flowElement}    IN    @{FLOWELMENTS}
+    \    should Not Contain    ${switchouput}    ${flowElement}
diff --git a/test/csit/suites/openflowplugin/Flows_OF13/324__ipv6_flow_label.txt b/test/csit/suites/openflowplugin/Flows_OF13/324__ipv6_flow_label.txt
new file mode 100644 (file)
index 0000000..ac1fa4b
--- /dev/null
@@ -0,0 +1,67 @@
+*** Settings ***
+Documentation     Test suite for IPv6 Flow label and ICMP type
+Suite Setup       Create Session    session    http://${CONTROLLER}:${RESTCONFPORT}    auth=${AUTH}    headers=${HEADERS_XML}
+Suite Teardown    Delete All Sessions
+Library           SSHLibrary
+Library           Collections
+Library           OperatingSystem
+Library           ../../../libraries/RequestsLibrary.py
+Library           ../../../libraries/Common.py
+Variables         ../../../variables/Variables.py
+
+*** Variables ***
+${REST_CON}       /restconf/config/opendaylight-inventory:nodes
+${REST_OPR}       /restconf/operational/opendaylight-inventory:nodes
+${FILE}           ${CURDIR}/../../../variables/xmls/f25.xml
+${FLOW}           148
+${TABLE}          2
+@{FLOWELMENTS}    icmp6    metadata=0x3039    ipv6_src=1234:5678:9abc:def0:fdc0::/76    ipv6_dst=fe80:2acf:e9ff:fe21::/94    dec_ttl    ipv6_label=0x00021    nw_tos=240
+...               nw_ecn=3    icmp_type=6    icmp_code=3    # ipv6_dst=fe80:2acf:e9ff:fe21::/94
+
+*** Test Cases ***
+Add a flow - Output to physical port#
+    [Documentation]    Push a flow through REST-API
+    [Tags]    Push
+    ${body}    OperatingSystem.Get File    ${FILE}
+    Set Suite Variable    ${body}
+    ${resp}    Putxml    session    ${REST_CON}/node/openflow:1/table/${TABLE}/flow/${FLOW}    data=${body}
+    Should Be Equal As Strings    ${resp.status_code}    200
+
+Verify after adding flow config - Output to physical port#
+    [Documentation]    Verify the flow
+    [Tags]    Get
+    ${resp}    get    session    ${REST_CON}/node/openflow:1/table/${TABLE}/flow/${FLOW}    headers=${ACCEPT_XML}
+    Should Be Equal As Strings    ${resp.status_code}    200
+    compare xml    ${body}    ${resp.content}
+
+Verify flows after adding flow config on OVS
+    [Documentation]    Checking Flows on switch
+    [Tags]    Switch
+    sleep    1
+    write    dpctl dump-flows -O OpenFlow13
+    ${body}    OperatingSystem.Get File    ${FILE}
+    ${switchouput}    Read Until    >
+    : FOR    ${flowElement}    IN    @{FLOWELMENTS}
+    \    should Contain    ${switchouput}    ${flowElement}
+
+Remove a flow - Output to physical port#
+    [Documentation]    Remove a flow
+    [Tags]    remove
+    ${resp}    Delete    session    ${REST_CON}/node/openflow:1/table/${TABLE}/flow/${FLOW}
+    Should Be Equal As Strings    ${resp.status_code}    200
+
+Verify after deleting flow config - Output to physical port#
+    [Documentation]    Verify the flow
+    [Tags]    Get
+    ${resp}    Get    session    ${REST_CON}/node/openflow:1/table/${TABLE}
+    Should Not Contain    ${resp.content}    ${FLOW}
+
+Verify flows after deleting flow config on OVS
+    [Documentation]    Checking Flows on switch
+    [Tags]    Switch
+    Sleep    1
+    write    dpctl dump-flows -O OpenFlow13
+    ${body}    OperatingSystem.Get File    ${FILE}
+    ${switchouput}    Read Until    >
+    : FOR    ${flowElement}    IN    @{FLOWELMENTS}
+    \    should Not Contain    ${switchouput}    ${flowElement}
diff --git a/test/csit/suites/openflowplugin/Flows_OF13/__init__.txt b/test/csit/suites/openflowplugin/Flows_OF13/__init__.txt
new file mode 100644 (file)
index 0000000..10ece1e
--- /dev/null
@@ -0,0 +1,9 @@
+*** Settings ***
+Documentation     Flow test suite for the OpenDaylight karaf-compatible feature set
+Suite Setup       Start Suite
+Suite Teardown    Stop Suite
+Resource          ../../../libraries/Utils.txt
+
+*** Variables ***
+
+*** Keywords ***
diff --git a/test/csit/suites/openflowplugin/Flows_Stats_OF13/010__SM_add_upd_del_flows.txt b/test/csit/suites/openflowplugin/Flows_Stats_OF13/010__SM_add_upd_del_flows.txt
new file mode 100644 (file)
index 0000000..0f2096e
--- /dev/null
@@ -0,0 +1,301 @@
+*** Settings ***
+Documentation     Test suite for Stats Manager flows collection
+Suite Setup       Initialization Phase
+Suite Teardown    Teardown Phase
+Library           OperatingSystem
+Library           Collections
+Library           XML
+Library           ../../../libraries/XmlComparator.py
+Variables         ../../../variables/Variables.py
+Library           ../../../libraries/RequestsLibrary.py
+Library           ../../../libraries/Common.py
+
+*** Variables ***
+${XmlsDir}        ${CURDIR}/../../../variables/xmls
+${switch_idx}     1
+${switch_name}    s${switch_idx}
+@{xml_files}      f1.xml    f2.xml    f3.xml    f5.xml    f7.xml    f8.xml    f9.xml
+...               f10.xml    f11.xml    f12.xml    f13.xml    f14.xml    f17.xml    f19.xml
+...               f24.xml
+
+*** Test Cases ***
+Test Add Flows
+    [Documentation]    Add all flows and waits for SM to collect data
+    : FOR    ${flowfile}    IN    @{xml_files}
+    \    Log    ${flowfile}
+    \    Init Flow Variables    ${flowfile}
+    \    Run Keyword And Continue On Failure    Add Flow
+
+Test Is Flow 1 Added
+    [Documentation]    Checks if flow is configured and operational
+    Init Flow Variables    f1.xml
+    Check Config Flow    ${True}
+    Check Operational Table    ${True}
+
+Test Is Flow 2 Added
+    [Documentation]    Checks if flow is configured and operational
+    Init Flow Variables    f2.xml
+    Check Config Flow    ${True}
+    Check Operational Table    ${True}
+
+Test Is Flow 3 Added
+    [Documentation]    Checks if flow is configured and operational
+    Init Flow Variables    f3.xml
+    Check Config Flow    ${True}
+    Check Operational Table    ${True}
+
+Test Is Flow 5 Added
+    [Documentation]    Checks if flow is configured and operational
+    Init Flow Variables    f5.xml
+    Check Config Flow    ${True}
+    Check Operational Table    ${True}
+
+Test Is Flow 7 Added
+    [Documentation]    Checks if flow is configured and operational
+    Init Flow Variables    f7.xml
+    Check Config Flow    ${True}
+    Check Operational Table    ${True}
+
+Test Is Flow 8 Added
+    [Documentation]    Checks if flow is configured and operational
+    Init Flow Variables    f8.xml
+    Check Config Flow    ${True}
+    Check Operational Table    ${True}
+
+Test Is Flow 9 Added
+    [Documentation]    Checks if flow is configured and operational
+    Init Flow Variables    f9.xml
+    Check Config Flow    ${True}
+    Check Operational Table    ${True}
+
+Test Is Flow 10 Added
+    [Documentation]    Checks if flow is configured and operational
+    Init Flow Variables    f10.xml
+    Check Config Flow    ${True}
+    Check Operational Table    ${True}
+
+Test Is Flow 11 Added
+    [Documentation]    Checks if flow is configured and operational
+    Init Flow Variables    f11.xml
+    Check Config Flow    ${True}
+    Check Operational Table    ${True}
+
+Test Is Flow 12 Added
+    [Documentation]    Checks if flow is configured and operational
+    Init Flow Variables    f12.xml
+    Check Config Flow    ${True}
+    Check Operational Table    ${True}
+
+Test Is Flow 13 Added
+    [Documentation]    Checks if flow is configured and operational
+    Init Flow Variables    f13.xml
+    Check Config Flow    ${True}
+    Check Operational Table    ${True}
+
+Test Is Flow 14 Added
+    [Documentation]    Checks if flow is configured and operational
+    Init Flow Variables    f14.xml
+    Check Config Flow    ${True}
+    Check Operational Table    ${True}
+
+Test Is Flow 17 Added
+    [Documentation]    Checks if flow is configured and operational
+    Init Flow Variables    f17.xml
+    Check Config Flow    ${True}
+    Check Operational Table    ${True}
+
+Test Is Flow 19 Added
+    [Documentation]    Checks if flow is configured and operational
+    Init Flow Variables    f19.xml
+    Check Config Flow    ${True}
+    Check Operational Table    ${True}
+
+Test Is Flow 24 Added
+    [Documentation]    Checks if flow is configured and operational
+    Init Flow Variables    f24.xml
+    Check Config Flow    ${True}
+    Check Operational Table    ${True}
+
+Test Delete Flows
+    [Documentation]    Delete all flows and waits for SM to collect data
+    : FOR    ${flowfile}    IN    @{xml_files}
+    \    Log    ${flowfile}
+    \    Init Flow Variables    ${flowfile}
+    \    Run Keyword And Continue On Failure    Delete Flow
+
+Test Is Flow 1 Deleted
+    [Documentation]    Checks if flow is not configured and operational
+    Init Flow Variables    f1.xml
+    Check Config Flow    ${False}
+    Check Operational Table    ${False}
+
+Test Is Flow 2 Deleted
+    [Documentation]    Checks if flow is not configured and operational
+    Init Flow Variables    f2.xml
+    Check Config Flow    ${False}
+    Check Operational Table    ${False}
+
+Test Is Flow 3 Deleted
+    [Documentation]    Checks if flow is not configured and operational
+    Init Flow Variables    f3.xml
+    Check Config Flow    ${False}
+    Check Operational Table    ${False}
+
+Test Is Flow 5 Deleted
+    [Documentation]    Checks if flow is not configured and operational
+    Init Flow Variables    f5.xml
+    Check Config Flow    ${False}
+    Check Operational Table    ${False}
+
+Test Is Flow 7 Deleted
+    [Documentation]    Checks if flow is not configured and operational
+    Init Flow Variables    f7.xml
+    Check Config Flow    ${False}
+    Check Operational Table    ${False}
+
+Test Is Flow 8 Deleted
+    [Documentation]    Checks if flow is not configured and operational
+    Init Flow Variables    f8.xml
+    Check Config Flow    ${False}
+    Check Operational Table    ${False}
+
+Test Is Flow 9 Deleted
+    [Documentation]    Checks if flow is not configured and operational
+    Init Flow Variables    f9.xml
+    Check Config Flow    ${False}
+    Check Operational Table    ${False}
+
+Test Is Flow 10 Deleted
+    [Documentation]    Checks if flow is not configured and operational
+    Init Flow Variables    f10.xml
+    Check Config Flow    ${False}
+    Check Operational Table    ${False}
+
+Test Is Flow 11 Deleted
+    [Documentation]    Checks if flow is not configured and operational
+    Init Flow Variables    f11.xml
+    Check Config Flow    ${False}
+    Check Operational Table    ${False}
+
+Test Is Flow 12 Deleted
+    [Documentation]    Checks if flow is not configured and operational
+    Init Flow Variables    f12.xml
+    Check Config Flow    ${False}
+    Check Operational Table    ${False}
+
+Test Is Flow 13 Deleted
+    [Documentation]    Checks if flow is not configured and operational
+    Init Flow Variables    f13.xml
+    Check Config Flow    ${False}
+    Check Operational Table    ${False}
+
+Test Is Flow 14 Deleted
+    [Documentation]    Checks if flow is not configured and operational
+    Init Flow Variables    f14.xml
+    Check Config Flow    ${False}
+    Check Operational Table    ${False}
+
+Test Is Flow 17 Deleted
+    [Documentation]    Checks if flow is not configured and operational
+    Init Flow Variables    f17.xml
+    Check Config Flow    ${False}
+    Check Operational Table    ${False}
+
+Test Is Flow 19 Deleted
+    [Documentation]    Checks if flow is not configured and operational
+    Init Flow Variables    f19.xml
+    Check Config Flow    ${False}
+    Check Operational Table    ${False}
+
+Test Is Flow 24 Deleted
+    [Documentation]    Checks if flow is not configured and operational
+    Init Flow Variables    f24.xml
+    Check Config Flow    ${False}
+    Check Operational Table    ${False}
+
+*** Keywords ***
+Init Flow Variables
+    [Arguments]    ${file}
+    ${data}=    Get File    ${XmlsDir}/${file}
+    ${xmlroot}=    Parse Xml    ${XmlsDir}/${file}
+    ${table_id}=    Get Element Text    ${xmlroot}    table_id
+    ${flow_id}=    Get Element Text    ${xmlroot}    id
+    ${flow_priority}=    Get Element Text    ${xmlroot}    priority
+    Set Suite Variable    ${table_id}
+    Set Suite Variable    ${flow_id}
+    Set Suite Variable    ${flow_priority}
+    Set Suite Variable    ${data}
+    Set Suite Variable    ${xmlroot}
+
+Check Config Flow
+    [Arguments]    ${expected}
+    Wait Until Keyword Succeeds    40s    2s    Check Config Flow Presence    ${expected}
+
+Check Config Flow Presence
+    [Arguments]    ${expected}
+    ${presence_flow}    ${msg}=    Flow Presence Config Flow
+    ${msgf}=    Get Presence Failure Message    config    ${expected}    ${presence_flow}    ${msg}
+    Should Be Equal    ${expected}    ${presence_flow}    msg=${msgf}
+
+Flow Presence Config Flow
+    ${headers}=    Create Dictionary    Accept    application/xml
+    ${resp}=    RequestsLibrary.Get    session    /restconf/config/opendaylight-inventory:nodes/node/openflow:${switch_idx}/table/${table_id}/flow/${flow_id}    headers=${headers}
+    Log    ${resp}
+    Log    ${resp.content}
+    Return From Keyword If    ${resp.status_code}!=200    ${False}    ${EMPTY}
+    ${pres}    ${msg}=    Is Flow Configured    ${data}    ${resp.content}
+    Run Keyword If    '''${msg}'''!='${EMPTY}'    Log    ${msg}
+    Return From Keyword    ${pres}    ${msg}
+
+Check Operational Table
+    [Arguments]    ${expected}
+    Wait Until Keyword Succeeds    120s    2s    Check Operational Table Presence    ${expected}
+
+Check Operational Table Presence
+    [Arguments]    ${expected}
+    ${presence_table}    ${msg}=    Flow Presence Operational Table
+    ${msgf}=    Get Presence Failure Message    config    ${expected}    ${presence_table}    ${msg}
+    Should Be Equal    ${expected}    ${presence_table}    msg=${msgf}
+
+Flow Presence Operational Table
+    ${headers}=    Create Dictionary    Accept    application/xml
+    ${resp}=    RequestsLibrary.Get    session    /restconf/operational/opendaylight-inventory:nodes/node/openflow:${switch_idx}/table/${table_id}    headers=${headers}
+    Log    ${resp}
+    Log    ${resp.content}
+    Return From Keyword If    ${resp.status_code}!=200    ${False}    ${EMPTY}
+    ${pres}    ${msg}=    Is Flow Operational2    ${data}    ${resp.content}
+    Run Keyword If    '''${msg}'''!='${EMPTY}'    Log    ${msg}
+    Return From Keyword    ${pres}    ${msg}
+
+Add Flow
+    Log    ${data}
+    ${resp}=    Putxml    session    /restconf/config/opendaylight-inventory:nodes/node/openflow:${switch_idx}/table/${table_id}/flow/${flow_id}    data=${data}
+    ${msg}=    Set Variable    Adding flow for /restconf/config/opendaylight-inventory:nodes/node/openflow:${switch_idx}/table/${table_id}/flow/${flow_id} failed, http response ${resp.status_code} received.
+    Should Be Equal As Strings    ${resp.status_code}    200    msg=${msg}
+
+Delete Flow
+    ${resp}=    Delete    session    /restconf/config/opendaylight-inventory:nodes/node/openflow:${switch_idx}/table/${table_id}/flow/${flow_id}
+    ${msg}=    Set Variable    Delete flow for /restconf/config/opendaylight-inventory:nodes/node/openflow:${switch_idx}/table/${table_id}/flow/${flow_id} failed, http response ${resp.status_code} received.
+    Should Be Equal As Strings    ${resp.status_code}    200    msg=${msg}
+
+Delete All Flows
+    [Documentation]    Deletes all flows
+    : FOR    ${flowfile}    IN    @{xml_files}
+    \    Log    ${flowfile}
+    \    Init Flow Variables    ${flowfile}
+    \    Delete Flow
+
+Initialization Phase
+    [Documentation]    Initiate tcp connection with controller
+    Create Session    session    http://${CONTROLLER}:${RESTCONFPORT}    auth=${AUTH}    headers=${HEADERS_XML}
+
+Teardown Phase
+    [Documentation]    Closes tcp connection with controller and removes flows
+    Delete All Sessions
+
+Get Presence Failure Message
+    [Arguments]    ${ds}    ${expected}    ${presence}    ${diffmsg}
+    Return From Keyword If    '''${diffmsg}'''!='${EMPTY}'    Flow found in ${ds} data store but: ${diffmsg}
+    ${msgf}=    Set Variable If    ${expected}==${True}    The flow is expected in operational data store, but    The flow is not expected in operational data store, but
+    ${msgp}=    Set Variable If    ${presence}==${True}    it is present.    it is not present.
+    Return From Keyword    ${msgf} ${msgp}
diff --git a/test/csit/suites/openflowplugin/Flows_Stats_OF13/__init__.txt b/test/csit/suites/openflowplugin/Flows_Stats_OF13/__init__.txt
new file mode 100644 (file)
index 0000000..3a8e9b7
--- /dev/null
@@ -0,0 +1,10 @@
+*** Settings ***
+Documentation     Test suite for the OpenDaylight base edition with of13, aimed for statistics manager
+Suite Setup       Start Suite
+Suite Teardown    Stop Suite
+Library           SSHLibrary
+Resource          ../../../libraries/Utils.txt
+
+*** Variables ***
+
+*** Keywords ***
diff --git a/test/csit/suites/openflowplugin/Switch_Qualification/010_OpenFlow_Connection.txt b/test/csit/suites/openflowplugin/Switch_Qualification/010_OpenFlow_Connection.txt
new file mode 100644 (file)
index 0000000..fa03952
--- /dev/null
@@ -0,0 +1,49 @@
+*** Settings ***
+Documentation     TODO
+Suite Setup       Switch Qualification Suite Setup
+Suite Teardown    Switch Qualification Suite Teardown
+Test Timeout      5m
+Library           Collections
+Library           OperatingSystem
+Resource          ../../../libraries/SwitchUtils.txt
+Resource          ../../../libraries/Utils.txt
+Library           ../../../libraries/RequestsLibrary.py
+Library           ../../../libraries/Common.py
+Library           ../../../libraries/SwitchClasses/${SWITCH_CLASS}.py
+Variables         ../../../variables/Variables.py
+
+*** Variables ***
+${SWITCH_CLASS}    Ovs
+${SWITCH_IP}      ${MININET}
+${CONTROLLER}     null
+${REST_CONTEXT}    /restconf/operational/opendaylight-inventory:nodes
+
+*** Test Cases ***
+OF1.3 Connection Between Switch and Controller
+    [Tags]    switch_qualification
+    Configure OpenFlow    ${test_switch}
+    Enable OpenFlow    ${test_switch}
+    ${datapath_id_from_switch}=    Get Switch Datapath ID    ${test_switch}
+    Verify Switch In Operational Data Store    ${test_switch}
+    Disable OpenFlow    ${test_switch}
+    Verify Switch Not In Operational Data Store    ${test_switch}
+    ##MORE CHECKS TO ADD ON SWITCH AND OPERATIONAL DATA STORE
+    ##- proper OF version
+    ##- proper default flow rules
+    ##- ???
+
+*** Keywords ***
+Switch Qualification Suite Setup
+    ${test_switch}=    Get Switch    ${SWITCH_CLASS}
+    Set Suite Variable    ${test_switch}
+    Call Method    ${test_switch}    set_mgmt_ip    ${SWITCH_IP}
+    Call Method    ${test_switch}    set_controller_ip    ${CONTROLLER}
+    Log    MAKE: ${test_switch.make}\n MODEL: ${test_switch.model}\n IP: ${test_switch.mgmt_ip}\n PROMPT: ${test_switch.mgmt_prompt}\n CONTROLLER_IP: ${test_switch.of_controller_ip}\n MGMT_PROTOCOL: ${test_switch.mgmt_protocol}
+    Ping    ${test_switch.mgmt_ip}
+    Initialize Switch    ${test_switch}
+    Create Session    session    http://${CONTROLLER}:${RESTCONFPORT}    auth=${AUTH}    headers=${HEADERS_XML}
+
+Switch Qualification Suite Teardown
+    Cleanup Switch    ${test_switch}
+    SSHLibrary.Close All Connections
+    Telnet.Close All Connections
diff --git a/test/csit/suites/openflowplugin/Switch_Qualification/020_OpenFlow_Actions.txt b/test/csit/suites/openflowplugin/Switch_Qualification/020_OpenFlow_Actions.txt
new file mode 100644 (file)
index 0000000..f8396b7
--- /dev/null
@@ -0,0 +1,118 @@
+*** Settings ***
+Documentation     OF1.3 Suite for flow actions
+...               - output ALL
+...               - output CONTROLLER
+...               - output TABLE
+...               - output INPORT
+...               - output LOCAL
+...               - output NORMAL
+...               - output FLOOD
+...               - output ANY
+...
+...               NOTE: for OVS, INPORT does not appear to be supported
+Suite Setup       OpenFlow Actions Suite Setup
+Suite Teardown    OpenFlow Actions Suite Teardown
+Test Template     Create And Remove Flow
+Library           Collections
+Library           OperatingSystem
+Library           String
+Library           XML
+Resource          ../../../libraries/FlowLib.txt
+Resource          ../../../libraries/SwitchUtils.txt
+Library           ../../../libraries/RequestsLibrary.py
+Library           ../../../libraries/Common.py
+Variables         ../../../variables/Variables.py
+Library           ../../../libraries/SwitchClasses/${SWITCH_CLASS}.py
+
+*** Variables ***
+${SWITCH_CLASS}    Ovs
+${SWITCH_IP}      ${MININET}
+${CONTROLLER}     null
+${REST_CON}       /restconf/config/opendaylight-inventory:nodes
+${REST_OPR}       /restconf/operational/opendaylight-inventory:nodes
+${ipv4_src}       11.3.0.0/16
+${ipv4_dst}       99.0.0.0/8
+${eth_type}       0x800
+${eth_src}        00:ab:cd:ef:01:23
+${eth_dst}        ff:ff:ff:ff:ff:ff
+##documentation strings
+${INPORT_doc}     OF1.3: OFPP_INPORT = 0xfffffff8, /* Send the packet out the input port. This\nreserved port must be explicitly used\nin order to send back out of the input\nport. */\n
+${TABLE_doc}      OF1.3: OFPP_TABLE = 0xfffffff9, /* Submit the packet to the first flow table NB: This destination port can only be used in packet-out messages. */
+${NORMAL_doc}     OF1.3 OFPP_NORMAL = 0xfffffffa, /* Process with normal L2/L3 switching. */
+${FLOOD_doc}      OF1.3 OFPP_FLOOD = 0xfffffffb, /* All physical ports in VLAN, except input port and those blocked or link down. */
+${ALL_doc}        OF1.3: OFPP_ALL = 0xfffffffc, /* All physical ports except input port. */
+${CONTROLLER_doc}    OF1.3 OFPP_CONTROLLER = 0xfffffffd, /* Send to controller. */
+${LOCAL_doc}      OF1.3 OFPP_LOCAL = 0xfffffffe, /* Local openflow "port". */
+${ANY_doc}        OF1.3 OFPP_ANY = 0xffffffff /* Wildcard port used only for flow mod (delete) and flow stats requests. Selects all flows regardless of output port (including flows with no output port). */
+
+*** Test Cases ***    output port        tableID              flowID
+INPORT                [Documentation]    ${INPORT_doc}
+                      [Tags]             inport
+                      ${TEST_NAME}       200                  161
+
+TABLE                 [Documentation]    ${TABLE_doc}
+                      [Tags]             table
+                      ${TEST_NAME}       200                  261
+
+NORMAL                [Documentation]    ${NORMAL_doc}
+                      [Tags]             normal
+                      ${TEST_NAME}       200                  361
+
+FLOOD                 [Documentation]    ${FLOOD_doc}
+                      [Tags]             flood
+                      ${TEST_NAME}       200                  81
+
+ALL                   [Documentation]    ${ALL_doc}
+                      [Tags]             all
+                      ${TEST_NAME}       200                  88
+
+CONTROLLER            [Documentation]    ${CONTROLLER_doc}
+                      [Tags]             controller
+                      ${TEST_NAME}       200                  21
+
+LOCAL                 [Documentation]    ${LOCAL_doc}
+                      [Tags]             local
+                      ${TEST_NAME}       200                  32
+
+ANY                   [Documentation]    ${ANY_doc}
+                      [Tags]             any
+                      ${TEST_NAME}       200                  111
+
+*** Keywords ***
+Create And Remove Flow
+    [Arguments]    ${output_port}    ${table_id}    ${flow_id}
+    ##The dictionaries here will be used to populate the match and action elements of the flow mod
+    ${ethernet_match_dict}=    Create Dictionary    type=${eth_type}    destination=${eth_dst}    source=${eth_src}
+    ${ipv4_match_dict}=    Create Dictionary    source=${ipv4_src}    destination=${ipv4_dst}
+    ##flow is a python Object to build flow details, including the xml format to send to controller
+    ${flow}=    Create Inventory Flow
+    Set "${flow}" "table_id" With "${table_id}"
+    Set "${flow}" "id" With "${flow_id}"
+    Clear Flow Actions    ${flow}
+    Set Flow Output Action    ${flow}    0    0    ${output_port}
+    Set Flow Ethernet Match    ${flow}    ${ethernet_match_dict}
+    Set Flow IPv4 Match    ${flow}    ${ipv4_match_dict}
+    Log    Flow XML is ${flow.xml}
+    Call Method    ${test_switch}    create_flow_match_elements    ${flow.xml}
+    Log    ${test_switch.flow_validations}
+    ${dpid_id}=    Get Switch Datapath ID    ${test_switch}
+    Add Flow To Controller And Verify    ${flow.xml}    openflow:${dpid_id}    ${flow.table_id}    ${flow.id}
+    Validate Switch Output    ${test_switch}    ${test_switch.dump_all_flows}    ${test_switch.flow_validations}
+    Remove Flow From Controller And Verify    ${flow.xml}    openflow:${dpid_id}    ${flow.table_id}    ${flow.id}
+    Validate Switch Output    ${test_switch}    ${test_switch.dump_all_flows}    ${test_switch.flow_validations}    false
+
+OpenFlow Actions Suite Setup
+    ${test_switch}=    Get Switch    ${SWITCH_CLASS}
+    Set Suite Variable    ${test_switch}
+    Call Method    ${test_switch}    set_mgmt_ip    ${SWITCH_IP}
+    Call Method    ${test_switch}    set_controller_ip    ${CONTROLLER}
+    Log    MAKE: ${test_switch.make}\n MODEL: ${test_switch.model}\n IP: ${test_switch.mgmt_ip}\n PROMPT: ${test_switch.mgmt_prompt}\n CONTROLLER_IP: ${test_switch.of_controller_ip}\n MGMT_PROTOCOL: ${test_switch.mgmt_protocol}
+    Ping    ${test_switch.mgmt_ip}
+    Initialize Switch    ${test_switch}
+    Configure OpenFlow    ${test_switch}
+    Create Session    session    http://${CONTROLLER}:${RESTCONFPORT}    auth=${AUTH}    headers=${HEADERS_XML}
+
+OpenFlow Actions Suite Teardown
+    Cleanup Switch    ${test_switch}
+    SSHLibrary.Close All Connections
+    Telnet.Close All Connections
diff --git a/test/csit/suites/ovsdb/Bridge_Domain_OF10/010__bridge_domain.txt b/test/csit/suites/ovsdb/Bridge_Domain_OF10/010__bridge_domain.txt
new file mode 100644 (file)
index 0000000..0583279
--- /dev/null
@@ -0,0 +1,123 @@
+*** Settings ***
+Documentation     Test suite for OVSDB Bridge Domain
+Suite Setup       Create Session   session   http://${CONTROLLER}:${RESTPORT}   auth=${AUTH}   headers=${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
+
+*** Variables ***
+${key}             node
+${REST_CONTEXT_CM}    /controller/nb/v2/connectionmanager
+${REST_CONTEXT_BD}    /controller/nb/v2/networkconfig/bridgedomain
+
+*** Test Cases ***
+List connections
+    [Documentation]    Get node connections and validate result
+    [Tags]    ovsdb
+    ${topo_nodes}    Get Nodes From Topology    ${TOPO_TREE_LEVEL}
+    ${resp}    Get    session    ${REST_CONTEXT_CM}/nodes
+    Should Be Equal As Strings   ${resp.status_code}   200
+    ${result}    To JSON    ${resp.content}
+    ${nodes}    Get From Dictionary    ${result}    ${key}
+    List Should Contain Sublist   ${nodes}    ${topo_nodes}
+Connect to mininet
+    [Documentation]    Connect to mininet, list the nodes and validate result
+    [Tags]    ovsdb
+    ${body}   Create Dictionary   type   OVS   id   MININET
+    ${resp}   Put   session   ${REST_CONTEXT_CM}/node/MININET/address/${MININET}/port/6644
+    Should Be Equal As Strings   ${resp.status_code}   200
+    ${result}    To JSON    ${resp.content}
+    Dictionaries Should Be Equal    ${result}   ${body}
+    ${resp}    Get    session    ${REST_CONTEXT_CM}/nodes
+    Should Be Equal As Strings   ${resp.status_code}   200
+    ${result}    To JSON    ${resp.content}
+    ${content}    Get From Dictionary    ${result}    ${key}
+    List Should Contain Value    ${content}    ${body}
+    Sleep   2
+Add bridge s4
+    [Documentation]    Add bridge s4
+    [Tags]    ovsdb
+    ${resp}    Post    session    ${REST_CONTEXT_BD}/bridge/OVS/MININET/s4  data={}
+    Should Be Equal As Strings    ${resp.status_code}    201
+Delete s1 ports
+    [Documentation]    Delete s1 connected ports
+    [Tags]    ovsdb
+    ${resp}    Delete   session   ${REST_CONTEXT_BD}/port/OVS/MININET/s1/s1-eth1
+    Should Be Equal As Strings    ${resp.status_code}    200
+    ${resp}    Delete   session   ${REST_CONTEXT_BD}/port/OVS/MININET/s1/s1-eth2
+    Should Be Equal As Strings    ${resp.status_code}    200
+    ${resp}    Delete   session   ${REST_CONTEXT_BD}/port/OVS/MININET/s2/s2-eth3
+    Should Be Equal As Strings    ${resp.status_code}    200
+    ${resp}    Delete   session   ${REST_CONTEXT_BD}/port/OVS/MININET/s3/s3-eth3
+    Should Be Equal As Strings    ${resp.status_code}    200
+Add s4 ports 
+    [Documentation]    Add s4 connected ports
+    [Tags]    ovsdb
+    ${resp}   Post   session   ${REST_CONTEXT_BD}/port/OVS/MININET/s4/s4-eth1   
+    ...   data={"type":"patch", "CUSTOM":{"peer":"s2-eth3"}}
+    Should Be Equal As Strings    ${resp.status_code}    201
+    ${resp}   Post   session   ${REST_CONTEXT_BD}/port/OVS/MININET/s4/s4-eth2 
+    ...   data={"type":"patch", "CUSTOM":{"peer":"s3-eth3"}}
+    Should Be Equal As Strings    ${resp.status_code}    201
+    ${resp}   Post   session   ${REST_CONTEXT_BD}/port/OVS/MININET/s2/s2-eth3
+    ...   data={"type":"patch", "CUSTOM":{"peer":"s4-eth1"}}
+    Should Be Equal As Strings    ${resp.status_code}    201
+    ${resp}   Post   session   ${REST_CONTEXT_BD}/port/OVS/MININET/s3/s3-eth3
+    ...   data={"type":"patch", "CUSTOM":{"peer":"s4-eth2"}}
+    Should Be Equal As Strings    ${resp.status_code}    201
+Ping h1 to h4
+    [Documentation]    Ping h1 to h4, verify no packet loss
+    [Tags]    ovsdb
+    Sleep   5
+    Write   h1 ping -w 10 h4
+    Sleep   10
+    Write   h4 ping -w 10 h1
+    Sleep   10
+    ${result}    Read
+    Should Contain   ${result}   64 bytes
+Delete s4 ports
+    [Documentation]    Delete s4 connected ports
+    [Tags]    ovsdb
+    ${resp}    Delete   session   ${REST_CONTEXT_BD}/port/OVS/MININET/s4/s4-eth1
+    Should Be Equal As Strings    ${resp.status_code}    200
+    ${resp}    Delete   session   ${REST_CONTEXT_BD}/port/OVS/MININET/s4/s4-eth2
+    Should Be Equal As Strings    ${resp.status_code}    200
+    ${resp}    Delete   session   ${REST_CONTEXT_BD}/port/OVS/MININET/s2/s2-eth3
+    Should Be Equal As Strings    ${resp.status_code}    200
+    ${resp}    Delete   session   ${REST_CONTEXT_BD}/port/OVS/MININET/s3/s3-eth3
+    Should Be Equal As Strings    ${resp.status_code}    200
+Add s1 ports 
+    [Documentation]    Add s1 connected ports
+    [Tags]    ovsdb
+    ${resp}   Post   session   ${REST_CONTEXT_BD}/port/OVS/MININET/s1/s1-eth1
+    ...   data={"type":"patch", "CUSTOM":{"peer":"s2-eth3"}}
+    Should Be Equal As Strings    ${resp.status_code}    201
+    ${resp}   Post   session   ${REST_CONTEXT_BD}/port/OVS/MININET/s1/s1-eth2
+    ...   data={"type":"patch", "CUSTOM":{"peer":"s3-eth3"}}
+    Should Be Equal As Strings    ${resp.status_code}    201
+    ${resp}   Post   session   ${REST_CONTEXT_BD}/port/OVS/MININET/s2/s2-eth3
+    ...   data={"type":"patch", "CUSTOM":{"peer":"s1-eth1"}}
+    Should Be Equal As Strings    ${resp.status_code}    201
+    ${resp}   Post   session   ${REST_CONTEXT_BD}/port/OVS/MININET/s3/s3-eth3
+    ...   data={"type":"patch", "CUSTOM":{"peer":"s1-eth2"}}
+    Should Be Equal As Strings    ${resp.status_code}    201
+Delete bridge s4
+    [Documentation]    Delete bridge s4
+    [Tags]    ovsdb
+    ${resp}    Delete    session    ${REST_CONTEXT_BD}/bridge/OVS/MININET/s4
+    Should Be Equal As Strings    ${resp.status_code}    200
+Disconnect mininet
+    [Documentation]    Disconnect mininet, list the nodes and validate result
+    [Tags]    ovsdb
+    ${body}   Create Dictionary   type   OVS   id   MININET
+    ${resp}   Delete   session   ${REST_CONTEXT_CM}/node/OVS/MININET
+    Should Be Equal As Strings   ${resp.status_code}   200
+    ${resp}    Get    session    ${REST_CONTEXT_CM}/nodes
+    Should Be Equal As Strings   ${resp.status_code}   200
+    ${result}    To JSON    ${resp.content}
+    ${content}    Get From Dictionary    ${result}    ${key}
+    List Should Not Contain Value    ${content}    ${body}
diff --git a/test/csit/suites/ovsdb/Bridge_Domain_OF10/__init__.txt b/test/csit/suites/ovsdb/Bridge_Domain_OF10/__init__.txt
new file mode 100644 (file)
index 0000000..4feeb88
--- /dev/null
@@ -0,0 +1,12 @@
+*** Settings ***
+Documentation     Test suite for OVSDB
+Suite Setup       Start Suite
+Suite Teardown    Stop Suite
+Library     SSHLibrary
+Resource          ../../../libraries/Utils.txt
+
+
+*** Variables ***
+${start}=   sudo mn --controller=remote,ip=${CONTROLLER} --topo tree,2 
+
+** Keywords ***
diff --git a/test/csit/suites/ovsdb/Bridge_Domain_OF13/010__bridge_domain.txt b/test/csit/suites/ovsdb/Bridge_Domain_OF13/010__bridge_domain.txt
new file mode 100644 (file)
index 0000000..0583279
--- /dev/null
@@ -0,0 +1,123 @@
+*** Settings ***
+Documentation     Test suite for OVSDB Bridge Domain
+Suite Setup       Create Session   session   http://${CONTROLLER}:${RESTPORT}   auth=${AUTH}   headers=${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
+
+*** Variables ***
+${key}             node
+${REST_CONTEXT_CM}    /controller/nb/v2/connectionmanager
+${REST_CONTEXT_BD}    /controller/nb/v2/networkconfig/bridgedomain
+
+*** Test Cases ***
+List connections
+    [Documentation]    Get node connections and validate result
+    [Tags]    ovsdb
+    ${topo_nodes}    Get Nodes From Topology    ${TOPO_TREE_LEVEL}
+    ${resp}    Get    session    ${REST_CONTEXT_CM}/nodes
+    Should Be Equal As Strings   ${resp.status_code}   200
+    ${result}    To JSON    ${resp.content}
+    ${nodes}    Get From Dictionary    ${result}    ${key}
+    List Should Contain Sublist   ${nodes}    ${topo_nodes}
+Connect to mininet
+    [Documentation]    Connect to mininet, list the nodes and validate result
+    [Tags]    ovsdb
+    ${body}   Create Dictionary   type   OVS   id   MININET
+    ${resp}   Put   session   ${REST_CONTEXT_CM}/node/MININET/address/${MININET}/port/6644
+    Should Be Equal As Strings   ${resp.status_code}   200
+    ${result}    To JSON    ${resp.content}
+    Dictionaries Should Be Equal    ${result}   ${body}
+    ${resp}    Get    session    ${REST_CONTEXT_CM}/nodes
+    Should Be Equal As Strings   ${resp.status_code}   200
+    ${result}    To JSON    ${resp.content}
+    ${content}    Get From Dictionary    ${result}    ${key}
+    List Should Contain Value    ${content}    ${body}
+    Sleep   2
+Add bridge s4
+    [Documentation]    Add bridge s4
+    [Tags]    ovsdb
+    ${resp}    Post    session    ${REST_CONTEXT_BD}/bridge/OVS/MININET/s4  data={}
+    Should Be Equal As Strings    ${resp.status_code}    201
+Delete s1 ports
+    [Documentation]    Delete s1 connected ports
+    [Tags]    ovsdb
+    ${resp}    Delete   session   ${REST_CONTEXT_BD}/port/OVS/MININET/s1/s1-eth1
+    Should Be Equal As Strings    ${resp.status_code}    200
+    ${resp}    Delete   session   ${REST_CONTEXT_BD}/port/OVS/MININET/s1/s1-eth2
+    Should Be Equal As Strings    ${resp.status_code}    200
+    ${resp}    Delete   session   ${REST_CONTEXT_BD}/port/OVS/MININET/s2/s2-eth3
+    Should Be Equal As Strings    ${resp.status_code}    200
+    ${resp}    Delete   session   ${REST_CONTEXT_BD}/port/OVS/MININET/s3/s3-eth3
+    Should Be Equal As Strings    ${resp.status_code}    200
+Add s4 ports 
+    [Documentation]    Add s4 connected ports
+    [Tags]    ovsdb
+    ${resp}   Post   session   ${REST_CONTEXT_BD}/port/OVS/MININET/s4/s4-eth1   
+    ...   data={"type":"patch", "CUSTOM":{"peer":"s2-eth3"}}
+    Should Be Equal As Strings    ${resp.status_code}    201
+    ${resp}   Post   session   ${REST_CONTEXT_BD}/port/OVS/MININET/s4/s4-eth2 
+    ...   data={"type":"patch", "CUSTOM":{"peer":"s3-eth3"}}
+    Should Be Equal As Strings    ${resp.status_code}    201
+    ${resp}   Post   session   ${REST_CONTEXT_BD}/port/OVS/MININET/s2/s2-eth3
+    ...   data={"type":"patch", "CUSTOM":{"peer":"s4-eth1"}}
+    Should Be Equal As Strings    ${resp.status_code}    201
+    ${resp}   Post   session   ${REST_CONTEXT_BD}/port/OVS/MININET/s3/s3-eth3
+    ...   data={"type":"patch", "CUSTOM":{"peer":"s4-eth2"}}
+    Should Be Equal As Strings    ${resp.status_code}    201
+Ping h1 to h4
+    [Documentation]    Ping h1 to h4, verify no packet loss
+    [Tags]    ovsdb
+    Sleep   5
+    Write   h1 ping -w 10 h4
+    Sleep   10
+    Write   h4 ping -w 10 h1
+    Sleep   10
+    ${result}    Read
+    Should Contain   ${result}   64 bytes
+Delete s4 ports
+    [Documentation]    Delete s4 connected ports
+    [Tags]    ovsdb
+    ${resp}    Delete   session   ${REST_CONTEXT_BD}/port/OVS/MININET/s4/s4-eth1
+    Should Be Equal As Strings    ${resp.status_code}    200
+    ${resp}    Delete   session   ${REST_CONTEXT_BD}/port/OVS/MININET/s4/s4-eth2
+    Should Be Equal As Strings    ${resp.status_code}    200
+    ${resp}    Delete   session   ${REST_CONTEXT_BD}/port/OVS/MININET/s2/s2-eth3
+    Should Be Equal As Strings    ${resp.status_code}    200
+    ${resp}    Delete   session   ${REST_CONTEXT_BD}/port/OVS/MININET/s3/s3-eth3
+    Should Be Equal As Strings    ${resp.status_code}    200
+Add s1 ports 
+    [Documentation]    Add s1 connected ports
+    [Tags]    ovsdb
+    ${resp}   Post   session   ${REST_CONTEXT_BD}/port/OVS/MININET/s1/s1-eth1
+    ...   data={"type":"patch", "CUSTOM":{"peer":"s2-eth3"}}
+    Should Be Equal As Strings    ${resp.status_code}    201
+    ${resp}   Post   session   ${REST_CONTEXT_BD}/port/OVS/MININET/s1/s1-eth2
+    ...   data={"type":"patch", "CUSTOM":{"peer":"s3-eth3"}}
+    Should Be Equal As Strings    ${resp.status_code}    201
+    ${resp}   Post   session   ${REST_CONTEXT_BD}/port/OVS/MININET/s2/s2-eth3
+    ...   data={"type":"patch", "CUSTOM":{"peer":"s1-eth1"}}
+    Should Be Equal As Strings    ${resp.status_code}    201
+    ${resp}   Post   session   ${REST_CONTEXT_BD}/port/OVS/MININET/s3/s3-eth3
+    ...   data={"type":"patch", "CUSTOM":{"peer":"s1-eth2"}}
+    Should Be Equal As Strings    ${resp.status_code}    201
+Delete bridge s4
+    [Documentation]    Delete bridge s4
+    [Tags]    ovsdb
+    ${resp}    Delete    session    ${REST_CONTEXT_BD}/bridge/OVS/MININET/s4
+    Should Be Equal As Strings    ${resp.status_code}    200
+Disconnect mininet
+    [Documentation]    Disconnect mininet, list the nodes and validate result
+    [Tags]    ovsdb
+    ${body}   Create Dictionary   type   OVS   id   MININET
+    ${resp}   Delete   session   ${REST_CONTEXT_CM}/node/OVS/MININET
+    Should Be Equal As Strings   ${resp.status_code}   200
+    ${resp}    Get    session    ${REST_CONTEXT_CM}/nodes
+    Should Be Equal As Strings   ${resp.status_code}   200
+    ${result}    To JSON    ${resp.content}
+    ${content}    Get From Dictionary    ${result}    ${key}
+    List Should Not Contain Value    ${content}    ${body}
diff --git a/test/csit/suites/ovsdb/Bridge_Domain_OF13/__init__.txt b/test/csit/suites/ovsdb/Bridge_Domain_OF13/__init__.txt
new file mode 100644 (file)
index 0000000..f04089e
--- /dev/null
@@ -0,0 +1,11 @@
+*** Settings ***
+Documentation     Test suite for OVSDB mininet OF13
+Suite Setup       Start Suite
+Suite Teardown    Stop Suite
+Library     SSHLibrary
+Resource          ../../../libraries/Utils.txt
+
+*** Variables ***
+${start}=   sudo mn --controller=remote,ip=${CONTROLLER} --topo tree,2 --switch ovsk,protocols=OpenFlow13 
+
+** Keywords ***
diff --git a/test/csit/suites/ovsdb/OpenStack/010__networks.txt b/test/csit/suites/ovsdb/OpenStack/010__networks.txt
new file mode 100644 (file)
index 0000000..ac5080a
--- /dev/null
@@ -0,0 +1,58 @@
+*** Settings ***
+Documentation     Checking Network created in OpenStack are pushed to OpenDaylight
+Suite Setup      Create Session    OSSession     http://${OPENSTACK}:9696    headers=${X-AUTH}    
+Suite Teardown    Delete All Sessions
+Library           SSHLibrary
+Library           Collections
+Library           OperatingSystem
+Library           ../../../libraries/RequestsLibrary.py
+Library           ../../../libraries/Common.py
+Variables         ../../../variables/Variables.py
+*** Variables ***
+${ODLREST}       /controller/nb/v2/neutron/networks
+${OSREST}        /v2.0/networks
+${postNet}     {"network":{"name":"odl_network","admin_state_up":true}}
+*** Test Cases ***
+Check OpenStack Networks
+       [Documentation]     Checking OpenStack Neutron for known networks
+       [Tags]              Network Neutron OpenStack
+        Log    ${X-AUTH}
+        ${resp}                get     OSSession       ${OSREST}   
+       Should be Equal As Strings      ${resp.status_code}     200
+        ${OSResult}    To Json         ${resp.content}
+        Set Suite Variable     ${OSResult}
+        Log    ${OSResult}
+
+Check OpenDaylight Networks
+       [Documentation]    Checking OpenDaylight Neutron API for Known Networks
+        [Tags]                    Network Neutron OpenDaylight
+        Create Session ODLSession      http://${CONTROLLER}:${PORT}     headers=${HEADERS}  auth=${AUTH}
+        ${resp}        get     ODLSession      ${ODLREST}    
+       Should be Equal As Strings      ${resp.status_code}     200
+        ${ODLResult}   To Json         ${resp.content}
+        Set Suite Variable     ${ODLResult}
+        Log    ${ODLResult}
+
+Create Network 
+       [Documentation]    Create new network in OpenStack
+       [Tags]             Create Network OpenStack Neutron
+        Log    ${postNet}
+        ${resp}                post    OSSession       ${OSREST}  data=${postNet}  
+        Should be Equal As Strings     ${resp.status_code}     201
+       ${result}       To JSON         ${resp.content}
+       ${result}       Get From Dictionary     ${result}       network 
+        ${NETID}       Get From Dictionary     ${result}       id
+        Log    ${result}
+       Log     ${NETID}
+        Set Global Variable    ${NETID}
+        sleep    2
+
+Check Network
+       [Documentation]   Check Network created in OpenDaylight
+       [Tags]          Check  Network OpenDaylight
+       ${resp}         get     ODLSession      ${ODLREST}/${NetID}
+        Should be Equal As Strings     ${resp.status_code}     200
+
+
diff --git a/test/csit/suites/ovsdb/OpenStack/020__subnets.txt b/test/csit/suites/ovsdb/OpenStack/020__subnets.txt
new file mode 100644 (file)
index 0000000..b5eec15
--- /dev/null
@@ -0,0 +1,58 @@
+*** Settings ***
+Documentation     Checking Subnets  created in OpenStack are pushed to OpenDaylight
+Suite Setup      Create Session    OSSession     http://${OPENSTACK}:9696    headers=${X-AUTH}    
+Suite Teardown    Delete All Sessions
+Library           SSHLibrary
+Library           Collections
+Library           OperatingSystem
+Library           ../../../libraries/RequestsLibrary.py
+Library           ../../../libraries/Common.py
+Variables         ../../../variables/Variables.py
+*** Variables ***
+${ODLREST}       /controller/nb/v2/neutron/subnets
+${OSREST}        /v2.0/subnets
+${data}       {"subnet":{"network_id":"${NETID}","ip_version":4,"cidr":"172.16.64.0/24","allocation_pools":[{"start":"172.16.64.20","end":"172.16.64.120"}]}}
+*** Test Cases ***
+Check OpenStack Subnets
+       [Documentation]     Checking OpenStack Neutron for known Subnets
+       [Tags]              Subnets Neutron OpenStack
+        Log    ${X-AUTH}
+        ${resp}                get     OSSession       ${OSREST}    
+       Should be Equal As Strings      ${resp.status_code}     200
+        ${OSResult}    To Json         ${resp.content}
+        Set Suite Variable     ${OSResult}
+        Log    ${OSResult}
+
+Check OpenDaylight subnets
+       [Documentation]    Checking OpenDaylight Neutron API for Known Subnets
+        [Tags]                    Subnets Neutron OpenDaylight
+        Create Session ODLSession      http://${CONTROLLER}:${PORT}     headers=${HEADERS}  auth=${AUTH}
+        ${resp}        get     ODLSession      ${ODLREST}    
+       Should be Equal As Strings      ${resp.status_code}     200
+        ${ODLResult}   To Json         ${resp.content}
+        Set Suite Variable     ${ODLResult}
+        Log    ${ODLResult}
+
+Create New subnet
+       [Documentation]    Create new subnet in OpenStack
+       [Tags]             Create Subnet OpenStack Neutron
+        Log    ${data}
+        ${resp}                post    OSSession       ${OSREST}       data=${data}  
+        Should be Equal As Strings     ${resp.status_code}     201
+       ${result}       To JSON         ${resp.content}
+       ${result}       Get From Dictionary     ${result}       subnet  
+        ${SUBNETID}    Get From Dictionary     ${result}       id
+        Log    ${result}
+       Log     ${SUBNETID}
+        Set Global Variable    ${SUBNETID}
+        sleep    2
+
+Check New subnet
+       [Documentation]   Check new subnet created in OpenDaylight
+       [Tags]          Check  subnet OpenDaylight
+       ${resp}         get     ODLSession      ${ODLREST}/${SUBNETID}
+        Should be Equal As Strings     ${resp.status_code}     200
+
+
diff --git a/test/csit/suites/ovsdb/OpenStack/030__ports.txt b/test/csit/suites/ovsdb/OpenStack/030__ports.txt
new file mode 100644 (file)
index 0000000..d455d6f
--- /dev/null
@@ -0,0 +1,58 @@
+*** Settings ***
+Documentation     Checking Port  created in OpenStack are pushed to OpenDaylight
+Suite Setup      Create Session    OSSession     http://${OPENSTACK}:9696    headers=${X-AUTH}    
+Suite Teardown    Delete All Sessions
+Library           SSHLibrary
+Library           Collections
+Library           OperatingSystem
+Library           ../../../libraries/RequestsLibrary.py
+Library           ../../../libraries/Common.py
+Variables         ../../../variables/Variables.py
+*** Variables ***
+${ODLREST}       /controller/nb/v2/neutron/ports
+${OSREST}        /v2.0/ports
+${data}       {"port":{"network_id":"${NETID}","admin_state_up": true}}
+*** Test Cases ***
+Check OpenStack ports
+       [Documentation]     Checking OpenStack Neutron for known ports
+       [Tags]              Ports Neutron OpenStack
+        Log    ${X-AUTH}
+        ${resp}                get     OSSession       ${OSREST}    
+       Should be Equal As Strings      ${resp.status_code}     200
+        ${OSResult}    To Json         ${resp.content}
+        Set Suite Variable     ${OSResult}
+        Log    ${OSResult}
+
+Check OpenDaylight ports
+       [Documentation]    Checking OpenDaylight Neutron API for Known Ports
+        [Tags]                    Ports Neutron OpenDaylight
+        Create Session ODLSession      http://${CONTROLLER}:${PORT}     headers=${HEADERS}  auth=${AUTH}
+        ${resp}        get     ODLSession      ${ODLREST}    
+       Should be Equal As Strings      ${resp.status_code}     200
+        ${ODLResult}   To Json         ${resp.content}
+        Set Suite Variable     ${ODLResult}
+        Log    ${ODLResult}
+
+Create New Port
+       [Documentation]    Create new port in OpenStack
+       [Tags]             Create port OpenStack Neutron
+        Log    ${data}
+        ${resp}                post    OSSession       ${OSREST}       data=${data}  
+        Should be Equal As Strings     ${resp.status_code}     201
+       ${result}       To JSON         ${resp.content}
+       ${result}       Get From Dictionary     ${result}       port    
+        ${PORTID}      Get From Dictionary     ${result}       id
+        Log    ${result}
+       Log     ${PORTID}
+        Set Global Variable    ${PORTID}
+        sleep    2
+
+Check New Port
+       [Documentation]   Check new subnet created in OpenDaylight
+       [Tags]          Check  subnet OpenDaylight
+       ${resp}         get     ODLSession      ${ODLREST}/${PORTID}
+        Should be Equal As Strings     ${resp.status_code}     200
+
+
diff --git a/test/csit/suites/ovsdb/OpenStack/__init__.txt b/test/csit/suites/ovsdb/OpenStack/__init__.txt
new file mode 100644 (file)
index 0000000..f57e2a9
--- /dev/null
@@ -0,0 +1,27 @@
+*** Settings ***
+Documentation     Test suite for Neutron Plugin
+Suite Setup       Start Suite
+Suite Teardown    Stop Suite
+Library     SSHLibrary
+Library     Collections
+Library     ../../../libraries/RequestsLibrary.py
+Library     ../../../libraries/Common.py
+Variables   ../../../variables/Variables.py
+
+*** Variables ***
+${UserInfo}=  {"auth": {"tenantName": "admin", "passwordCredentials": {"username": "admin", "password": "admin"}}}
+
+** Keywords ***
+Start Suite
+    Create Session  KeyStoneSession    http://${OPENSTACK}:5000      headers=${HEADERS}
+    ${resp}      post    KeyStoneSession     /v2.0/tokens    ${UserInfo}
+    Should Be Equal As Strings    ${resp.status_code}     200
+    ${result}  To JSON   ${resp.content}
+    ${result}   Get From Dictionary   ${result}  access
+    ${result}   Get From Dictionary   ${result}  token
+    ${TOKEN}   Get From Dictionary   ${result}  id
+    ${X-AUTH}  Create Dictionary     X-Auth-Token      ${TOKEN}    Content-Type     application/json      
+    Set Global Variable   ${X-AUTH}
+Stop Suite
+    Delete All Sessions
+
diff --git a/test/csit/suites/vtn/VTN_OF10/010__vtn_manager.txt b/test/csit/suites/vtn/VTN_OF10/010__vtn_manager.txt
new file mode 100644 (file)
index 0000000..84dfec7
--- /dev/null
@@ -0,0 +1,117 @@
+*** Settings ***
+Documentation     Test suite for VTN Manager
+Suite Setup       Create Session    session    http://${CONTROLLER}:${RESTPORT}    auth=${AUTH}    headers=${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
+
+*** Variables ***
+${REST_CONTEXT_VTNS}    controller/nb/v2/vtn/default/vtns
+
+*** Test Cases ***
+Add a vtn Tenant1
+    [Documentation]    Add a vtn Tenant1
+    Add a vtn    Tenant1    {"description": "Virtual Tenant 1 for Hackfest network"}
+
+Add a vBridge vBridge1
+    [Documentation]    Add a vBridge vBridge1 in vtn Tenant1
+    Add a vBridge    Tenant1    vBridge1    {}
+
+Add a interface If1
+    [Documentation]    Add a interface if1 into vBridge vBrdige1
+    Add a interface    Tenant1    vBridge1    if1    {}
+
+Add a interface if2
+    [Documentation]    Add a interface if2 into vBridge vBrdige1
+    Add a interface    Tenant1    vBridge1    if2    {}
+
+Add a portmap for interface if1
+    [Documentation]    Create a portmap on Interface if1 of vBridge1
+    ${node}    Create Dictionary    type    OF    id    00:00:00:00:00:00:00:02
+    ${port}    Create Dictionary    name    s2-eth1
+    ${portmap_data}    Create Dictionary    node    ${node}    port    ${port}
+    Add a portmap    Tenant1    vBridge1    if1    ${portmap_data}
+
+Add a portmap for interface if2
+    [Documentation]    Create a portmap on Interface if2 of vBridge1
+    ${node}    Create Dictionary    type    OF    id    00:00:00:00:00:00:00:03
+    ${port}    Create Dictionary    name    s3-eth1
+    ${portmap_data}    Create Dictionary    node    ${node}    port    ${port}
+    Add a portmap    Tenant1    vBridge1    if2    ${portmap_data} 
+
+Add a vBridge vBridge2
+    [Documentation]    Add a vBridge vBridge2 in vtn Tenant1
+    Add a vBridge    Tenant1    vBridge2    {}
+
+Add a interface If3
+    [Documentation]    Add a interface if3 into vBridge vBrdige2
+    Add a interface    Tenant1    vBridge2    if3    {}
+
+Add a interface if4
+    [Documentation]    Add a interface if4 into vBridge vBrdige2
+    Add a interface    Tenant1    vBridge2    if4    {}
+
+Add a portmap for interface if3
+    [Documentation]    Create a portmap on Interface if3 of vBridge2
+    ${node}    Create Dictionary    type    OF    id    00:00:00:00:00:00:00:02
+    ${port}    Create Dictionary    name    s2-eth2
+    ${portmap_data}    Create Dictionary    node    ${node}    port    ${port}
+    Add a portmap    Tenant1    vBridge2    if3    ${portmap_data}
+
+Add a portmap for interface if4
+    [Documentation]    Create a portmap on Interface if4 of vBridge2
+    ${node}    Create Dictionary    type    OF    id    00:00:00:00:00:00:00:03
+    ${port}    Create Dictionary    name    s3-eth2
+    ${portmap_data}    Create Dictionary    node    ${node}    port    ${port}
+    Add a portmap    Tenant1    vBridge2    if4    ${portmap_data}
+
+Ping h1 to h3
+    [Documentation]    Ping h1 to h3, verify no packet loss
+    Write    h1 ping -w 10 h3
+    ${result}    Read Until    mininet>
+    Should Contain    ${result}    64 bytes
+
+Ping h2 to h4
+    [Documentation]    Ping h2 to h4, verify no packet loss
+    Write    h2 ping -w 10 h4
+    ${result}    Read Until    mininet>
+    Should Contain    ${result}    64 bytes
+
+Delete a vtn Tenant1
+    [Documentation]    Delete a vtn Tenant1
+    Delete a vtn    Tenant1
+
+*** Keywords ***
+Add a vtn
+    [Arguments]    ${vtn_name}    ${vtn_data}
+    [Documentation]    Create a vtn with specified parameters.
+    ${resp}    Post    session    ${REST_CONTEXT_VTNS}/${vtn_name}    data=${vtn_data}
+    Should Be Equal As Strings    ${resp.status_code}    201
+
+Delete a vtn
+    [Arguments]    ${vtn_name}
+    [Documentation]    Create a vtn with specified parameters.
+    ${resp}    Delete    session    ${REST_CONTEXT_VTNS}/${vtn_name}
+    Should Be Equal As Strings    ${resp.status_code}    200
+
+Add a vBridge
+    [Arguments]    ${vtn_name}    ${vBridge_name}    ${vBridge_data}
+    [Documentation]    Create a vBridge in a VTN
+    ${resp}    Post    session    ${REST_CONTEXT_VTNS}/${vtn_name}/vbridges/${vBridge_name}    data=${vBridge_data}
+    Should Be Equal As Strings    ${resp.status_code}    201
+
+Add a interface
+    [Arguments]    ${vtn_name}    ${vBridge_name}    ${interface_name}    ${interface_data}
+    [Documentation]    Create a interface into a vBridge of a VTN
+    ${resp}    Post    session    ${REST_CONTEXT_VTNS}/${vtn_name}/vbridges/${vBridge_name}/interfaces/${interface_name}    data=${interface_data}
+    Should Be Equal As Strings    ${resp.status_code}    201
+
+Add a portmap
+    [Arguments]    ${vtn_name}    ${vBridge_name}    ${interface_name}    ${portmap_data}
+    [Documentation]    Create a portmap for a interface of a vbridge
+    ${resp}    Put    session    ${REST_CONTEXT_VTNS}/${vtn_name}/vbridges/${vBridge_name}/interfaces/${interface_name}/portmap    data=${portmap_data}
+    Should Be Equal As Strings    ${resp.status_code}    200
diff --git a/test/csit/suites/vtn/VTN_OF10/020__vtn_coordinator.txt b/test/csit/suites/vtn/VTN_OF10/020__vtn_coordinator.txt
new file mode 100644 (file)
index 0000000..7ab79a0
--- /dev/null
@@ -0,0 +1,159 @@
+*** 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
+
+
+
+*** Test Cases ***
+Add a ODL Controller
+    [Documentation]    Add a Controller
+    [Tags]    vtnc
+    Add a Controller    odc_test     ${CONTROLLER}
+
+
+Verify the Controller Status is up
+    [Documentation]    Check Controller status
+    [Tags]   vtnc 
+    Check Controller Status    odc_test
+
+
+Add a Vtn Tenant1
+    [Documentation]   Create Vtn Tenant1
+    [Tags]   vtnc 
+    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
+
+
+Create VBRIF in VBRIDGE Vbridge1 Interface1
+    [Documentation]   Create an interface to Vbridge1
+    [Tags]   vtnc 
+    Create VBRIF in VBR   Tenant1    Vbridge1   Interface1  Interface1
+
+
+Create VBRIF in VBRIDGE Vbridge1 Interface2
+    [Documentation]   Create an interface to Vbridge1
+    [Tags]   vtnc 
+    Create VBRIF in VBR   Tenant1    Vbridge1   Interface2  Interface2
+
+
+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:03-s3-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-eth1
+
+
+Test Ping for Configuration1
+    [Documentation]   ping between hosts in mininet
+    [Tags]   vtnc 
+    Test Ping    h1    h3
+
+
+Delete a VTN Tenant1
+    [Documentation]   Delete Vtn Tenant1
+    [Tags]   vtnc
+    Delete a VTN  Tenant1
+
+
+Delete a Controller odc1
+    [Documentation]   Delete Controller odc1
+    [Tags]   vtnc
+    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
+   Sleep    15
+   ${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
+   Sleep   5
+   Write    ${host1} ping -w 10 ${host2}
+   Sleep    10
+   ${result}    Read
+   Should Contain    ${result}    64 bytes
diff --git a/test/csit/suites/vtn/VTN_OF10/030__vtn_coordinator.txt b/test/csit/suites/vtn/VTN_OF10/030__vtn_coordinator.txt
new file mode 100644 (file)
index 0000000..cc10eea
--- /dev/null
@@ -0,0 +1,102 @@
+
+*** 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
+
+
+*** Test Cases ***
+Add a ODL Controller
+    [Documentation]    Add a Controller odc1
+    [Tags]    vtnc
+    Add a Controller    odc_test     ${CONTROLLER}
+
+Verify the Controller Status is up
+    [Documentation]    Check Controller status
+    [Tags]   vtnc
+    Check Controller Status    odc_test  up   20
+
+Verify switch1
+    [Documentation]    Get switch1
+    [Tags]   vtnc
+    Verify Switch    odc_test     00:00:00:00:00:00:00:01  30
+
+Verify switch2
+    [Documentation]    Get switch2
+    [Tags]   vtnc
+    Verify Switch    odc_test     00:00:00:00:00:00:00:02  1
+
+Verify switch3
+    [Documentation]    Get switch3
+    [Tags]   vtnc
+    Verify Switch    odc_test     00:00:00:00:00:00:00:03  1
+
+Verify switchPort switch1
+    [Documentation]   Get switchport/switch1
+    [Tags]   vtnc
+    Verify SwitchPort    odc_test     00:00:00:00:00:00:00:01  15
+
+Verify switchPort switch2
+    [Documentation]   Get switchport/switch2
+    [Tags]   vtnc
+    Verify SwitchPort    odc_test     00:00:00:00:00:00:00:02  1
+
+Verify switchPort switch3
+    [Documentation]   Get switchport/switch3
+    [Tags]   vtnc
+    Verify SwitchPort    odc_test     00:00:00:00:00:00:00:03  1
+
+Delete a Controller
+    [Documentation]   Delete Controller odc1
+    [Tags]   vtnc
+    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}   ${sec}
+   [Documentation]    Get controller status
+   Sleep    ${sec}
+   ${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}  ${sec}
+   [Documentation]    Get switch
+   Sleep    ${sec}
+   ${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}  ${sec}
+   [Documentation]    Get switch
+   Sleep    ${sec}
+   ${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_OF10/040__vtn_coordinator.txt b/test/csit/suites/vtn/VTN_OF10/040__vtn_coordinator.txt
new file mode 100644 (file)
index 0000000..c8c6ffd
--- /dev/null
@@ -0,0 +1,176 @@
+*** 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
+
+
+*** Test Cases ***
+Add a ODL Controller
+    [Documentation]    Add a Controller
+    [Tags]    vtnc
+    Add a Controller    odc_test     ${CONTROLLER}
+
+Verify the Controller Status is up
+    [Documentation]    Check Controller status
+    [Tags]   vtnc
+    Check Controller Status    odc_test   up   20
+
+Add a Vtn Tenant1
+    [Documentation]   Create Vtn Tenant1
+    [Tags]   vtnc
+    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
+
+Update controller ip invalid
+    [Documentation]    Update Controller ip to invalid
+    [Tags]    vtnc
+    Update Controller    odc_test     10.0.0.1   invalid_IP
+
+Verify the Controller State is down
+    [Documentation]    Check Controller status
+    [Tags]   vtnc
+    Check Controller Status    odc_test   down   45
+
+Create VBRIF in VBRIDGE Vbridge1 Interface1
+    [Documentation]   Create an interface to Vbridge1
+    [Tags]   vtnc
+    Create VBRIF in VBR   Tenant1    Vbridge1   Interface1  Interface1
+
+Create VBRIF in VBRIDGE Vbridge1 Interface2
+    [Documentation]   Create an interface to Vbridge1
+    [Tags]   vtnc
+    Create VBRIF in VBR   Tenant1    Vbridge1   Interface2  Interface2
+
+Update controller ip valid
+    [Documentation]    Update Controller ip to valid
+    [Tags]    vtnc
+    Update Controller    odc_test     ${CONTROLLER}   valid_IP
+
+Verify the Controller State is up
+    [Documentation]    Check Controller status
+    [Tags]   vtnc
+    Check Controller Status    odc_test   up   45
+
+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
+
+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
+
+Test Ping for Configuration1
+    [Documentation]   ping between hosts in mininet
+    [Tags]   vtnc
+    Test Ping    h1    h2
+
+Delete a VTN Tenant1
+    [Documentation]   Delete Vtn Tenant1
+    [Tags]   vtnc
+    Delete a VTN  Tenant1
+
+Delete a Controller odc1
+    [Documentation]   Delete Controller odc1
+    [Tags]   vtnc
+    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}   ${sec}
+   [Documentation]    Get controller status
+   Sleep    ${sec}
+   ${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
+   Sleep   5
+   Write    ${host1} ping -w 10 ${host2}
+   Sleep    10
+   ${result}    Read
+   Should Contain    ${result}    64 bytes
diff --git a/test/csit/suites/vtn/VTN_OF10/__init__.txt b/test/csit/suites/vtn/VTN_OF10/__init__.txt
new file mode 100644 (file)
index 0000000..8a8c194
--- /dev/null
@@ -0,0 +1,11 @@
+*** Settings ***
+Documentation     Test suite for AD-SAL NSF
+Suite Setup       Start Suite
+Suite Teardown    Stop Suite
+Library     SSHLibrary
+Resource          ../../../libraries/Utils.txt
+
+*** Variables ***
+${start}=   sudo mn --controller=remote,ip=${CONTROLLER} --topo tree,2 
+
+** Keywords ***
diff --git a/test/csit/suites/vtn/VTN_OF13/010__vtn_manager.txt b/test/csit/suites/vtn/VTN_OF13/010__vtn_manager.txt
new file mode 100644 (file)
index 0000000..143d723
--- /dev/null
@@ -0,0 +1,117 @@
+*** Settings ***
+Documentation     Test suite for VTN Manager
+Suite Setup       Create Session    session    http://${CONTROLLER}:${RESTPORT}    auth=${AUTH}    headers=${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
+
+*** Variables ***
+${REST_CONTEXT_VTNS}    controller/nb/v2/vtn/default/vtns
+
+*** Test Cases ***
+Add a vtn Tenant1
+    [Documentation]    Add a vtn Tenant1
+    Add a vtn    Tenant1    {"description": "Virtual Tenant 1 for Hackfest network"}
+
+Add a vBridge vBridge1
+    [Documentation]    Add a vBridge vBridge1 in vtn Tenant1
+    Add a vBridge    Tenant1    vBridge1    {}
+
+Add a interface If1
+    [Documentation]    Add a interface if1 into vBrdige vBridge1
+    Add a interface    Tenant1    vBridge1    if1    {}
+
+Add a interface if2
+    [Documentation]    Add a interface if2 into vBrdige vBridge1
+    Add a interface    Tenant1    vBridge1    if2    {}
+
+Add a portmap for interface if1
+    [Documentation]    Create a portmap on Interface if1 of vBridge1
+    ${node}    Create Dictionary    type    OF    id    00:00:00:00:00:00:00:02
+    ${port}    Create Dictionary    name    s2-eth1
+    ${portmap_data}    Create Dictionary    node    ${node}    port    ${port}
+    Add a portmap    Tenant1    vBridge1    if1    ${portmap_data}
+
+Add a portmap for interface if2
+    [Documentation]    Create a portmap on Interface if2 of vBridge1
+    ${node}    Create Dictionary    type    OF    id    00:00:00:00:00:00:00:03
+    ${port}    Create Dictionary    name    s3-eth1
+    ${portmap_data}    Create Dictionary    node    ${node}    port    ${port}
+    Add a portmap    Tenant1    vBridge1    if2    ${portmap_data} 
+
+Add a vBridge vBridge2
+    [Documentation]    Add a vBridge vBridge2 in vtn Tenant1
+    Add a vBridge    Tenant1    vBridge2    {}
+
+Add a interface If3
+    [Documentation]    Add a interface if3 into vBrdige vBridge2
+    Add a interface    Tenant1    vBridge2    if3    {}
+
+Add a interface if4
+    [Documentation]    Add a interface if4 into vBrdige vBridge2
+    Add a interface    Tenant1    vBridge2    if4    {}
+
+Add a portmap for interface if3
+    [Documentation]    Create a portmap on Interface if3 of vBridge2
+    ${node}    Create Dictionary    type    OF    id    00:00:00:00:00:00:00:02
+    ${port}    Create Dictionary    name    s2-eth2
+    ${portmap_data}    Create Dictionary    node    ${node}    port    ${port}
+    Add a portmap    Tenant1    vBridge2    if3    ${portmap_data}
+
+Add a portmap for interface if4
+    [Documentation]    Create a portmap on Interface if4 of vBridge2
+    ${node}    Create Dictionary    type    OF    id    00:00:00:00:00:00:00:03
+    ${port}    Create Dictionary    name    s3-eth2
+    ${portmap_data}    Create Dictionary    node    ${node}    port    ${port}
+    Add a portmap    Tenant1    vBridge2    if4    ${portmap_data}
+
+Ping h1 to h3
+    [Documentation]    Ping h1 to h3, verify no packet loss
+    Write    h1 ping -w 10 h3
+    ${result}    Read Until    mininet>
+    Should Contain    ${result}    64 bytes
+
+Ping h2 to h4
+    [Documentation]    Ping h2 to h4, verify no packet loss
+    Write    h2 ping -w 10 h4
+    ${result}    Read Until    mininet>
+    Should Contain    ${result}    64 bytes
+
+Delete a vtn Tenant1
+    [Documentation]    Delete a vtn Tenant1
+    Delete a vtn    Tenant1
+
+*** Keywords ***
+Add a vtn
+    [Arguments]    ${vtn_name}    ${vtn_data}
+    [Documentation]    Create a vtn with specified parameters.
+    ${resp}    Post    session    ${REST_CONTEXT_VTNS}/${vtn_name}    data=${vtn_data}
+    Should Be Equal As Strings    ${resp.status_code}    201
+
+Delete a vtn
+    [Arguments]    ${vtn_name}
+    [Documentation]    Create a vtn with specified parameters.
+    ${resp}    Delete    session    ${REST_CONTEXT_VTNS}/${vtn_name}
+    Should Be Equal As Strings    ${resp.status_code}    200
+
+Add a vBridge
+    [Arguments]    ${vtn_name}    ${vBridge_name}    ${vBridge_data}
+    [Documentation]    Create a vBridge in a VTN
+    ${resp}    Post    session    ${REST_CONTEXT_VTNS}/${vtn_name}/vbridges/${vBridge_name}    data=${vBridge_data}
+    Should Be Equal As Strings    ${resp.status_code}    201
+
+Add a interface
+    [Arguments]    ${vtn_name}    ${vBridge_name}    ${interface_name}    ${interface_data}
+    [Documentation]    Create a interface into a vBridge of a VTN
+    ${resp}    Post    session    ${REST_CONTEXT_VTNS}/${vtn_name}/vbridges/${vBridge_name}/interfaces/${interface_name}    data=${interface_data}
+    Should Be Equal As Strings    ${resp.status_code}    201
+
+Add a portmap
+    [Arguments]    ${vtn_name}    ${vBridge_name}    ${interface_name}    ${portmap_data}
+    [Documentation]    Create a portmap for a interface of a vbridge
+    ${resp}    Put    session    ${REST_CONTEXT_VTNS}/${vtn_name}/vbridges/${vBridge_name}/interfaces/${interface_name}/portmap    data=${portmap_data}
+    Should Be Equal As Strings    ${resp.status_code}    200
diff --git a/test/csit/suites/vtn/VTN_OF13/020__vtn_coordinator.txt b/test/csit/suites/vtn/VTN_OF13/020__vtn_coordinator.txt
new file mode 100644 (file)
index 0000000..7ab79a0
--- /dev/null
@@ -0,0 +1,159 @@
+*** 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
+
+
+
+*** Test Cases ***
+Add a ODL Controller
+    [Documentation]    Add a Controller
+    [Tags]    vtnc
+    Add a Controller    odc_test     ${CONTROLLER}
+
+
+Verify the Controller Status is up
+    [Documentation]    Check Controller status
+    [Tags]   vtnc 
+    Check Controller Status    odc_test
+
+
+Add a Vtn Tenant1
+    [Documentation]   Create Vtn Tenant1
+    [Tags]   vtnc 
+    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
+
+
+Create VBRIF in VBRIDGE Vbridge1 Interface1
+    [Documentation]   Create an interface to Vbridge1
+    [Tags]   vtnc 
+    Create VBRIF in VBR   Tenant1    Vbridge1   Interface1  Interface1
+
+
+Create VBRIF in VBRIDGE Vbridge1 Interface2
+    [Documentation]   Create an interface to Vbridge1
+    [Tags]   vtnc 
+    Create VBRIF in VBR   Tenant1    Vbridge1   Interface2  Interface2
+
+
+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:03-s3-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-eth1
+
+
+Test Ping for Configuration1
+    [Documentation]   ping between hosts in mininet
+    [Tags]   vtnc 
+    Test Ping    h1    h3
+
+
+Delete a VTN Tenant1
+    [Documentation]   Delete Vtn Tenant1
+    [Tags]   vtnc
+    Delete a VTN  Tenant1
+
+
+Delete a Controller odc1
+    [Documentation]   Delete Controller odc1
+    [Tags]   vtnc
+    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
+   Sleep    15
+   ${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
+   Sleep   5
+   Write    ${host1} ping -w 10 ${host2}
+   Sleep    10
+   ${result}    Read
+   Should Contain    ${result}    64 bytes
diff --git a/test/csit/suites/vtn/VTN_OF13/030__vtn_coordinator.txt b/test/csit/suites/vtn/VTN_OF13/030__vtn_coordinator.txt
new file mode 100644 (file)
index 0000000..cc10eea
--- /dev/null
@@ -0,0 +1,102 @@
+
+*** 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
+
+
+*** Test Cases ***
+Add a ODL Controller
+    [Documentation]    Add a Controller odc1
+    [Tags]    vtnc
+    Add a Controller    odc_test     ${CONTROLLER}
+
+Verify the Controller Status is up
+    [Documentation]    Check Controller status
+    [Tags]   vtnc
+    Check Controller Status    odc_test  up   20
+
+Verify switch1
+    [Documentation]    Get switch1
+    [Tags]   vtnc
+    Verify Switch    odc_test     00:00:00:00:00:00:00:01  30
+
+Verify switch2
+    [Documentation]    Get switch2
+    [Tags]   vtnc
+    Verify Switch    odc_test     00:00:00:00:00:00:00:02  1
+
+Verify switch3
+    [Documentation]    Get switch3
+    [Tags]   vtnc
+    Verify Switch    odc_test     00:00:00:00:00:00:00:03  1
+
+Verify switchPort switch1
+    [Documentation]   Get switchport/switch1
+    [Tags]   vtnc
+    Verify SwitchPort    odc_test     00:00:00:00:00:00:00:01  15
+
+Verify switchPort switch2
+    [Documentation]   Get switchport/switch2
+    [Tags]   vtnc
+    Verify SwitchPort    odc_test     00:00:00:00:00:00:00:02  1
+
+Verify switchPort switch3
+    [Documentation]   Get switchport/switch3
+    [Tags]   vtnc
+    Verify SwitchPort    odc_test     00:00:00:00:00:00:00:03  1
+
+Delete a Controller
+    [Documentation]   Delete Controller odc1
+    [Tags]   vtnc
+    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}   ${sec}
+   [Documentation]    Get controller status
+   Sleep    ${sec}
+   ${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}  ${sec}
+   [Documentation]    Get switch
+   Sleep    ${sec}
+   ${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}  ${sec}
+   [Documentation]    Get switch
+   Sleep    ${sec}
+   ${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_OF13/040__vtn_coordinator.txt b/test/csit/suites/vtn/VTN_OF13/040__vtn_coordinator.txt
new file mode 100644 (file)
index 0000000..c8c6ffd
--- /dev/null
@@ -0,0 +1,176 @@
+*** 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
+
+
+*** Test Cases ***
+Add a ODL Controller
+    [Documentation]    Add a Controller
+    [Tags]    vtnc
+    Add a Controller    odc_test     ${CONTROLLER}
+
+Verify the Controller Status is up
+    [Documentation]    Check Controller status
+    [Tags]   vtnc
+    Check Controller Status    odc_test   up   20
+
+Add a Vtn Tenant1
+    [Documentation]   Create Vtn Tenant1
+    [Tags]   vtnc
+    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
+
+Update controller ip invalid
+    [Documentation]    Update Controller ip to invalid
+    [Tags]    vtnc
+    Update Controller    odc_test     10.0.0.1   invalid_IP
+
+Verify the Controller State is down
+    [Documentation]    Check Controller status
+    [Tags]   vtnc
+    Check Controller Status    odc_test   down   45
+
+Create VBRIF in VBRIDGE Vbridge1 Interface1
+    [Documentation]   Create an interface to Vbridge1
+    [Tags]   vtnc
+    Create VBRIF in VBR   Tenant1    Vbridge1   Interface1  Interface1
+
+Create VBRIF in VBRIDGE Vbridge1 Interface2
+    [Documentation]   Create an interface to Vbridge1
+    [Tags]   vtnc
+    Create VBRIF in VBR   Tenant1    Vbridge1   Interface2  Interface2
+
+Update controller ip valid
+    [Documentation]    Update Controller ip to valid
+    [Tags]    vtnc
+    Update Controller    odc_test     ${CONTROLLER}   valid_IP
+
+Verify the Controller State is up
+    [Documentation]    Check Controller status
+    [Tags]   vtnc
+    Check Controller Status    odc_test   up   45
+
+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
+
+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
+
+Test Ping for Configuration1
+    [Documentation]   ping between hosts in mininet
+    [Tags]   vtnc
+    Test Ping    h1    h2
+
+Delete a VTN Tenant1
+    [Documentation]   Delete Vtn Tenant1
+    [Tags]   vtnc
+    Delete a VTN  Tenant1
+
+Delete a Controller odc1
+    [Documentation]   Delete Controller odc1
+    [Tags]   vtnc
+    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}   ${sec}
+   [Documentation]    Get controller status
+   Sleep    ${sec}
+   ${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
+   Sleep   5
+   Write    ${host1} ping -w 10 ${host2}
+   Sleep    10
+   ${result}    Read
+   Should Contain    ${result}    64 bytes
diff --git a/test/csit/suites/vtn/VTN_OF13/__init__.txt b/test/csit/suites/vtn/VTN_OF13/__init__.txt
new file mode 100644 (file)
index 0000000..36c2d66
--- /dev/null
@@ -0,0 +1,11 @@
+*** Settings ***
+Documentation     Test suite for AD-SAL NSF mininet OF13
+Suite Setup       Start Suite
+Suite Teardown    Stop Suite
+Library     SSHLibrary
+Resource          ../../../libraries/Utils.txt
+
+*** Variables ***
+${start}=   sudo mn --controller=remote,ip=${CONTROLLER} --topo tree,2 --switch ovsk,protocols=OpenFlow13 
+
+** Keywords ***