Merge "Initial isolation test integrated with robot framework Usage: pybot -v LEADER...
authorChristopher O'Shea <christopher.o.shea@ericsson.com>
Thu, 18 Sep 2014 18:53:03 +0000 (18:53 +0000)
committerGerrit Code Review <gerrit@opendaylight.org>
Thu, 18 Sep 2014 18:53:03 +0000 (18:53 +0000)
119 files changed:
test/csit/libraries/FlowLib.py
test/csit/libraries/FlowLib.txt
test/csit/libraries/XmlComparator.py
test/csit/suites/base-of13/070__Flows_OF13/305__ttl.txt
test/csit/suites/base-of13/070__Flows_OF13/400__actions.txt
test/csit/suites/karaf-all/070__Flows_OF13/305__ttl.txt [deleted file]
test/csit/suites/karaf-compatible/010__MD_SAL_NSF/010__restconf_inventory.txt [moved from test/csit/suites/karaf-all/010__MD_SAL_NSF/010__restconf_inventory.txt with 100% similarity]
test/csit/suites/karaf-compatible/010__MD_SAL_NSF/020__restconf_statistics.txt [moved from test/csit/suites/karaf-all/010__MD_SAL_NSF/020__restconf_statistics.txt with 100% similarity]
test/csit/suites/karaf-compatible/010__MD_SAL_NSF/030__restconf_topology.txt [moved from test/csit/suites/karaf-all/010__MD_SAL_NSF/030__restconf_topology.txt with 100% similarity]
test/csit/suites/karaf-compatible/010__MD_SAL_NSF/040__restconf_frm.txt [moved from test/csit/suites/karaf-all/010__MD_SAL_NSF/040__restconf_frm.txt with 100% similarity]
test/csit/suites/karaf-compatible/010__MD_SAL_NSF/__init__.txt [moved from test/csit/suites/karaf-all/010__MD_SAL_NSF/__init__.txt with 100% similarity]
test/csit/suites/karaf-compatible/020__MD_SAL_NSF_OF13/010__restconf_inventory.txt [moved from test/csit/suites/karaf-all/020__MD_SAL_NSF_OF13/010__restconf_inventory.txt with 100% similarity]
test/csit/suites/karaf-compatible/020__MD_SAL_NSF_OF13/020__restconf_statistics.txt [moved from test/csit/suites/karaf-all/020__MD_SAL_NSF_OF13/020__restconf_statistics.txt with 100% similarity]
test/csit/suites/karaf-compatible/020__MD_SAL_NSF_OF13/030__restconf_topology.txt [moved from test/csit/suites/karaf-all/020__MD_SAL_NSF_OF13/030__restconf_topology.txt with 100% similarity]
test/csit/suites/karaf-compatible/020__MD_SAL_NSF_OF13/040__restconf_frm.txt [moved from test/csit/suites/karaf-all/020__MD_SAL_NSF_OF13/040__restconf_frm.txt with 100% similarity]
test/csit/suites/karaf-compatible/020__MD_SAL_NSF_OF13/__init__.txt [moved from test/csit/suites/karaf-all/020__MD_SAL_NSF_OF13/__init__.txt with 100% similarity]
test/csit/suites/karaf-compatible/030__AD_SAL_NSF/010__switch_manager.txt [moved from test/csit/suites/karaf-all/030__AD_SAL_NSF/010__switch_manager.txt with 100% similarity]
test/csit/suites/karaf-compatible/030__AD_SAL_NSF/020__statistics_manager.txt [moved from test/csit/suites/karaf-all/030__AD_SAL_NSF/020__statistics_manager.txt with 100% similarity]
test/csit/suites/karaf-compatible/030__AD_SAL_NSF/030__topology_manager.txt [moved from test/csit/suites/karaf-all/030__AD_SAL_NSF/030__topology_manager.txt with 100% similarity]
test/csit/suites/karaf-compatible/030__AD_SAL_NSF/040__flow_programmer.txt [moved from test/csit/suites/karaf-all/030__AD_SAL_NSF/040__flow_programmer.txt with 100% similarity]
test/csit/suites/karaf-compatible/030__AD_SAL_NSF/__init__.txt [moved from test/csit/suites/karaf-all/030__AD_SAL_NSF/__init__.txt with 100% similarity]
test/csit/suites/karaf-compatible/040__AD_SAL_NSF_OF13/010__switch_manager.txt [moved from test/csit/suites/karaf-all/040__AD_SAL_NSF_OF13/010__switch_manager.txt with 100% similarity]
test/csit/suites/karaf-compatible/040__AD_SAL_NSF_OF13/020__statistics_manager.txt [moved from test/csit/suites/karaf-all/040__AD_SAL_NSF_OF13/020__statistics_manager.txt with 100% similarity]
test/csit/suites/karaf-compatible/040__AD_SAL_NSF_OF13/030__topology_manager.txt [moved from test/csit/suites/karaf-all/040__AD_SAL_NSF_OF13/030__topology_manager.txt with 100% similarity]
test/csit/suites/karaf-compatible/040__AD_SAL_NSF_OF13/040__flow_programmer.txt [moved from test/csit/suites/karaf-all/040__AD_SAL_NSF_OF13/040__flow_programmer.txt with 100% similarity]
test/csit/suites/karaf-compatible/040__AD_SAL_NSF_OF13/__init__.txt [moved from test/csit/suites/karaf-all/040__AD_SAL_NSF_OF13/__init__.txt with 100% similarity]
test/csit/suites/karaf-compatible/050__AD_SAL_Apps/010__host_tracker.txt [moved from test/csit/suites/karaf-all/050__AD_SAL_Apps/010__host_tracker.txt with 100% similarity]
test/csit/suites/karaf-compatible/050__AD_SAL_Apps/020__static_route.txt [moved from test/csit/suites/karaf-all/050__AD_SAL_Apps/020__static_route.txt with 100% similarity]
test/csit/suites/karaf-compatible/050__AD_SAL_Apps/030__subnet_gateway.txt [moved from test/csit/suites/karaf-all/050__AD_SAL_Apps/030__subnet_gateway.txt with 100% similarity]
test/csit/suites/karaf-compatible/050__AD_SAL_Apps/__init__.txt [moved from test/csit/suites/karaf-all/050__AD_SAL_Apps/__init__.txt with 100% similarity]
test/csit/suites/karaf-compatible/060__AD_SAL_Apps_OF13/010__host_tracker.txt [moved from test/csit/suites/karaf-all/060__AD_SAL_Apps_OF13/010__host_tracker.txt with 100% similarity]
test/csit/suites/karaf-compatible/060__AD_SAL_Apps_OF13/020__static_route.txt [moved from test/csit/suites/karaf-all/060__AD_SAL_Apps_OF13/020__static_route.txt with 100% similarity]
test/csit/suites/karaf-compatible/060__AD_SAL_Apps_OF13/030__subnet_gateway.txt [moved from test/csit/suites/karaf-all/060__AD_SAL_Apps_OF13/030__subnet_gateway.txt with 100% similarity]
test/csit/suites/karaf-compatible/060__AD_SAL_Apps_OF13/__init__.txt [moved from test/csit/suites/karaf-all/060__AD_SAL_Apps_OF13/__init__.txt with 100% similarity]
test/csit/suites/karaf-compatible/070__Flows_OF13/300__dst_ip.txt [moved from test/csit/suites/karaf-all/070__Flows_OF13/300__dst_ip.txt with 100% similarity]
test/csit/suites/karaf-compatible/070__Flows_OF13/301__src_ip.txt [moved from test/csit/suites/karaf-all/070__Flows_OF13/301__src_ip.txt with 100% similarity]
test/csit/suites/karaf-compatible/070__Flows_OF13/302__dst_mac.txt [moved from test/csit/suites/karaf-all/070__Flows_OF13/302__dst_mac.txt with 100% similarity]
test/csit/suites/karaf-compatible/070__Flows_OF13/304__eth_ip_port.txt [moved from test/csit/suites/karaf-all/070__Flows_OF13/304__eth_ip_port.txt with 100% similarity]
test/csit/suites/karaf-compatible/070__Flows_OF13/305__ttl.txt [new file with mode: 0644]
test/csit/suites/karaf-compatible/070__Flows_OF13/306__eth_ip_qos.txt [moved from test/csit/suites/karaf-all/070__Flows_OF13/306__eth_ip_qos.txt with 100% similarity]
test/csit/suites/karaf-compatible/070__Flows_OF13/307__eth_ip_qos_port_tcpport.txt [moved from test/csit/suites/karaf-all/070__Flows_OF13/307__eth_ip_qos_port_tcpport.txt with 100% similarity]
test/csit/suites/karaf-compatible/070__Flows_OF13/308__eth_ip_qos_port_tcpport_mpls.txt [moved from test/csit/suites/karaf-all/070__Flows_OF13/308__eth_ip_qos_port_tcpport_mpls.txt with 100% similarity]
test/csit/suites/karaf-compatible/070__Flows_OF13/309__eth_ip_qos_sctp.txt [moved from test/csit/suites/karaf-all/070__Flows_OF13/309__eth_ip_qos_sctp.txt with 100% similarity]
test/csit/suites/karaf-compatible/070__Flows_OF13/310__eth_ip_qos_icmp.txt [moved from test/csit/suites/karaf-all/070__Flows_OF13/310__eth_ip_qos_icmp.txt with 100% similarity]
test/csit/suites/karaf-compatible/070__Flows_OF13/311__eth_arp.txt [moved from test/csit/suites/karaf-all/070__Flows_OF13/311__eth_arp.txt with 100% similarity]
test/csit/suites/karaf-compatible/070__Flows_OF13/312__eth_arp_transport.txt [moved from test/csit/suites/karaf-all/070__Flows_OF13/312__eth_arp_transport.txt with 100% similarity]
test/csit/suites/karaf-compatible/070__Flows_OF13/313__eth_arp_transport_hardware.txt [moved from test/csit/suites/karaf-all/070__Flows_OF13/313__eth_arp_transport_hardware.txt with 100% similarity]
test/csit/suites/karaf-compatible/070__Flows_OF13/314__eth_vlan.txt [moved from test/csit/suites/karaf-all/070__Flows_OF13/314__eth_vlan.txt with 100% similarity]
test/csit/suites/karaf-compatible/070__Flows_OF13/315__timeout_vlan_pcp_vlan.txt [moved from test/csit/suites/karaf-all/070__Flows_OF13/315__timeout_vlan_pcp_vlan.txt with 100% similarity]
test/csit/suites/karaf-compatible/070__Flows_OF13/316__eth_mpls_tc_bos.txt [moved from test/csit/suites/karaf-all/070__Flows_OF13/316__eth_mpls_tc_bos.txt with 100% similarity]
test/csit/suites/karaf-compatible/070__Flows_OF13/317__eth_ipv6.txt [moved from test/csit/suites/karaf-all/070__Flows_OF13/317__eth_ipv6.txt with 100% similarity]
test/csit/suites/karaf-compatible/070__Flows_OF13/318__metadata.txt [moved from test/csit/suites/karaf-all/070__Flows_OF13/318__metadata.txt with 100% similarity]
test/csit/suites/karaf-compatible/070__Flows_OF13/319__metadata_mask.txt [moved from test/csit/suites/karaf-all/070__Flows_OF13/319__metadata_mask.txt with 100% similarity]
test/csit/suites/karaf-compatible/070__Flows_OF13/320__ipv6_meta_qos_udp.txt [moved from test/csit/suites/karaf-all/070__Flows_OF13/320__ipv6_meta_qos_udp.txt with 100% similarity]
test/csit/suites/karaf-compatible/070__Flows_OF13/321__ipv6_meta_qos_tcp.txt [moved from test/csit/suites/karaf-all/070__Flows_OF13/321__ipv6_meta_qos_tcp.txt with 100% similarity]
test/csit/suites/karaf-compatible/070__Flows_OF13/322__ipv6_flow.txt [moved from test/csit/suites/karaf-all/070__Flows_OF13/322__ipv6_flow.txt with 100% similarity]
test/csit/suites/karaf-compatible/070__Flows_OF13/323__tunnel.txt [moved from test/csit/suites/karaf-all/070__Flows_OF13/323__tunnel.txt with 100% similarity]
test/csit/suites/karaf-compatible/070__Flows_OF13/324__ipv6_flow_label.txt [moved from test/csit/suites/karaf-all/070__Flows_OF13/324__ipv6_flow_label.txt with 100% similarity]
test/csit/suites/karaf-compatible/070__Flows_OF13/400__actions.txt [new file with mode: 0644]
test/csit/suites/karaf-compatible/070__Flows_OF13/__init__.txt [moved from test/csit/suites/karaf-all/070__Flows_OF13/__init__.txt with 100% similarity]
test/csit/suites/karaf-compatible/075__Flows_OF13_Stat_Manager/010__SM_add_upd_del_flows.txt [new file with mode: 0644]
test/csit/suites/karaf-compatible/075__Flows_OF13_Stat_Manager/__init__.txt [new file with mode: 0644]
test/csit/suites/karaf-compatible/080__Inventory_Performance/010__restconf_inventory.txt [moved from test/csit/suites/karaf-all/080__Inventory_Performance/010__restconf_inventory.txt with 100% similarity]
test/csit/suites/karaf-compatible/080__Inventory_Performance/015__restconf_topology.txt [new file with mode: 0644]
test/csit/suites/karaf-compatible/080__Inventory_Performance/020__switch_manager.txt [moved from test/csit/suites/karaf-all/080__Inventory_Performance/020__switch_manager.txt with 100% similarity]
test/csit/suites/karaf-compatible/080__Inventory_Performance/030__statistics_manager.txt [moved from test/csit/suites/karaf-all/080__Inventory_Performance/030__statistics_manager.txt with 100% similarity]
test/csit/suites/karaf-compatible/080__Inventory_Performance/040__topology_manager.txt [moved from test/csit/suites/karaf-all/080__Inventory_Performance/040__topology_manager.txt with 100% similarity]
test/csit/suites/karaf-compatible/080__Inventory_Performance/050__ping_test.txt [moved from test/csit/suites/karaf-all/080__Inventory_Performance/050__ping_test.txt with 100% similarity]
test/csit/suites/karaf-compatible/080__Inventory_Performance/__init__.txt [moved from test/csit/suites/karaf-all/080__Inventory_Performance/__init__.txt with 100% similarity]
test/csit/suites/karaf-compatible/090__OVSDB/010__bridge_domain.txt [moved from test/csit/suites/karaf-all/090__OVSDB/010__bridge_domain.txt with 100% similarity]
test/csit/suites/karaf-compatible/090__OVSDB/__init__.txt [moved from test/csit/suites/karaf-all/090__OVSDB/__init__.txt with 100% similarity]
test/csit/suites/karaf-compatible/100__OVSDB_OF13/010__bridge_domain.txt [moved from test/csit/suites/karaf-all/100__OVSDB_OF13/010__bridge_domain.txt with 100% similarity]
test/csit/suites/karaf-compatible/100__OVSDB_OF13/__init__.txt [moved from test/csit/suites/karaf-all/100__OVSDB_OF13/__init__.txt with 100% similarity]
test/csit/suites/karaf-vtn/050__VTN/010__vtn_manager.txt [new file with mode: 0644]
test/csit/suites/karaf-vtn/050__VTN/020__vtn_coordinator.txt [new file with mode: 0644]
test/csit/suites/karaf-vtn/050__VTN/030__vtn_coordinator.txt [new file with mode: 0644]
test/csit/suites/karaf-vtn/050__VTN/040__vtn_coordinator.txt [new file with mode: 0644]
test/csit/suites/karaf-vtn/050__VTN/__init__.txt [new file with mode: 0644]
test/csit/suites/karaf-vtn/060__VTN_OF13/010__vtn_manager.txt [new file with mode: 0644]
test/csit/suites/karaf-vtn/060__VTN_OF13/020__vtn_coordinator.txt [new file with mode: 0644]
test/csit/suites/karaf-vtn/060__VTN_OF13/030__vtn_coordinator.txt [new file with mode: 0644]
test/csit/suites/karaf-vtn/060__VTN_OF13/040__vtn_coordinator.txt [new file with mode: 0644]
test/csit/suites/karaf-vtn/060__VTN_OF13/__init__.txt [new file with mode: 0644]
test/csit/variables/xmls/f101.xml
test/csit/variables/xmls/f102.xml
test/csit/variables/xmls/f103.xml
test/csit/variables/xmls/f104.xml
test/csit/variables/xmls/f105.xml
test/csit/variables/xmls/f106.xml
test/csit/variables/xmls/f107.xml
test/csit/variables/xmls/f108.xml
test/csit/variables/xmls/f109.xml
test/csit/variables/xmls/f110.xml
test/csit/variables/xmls/f111.xml
test/csit/variables/xmls/f112.xml
test/csit/variables/xmls/f113.xml
test/csit/variables/xmls/f114.xml
test/csit/variables/xmls/f201.xml
test/csit/variables/xmls/f202.xml
test/csit/variables/xmls/f203.xml
test/csit/variables/xmls/f204.xml
test/csit/variables/xmls/f205.xml
test/csit/variables/xmls/f206.xml
test/csit/variables/xmls/f207.xml
test/csit/variables/xmls/f208.xml
test/csit/variables/xmls/f209.xml
test/csit/variables/xmls/f210.xml
test/csit/variables/xmls/f211.xml
test/csit/variables/xmls/f212.xml
test/csit/variables/xmls/f213.xml
test/csit/variables/xmls/f214.xml
test/csit/variables/xmls/f215.xml
test/csit/variables/xmls/f216.xml
test/csit/variables/xmls/f217.xml
test/csit/variables/xmls/f218.xml
test/csit/variables/xmls/f219.xml
test/csit/variables/xmls/f220.xml
test/csit/variables/xmls/f221.xml
test/tools/OF_Test/robot_suites/998__Independent_OF_Tests_ovs/010__Connect_256_Switches.txt [new file with mode: 0644]

index 2e42328a56e4d6bbc449432e6a7f0267379861ec..d985777dfc85667858e39e119edae7641d0e4766 100644 (file)
@@ -13,13 +13,18 @@ import string
 import robot
 from robot.libraries.BuiltIn import BuiltIn
 
-##bare bones xml for building a flow
-xml_skeleton = '<?xml version="1.0" encoding="UTF-8" standalone="no"?>' +      \
+##bare bones xml for building a flow xml for flow:inventory
+flow_xml_skeleton = '<?xml version="1.0" encoding="UTF-8" standalone="no"?>' +      \
                '<flow xmlns="urn:opendaylight:flow:inventory">'         +      \
                     '<instructions></instructions>'                     +      \
                     '<match></match>'                                   +      \
                '</flow>'
 
+input_xml_skeleton = '<?xml version="1.0" encoding="UTF-8" standalone="no"?>' +      \
+               '<input xmlns="urn:opendaylight:flow:service">'          +      \
+               '</input>'
+
+
 class Flow:
     '''
     Flow class for creating and interacting with OpenFlow flows
@@ -38,7 +43,7 @@ class Flow:
     priority = 0
     barrier = "false"
 
-    xml = xml_skeleton
+    xml = ""
 
     json = ""
 
@@ -51,12 +56,23 @@ class Flow:
         '''
         setattr(self, field, value)
 
-def Make_Flow_Object():
+def Make_Inventory_Flow():
     '''
         Robot Keyword to create and return an instance of the Flow
         class.
     '''
     flow = Flow()
+    flow.xml = flow_xml_skeleton
+    return flow
+
+def Make_Service_Flow():
+    '''
+        Robot Keyword to create an input XML that can be used to
+        directly send to flow:service for things like accessing
+        the remove-flow RPC via restconf
+    '''
+    flow = Flow()
+    flow.xml = input_xml_skeleton
     return flow
 
 def Set_Flow_Field(flow, field, value):
index e8e714131fd90eec829841512885b44b3bf8c5ef..3f0769d694bfadf09e4ffa4f1a8d8cef3d51ac48 100644 (file)
@@ -7,17 +7,18 @@ Library           ./FlowLib.py
 Library           XML
 
 *** Variables ***
-##default flow attributes ...
-@{default_flow_fields}    strict    table_id    id    hard_timeout    idle_timeout    flow_name    priority
-...               barrier    cookie    cookie_mask
 
 *** Keywords ***
-Create Flow
-    [Documentation]    Calls FlowLib.Make_Flow_Object() function and initializes and sanitizes
-    ...    the basic flow elements.
-    ${flow}=    Make Flow Object
-    : FOR    ${field}    IN    @{default_flow_fields}
-    \    Set "${flow}" "${field}" With "${flow.${field}}"
+Create Inventory Flow
+    [Documentation]    Calls FlowLib.Make_Inventory_Flow function and initializes and sanitizes
+    ...    the basic flow elements that can be given to flow:inventory
+    ${flow}=    Make Inventory Flow
+    [Return]    ${flow}
+
+Create Service Flow
+    [Documentation]    Used for creating an object that will use an XML format that
+    ...    can be given to flow:service.
+    ${flow}=    Make Service Flow
     [Return]    ${flow}
 
 Set "${flow}" "${property}" With "${property_val}"
@@ -100,6 +101,17 @@ Clear Flow Matches
     Remove Flow XML Element    ${flow}    match/${match_element}
     [Return]    ${flow}
 
+Set Flow XML Element Attribute
+    [Arguments]    ${flow}    ${element}    ${id}    ${value}
+    [Documentation]    Will set the given id/value pair to the given to the element provided
+    ...    and make the proper changes to the ${flow} object also provided.
+    ${flow_xml}=    Parse XML    ${flow.xml}
+    Set Element Attribute    ${flow_xml}    ${id}    ${value}    xpath=${element}
+    ${xml_string}=    Element To String    ${flow_xml}
+    Set Flow Field    ${flow}    xml    ${xml_string}
+    Log    ${flow.xml}
+    [Return]    ${flow}
+
 Add Flow XML Element
     [Arguments]    ${flow}    ${element}    ${element_val}=${EMPTY}    ${xpath}=.
     [Documentation]    Will modify the current xml representation of the ${flow} object to contain
@@ -112,6 +124,7 @@ Add Flow XML Element
     Add Element    ${flow_xml}    <${element}>${element_val}</${element}>    xpath=${xpath}
     ${xml_string}=    Element To String    ${flow_xml}
     Set Flow Field    ${flow}    xml    ${xml_string}
+    Log    ${flow.xml}
     [Return]    ${flow}
 
 Remove Flow XML Element
@@ -166,19 +179,22 @@ Verify Flow Does Not Exist On Mininet Switch
 Remove Default Flows
     [Arguments]    ${node_id}
     [Documentation]    Removes any flows considered "default". one such flow is
-    ...    to forward all traffic to the CONTROLLER. If/When others are implemented
-    ...    this keyword can be updated to include those.
-    ##The preference for deleting flows would be via REST to the controller, but
-    ##it's not possible with a call to the config API. For now, the flows are
-    ##deleted via dpctl on mininet. The flows are present in the operational
-    ##datastore, but you may need to wait for some time (15s) before it's refelcted
-    ##there.
-    write    dpctl del-flows -O OpenFlow13
+    ...    to forward all traffic to the CONTROLLER with priority 0 at flow-table 0
+    ...    If/When others are implemented this keyword can be updated to include those.
+    ${flow}=    Make Service Flow
+    Set "${flow}" "priority" With "0"
+    Set "${flow}" "flow-table" With "0"
+    Add Flow XML Element    ${flow}    node    /inv:nodes/inv:node[inv:id="${node_id}"]
+    Set Flow XML Element Attribute    ${flow}    node    xmlns:inv    urn:opendaylight:inventory
+    Log    Flow XML is ${flow.xml}
+    write    dpctl dump-flows -O OpenFlow13
     ${switchoutput}    Read Until    >
-    #${flow}=    Create Flow
-    #Set "${flow}" "table_id" With "0"
-    #Set "${flow}" "id" With "0"
-    #Set Flow Output Action    ${flow}    0    0    CONTROLLER
-    #Log    Flow XML is ${flow.xml}
-    #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    CONTROLLER
+    ${headers}=    Create Dictionary    Content-Type    application/yang.data+xml
+    ${resp}    RequestsLibrary.Post    session    restconf/operations/sal-flow:remove-flow    data=${flow.xml}    headers=${headers}
+    Log    ${resp.content}
+    Should Be Equal As Strings    ${resp.status_code}    200
+    ${resp}=    Get    session    ${REST_OPR}
+    Log    ${resp.content}
+    Should Not Contain    ${resp.content}    "output-node-connector": "CONTROLLER",
+    ${strings_to_check_for}=    Create List    CONTROLLER
+    Verify Flow Does Not Exist On Mininet Switch    ${strings_to_check_for}
index 1a1c4532283fe6235beab6d5b494f75ef4fa129d..3dca1c1ba507c1c089229be0701cd59129b9dfb6 100644 (file)
@@ -77,7 +77,7 @@ class XMLtoDictParserTools():
                 if key in ['ipv4-destination', 'ipv4-source', 'ipv6-destination', 'ipv6-source', 'ipv6-nd-target']:
                     nvalue = _allign_address(value)
                     m_dict[key] = nvalue
-                elif key in ['tunnel-mask','type']:
+                elif key in ['tunnel-mask','type','metadata-mask']:
                     nvalue = _convert_numbers(value)
                     m_dict[key] = nvalue
                 else:
@@ -195,6 +195,7 @@ TAGS_TO_ADD_FOR_OC = [(['flow', 'instructions', 'instruction', 'apply-actions',
 
 
 TAGS_TO_MODIFY_FOR_OC = [(['flow', 'match','metadata'], 'metadata', 'metadata-mask'),
+                         (['flow', 'match','tunnel'], 'tunnel-id', 'tunnel-mask'),
                         ]
 
 class XmlComparator:
index f169fda92c6f7ca40954dd3ff3e211fad319b3c2..d47d3403dd1f9e0909a9aab952caf245d20fb815 100644 (file)
@@ -74,7 +74,7 @@ Create And Remove Flow
     ${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 Flow
+    ${flow}=    Create Inventory Flow
     Set "${flow}" "table_id" With "${table_id}"
     Set "${flow}" "id" With "${flow_id}"
     Clear Flow Actions    ${flow}
index 66b570805b1f7878ec3f257402ff25c18d5d33a7..1a22774dd9f4f60ec8437bd43956ae6ff6e32f4d 100644 (file)
@@ -3,13 +3,13 @@ Documentation     OF1.3 Suite for flow actions
 ...               - output ALL
 ...               - output CONTROLLER
 ...               - output TABLE
-...               - output IN_PORT
+...               - output INPORT
 ...               - output LOCAL
 ...               - output NORMAL
 ...               - output FLOOD
 ...               - output ANY
 ...
-...               NOTE: for OVS, IN_PORT does not appear to be supported
+...               NOTE: for OVS, INPORT does not appear to be supported
 Suite Setup       Create Session    session    http://${CONTROLLER}:${RESTCONFPORT}    auth=${AUTH}    headers=${HEADERS_XML}
 Suite Teardown    Delete All Sessions
 Test Template     Create And Remove Flow
@@ -35,7 +35,7 @@ ${eth_src}        00:ab:cd:ef:01:23
 ${eth_dst}        ff:ff:ff:ff:ff:ff
 ${node_id}        openflow:1
 ##documentation strings
-${IN_PORT_doc}    OF1.3: OFPP_IN_PORT = 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
+${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. */
@@ -45,9 +45,9 @@ ${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    verify OVS?    OVS specific strings
-IN_PORT               [Documentation]    ${IN_PORT_doc}
-                      [Tags]             in_port
-                      ${TEST_NAME}       22                   161       no             actions=${TEST_NAME}
+INPORT                [Documentation]    ${INPORT_doc}
+                      [Tags]             inport
+                      ${TEST_NAME}       22                   161       yes            actions=IN_PORT
 
 TABLE                 [Documentation]    ${TABLE_doc}
                       [Tags]             table
@@ -81,7 +81,6 @@ ANY                   [Documentation]    ${ANY_doc}
 Create And Remove Flow
     [Arguments]    ${output_port}    ${table_id}    ${flow_id}    ${verify_switch_flag}    ${additional_ovs_flowelements}
     Remove Default Flows    ${node_id}
-    Run Keyword If    "${output_port}" == "IN_PORT"    Pass Execution    Skipping ${output_port} test and marking it passed
     Run Keyword If    "${output_port}" == "ANY"    Pass Execution    Skipping ${output_port} test and marking it passed
     @{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}
@@ -89,7 +88,7 @@ Create And Remove Flow
     ${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 Flow
+    ${flow}=    Create Inventory Flow
     Set "${flow}" "table_id" With "${table_id}"
     Set "${flow}" "id" With "${flow_id}"
     Clear Flow Actions    ${flow}
diff --git a/test/csit/suites/karaf-all/070__Flows_OF13/305__ttl.txt b/test/csit/suites/karaf-all/070__Flows_OF13/305__ttl.txt
deleted file mode 100644 (file)
index 5b05b6c..0000000
+++ /dev/null
@@ -1,122 +0,0 @@
-*** 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
-${MININET_CMD}    sudo mn --controller=remote,ip=${CONTROLLER} --topo tree,1 --switch ovsk,protocols=OpenFlow13
-${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
-
-*** Test Cases ***    ODL flow action        action key                                                                                                                      action value    tableID    flowID    verify OVS?    OVS specific string?
-Set_IP_TTL            [Documentation]        OF1.3: \ OFPAT_SET_NW_TTL = 23, /* IP TTL. */\n(currently not supported on OVS)\n
-                      [Tags]                 ttl                                                                                                                             set
-                      set-nw-ttl-action      nw-ttl                                                                                                                          1               2          101       no             set_ttl
-
-Dec_TTL               [Documentation]        OF1.3: \ OFPAT_DEC_NW_TTL = 24, /* Decrement IP TTL. */\n
-                      [Tags]                 ttl                                                                                                                             dec
-                      dec-nw-ttl             none                                                                                                                            none            3          305       yes            dec_ttl
-
-Copy_TTL_In           [Documentation]        OFPAT_COPY_TTL_IN = 12, /* Copy TTL "inwards" -- from outermost to\nnext-to-outermost */\n(currently NOT supported in OVS)\n
-                      [Tags]                 ttl                                                                                                                             copyin
-                      copy-ttl-in            none                                                                                                                            none            9          202       no             copy_ttl_in
-
-Copy_TTL_Out          [Documentation]        OFPAT_COPY_TTL_OUT = 11, /* Copy TTL "outwards" -- from next-to-outermost\nto outermost */\n(currently NOT suported in OVS)
-                      [Tags]                 ttl                                                                                                                             copyout
-                      copy-ttl-out           none                                                                                                                            none            8          909       no             copy_ttl_out
-
-Set_MPLS_TTL          [Documentation]        OFPAT_SET_MPLS_TTL = 15, /* MPLS TTL */
-                      [Tags]                 ttl                                                                                                                             setmpls
-                      set-mpls-ttl-action    mpls-ttl                                                                                                                        1               4          505       yes            set_mpls_ttl
-
-Dec_MPLS_TTL          [Documentation]        OFPAT_DEC_MPLS_TTL = 16, /* Decrement MPLS TTL */
-                      [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 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}    ${flow.table_id}    ${flow.id}
-    Run Keyword If    "${verify_switch_flag}" == "yes"    Verify Flow On Switch    ${OVS_FLOWELEMENTS}
-    Remove Flow From Controller And Verify    ${flow.xml}    ${flow.table_id}    ${flow.id}
-    Run Keyword If    "${verify_switch_flag}" == "yes"    Verify Flow Does Not Exist On Switch    ${OVS_FLOWELEMENTS}
-
-Add Flow To Controller And Verify
-    [Arguments]    ${flow_body}    ${table_id}    ${flow_id}
-    [Documentation]    Push flow through REST-API and verify in data-store
-    ${resp}    Put Xml    session    ${REST_CON}/node/openflow:1/table/${table_id}/flow/${flow_id}    data=${flow_body}
-    Log    ${resp.content}
-    Should Be Equal As Strings    ${resp.status_code}    200
-    ${resp}    get    session    ${REST_CON}/node/openflow:1/table/${table_id}/flow/${flow_id}    headers=${ACCEPT_XML}
-    Log    ${resp.content}
-    Should Be Equal As Strings    ${resp.status_code}    200
-    compare xml    ${flow_body}    ${resp.content}
-
-Verify Flow On Switch
-    [Arguments]    ${flow_elements}
-    [Documentation]    Checking flow on switch
-    sleep    1
-    write    dpctl dump-flows -O OpenFlow13
-    ${switchoutput}    Read Until    >
-    : FOR    ${flowElement}    IN    @{flow_elements}
-    \    should Contain    ${switchoutput}    ${flowElement}
-
-Remove Flow From Controller And Verify
-    [Arguments]    ${flow_body}    ${table_id}    ${flow_id}
-    [Documentation]    Remove flow
-    ${resp}    Delete    session    ${REST_CON}/node/openflow:1/table/${table_id}/flow/${flow_id}
-    Log    ${resp.content}
-    Should Be Equal As Strings    ${resp.status_code}    200
-    ${resp}    Get    session    ${REST_CON}/node/openflow:1/table/${table_id}
-    Log    ${resp.content}
-    Should Not Contain    ${resp.content}    ${flow_id}
-
-Verify Flow Does Not Exist On Switch
-    [Arguments]    ${flow_elements}
-    [Documentation]    Checking flow on switch is removed
-    sleep    1
-    write    dpctl dump-flows -O OpenFlow13
-    ${switchoutput}    Read Until    >
-    : FOR    ${flowElement}    IN    @{flow_elements}
-    \    should Not Contain    ${switchoutput}    ${flowElement}
diff --git a/test/csit/suites/karaf-compatible/070__Flows_OF13/305__ttl.txt b/test/csit/suites/karaf-compatible/070__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/karaf-compatible/070__Flows_OF13/400__actions.txt b/test/csit/suites/karaf-compatible/070__Flows_OF13/400__actions.txt
new file mode 100644 (file)
index 0000000..a45c4d8
--- /dev/null
@@ -0,0 +1,100 @@
+*** 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       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
+${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
+${node_id}        openflow:1
+##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    verify OVS?    OVS specific strings
+INPORT                [Documentation]    ${INPORT_doc}
+                      [Tags]             inport
+                      ${TEST_NAME}       22                   161       yes            actions=IN_PORT
+
+TABLE                 [Documentation]    ${TABLE_doc}
+                      [Tags]             table
+                      ${TEST_NAME}       29                   261       yes            actions=${TEST_NAME}
+
+NORMAL                [Documentation]    ${NORMAL_doc}
+                      [Tags]             normal
+                      ${TEST_NAME}       13                   361       yes            actions=${TEST_NAME}
+
+FLOOD                 [Documentation]    ${FLOOD_doc}
+                      [Tags]             flood
+                      ${TEST_NAME}       47                   81        yes            actions=${TEST_NAME}
+
+ALL                   [Documentation]    ${ALL_doc}
+                      [Tags]             all
+                      ${TEST_NAME}       42                   88        yes            actions=${TEST_NAME}
+
+CONTROLLER            [Documentation]    ${CONTROLLER_doc}
+                      [Tags]             controller
+                      ${TEST_NAME}       81                   21        yes            actions=${TEST_NAME}
+
+LOCAL                 [Documentation]    ${LOCAL_doc}
+                      [Tags]             local
+                      ${TEST_NAME}       122                  32        yes            actions=${TEST_NAME}
+
+ANY                   [Documentation]    ${ANY_doc}
+                      [Tags]             any
+                      ${TEST_NAME}       222                  111       yes            actions=${TEST_NAME}
+
+*** Keywords ***
+Create And Remove Flow
+    [Arguments]    ${output_port}    ${table_id}    ${flow_id}    ${verify_switch_flag}    ${additional_ovs_flowelements}
+    Remove Default Flows    ${node_id}
+    Run Keyword If    "${output_port}" == "ANY"    Pass Execution    Skipping ${output_port} test and marking it passed
+    @{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 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}
+    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/karaf-compatible/075__Flows_OF13_Stat_Manager/010__SM_add_upd_del_flows.txt b/test/csit/suites/karaf-compatible/075__Flows_OF13_Stat_Manager/010__SM_add_upd_del_flows.txt
new file mode 100644 (file)
index 0000000..2666d05
--- /dev/null
@@ -0,0 +1,251 @@
+*** Settings ***
+Documentation     Test suite for Stats Manager flows collection
+Library        OperatingSystem
+Library        Collections
+Library        XML
+Library        ../../../libraries/XmlComparator.py
+Variables      ../../../variables/Variables.py
+Library        ../../../libraries/RequestsLibrary.py
+Library        ../../../libraries/Common.py
+Suite Setup       Initialization Phase
+Suite Teardown    Teardown Phase
+
+
+*** 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
+     Sleep  30s
+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
+     Sleep  40s
+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}
+         ${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}=   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}
+         ${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}=   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}:${PORT}   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/karaf-compatible/075__Flows_OF13_Stat_Manager/__init__.txt b/test/csit/suites/karaf-compatible/075__Flows_OF13_Stat_Manager/__init__.txt
new file mode 100644 (file)
index 0000000..e1c2c23
--- /dev/null
@@ -0,0 +1,29 @@
+*** 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
+
+*** Variables ***
+${start}          sudo mn --controller=remote,ip=${CONTROLLER} --topo tree,1 --switch ovsk,protocols=OpenFlow13
+
+*** Keywords ***
+Start Suite
+    Log    Start the test on the base edition
+    Open Connection    ${MININET}    prompt=>
+    Login With Public Key    ${MININET_USER}    ${USER_HOME}/.ssh/id_rsa    any
+    Write    sudo ovs-vsctl set-manager ptcp:6644
+    Write    sudo mn -c
+    Sleep    2
+    Write    ${start}
+    Sleep    20
+    Read
+
+Stop Suite
+    Log    Stop the test on the base edition
+    Read
+    Write    exit
+    Sleep    2
+    Read
+    Close Connection
+
diff --git a/test/csit/suites/karaf-compatible/080__Inventory_Performance/015__restconf_topology.txt b/test/csit/suites/karaf-compatible/080__Inventory_Performance/015__restconf_topology.txt
new file mode 100644 (file)
index 0000000..ef1d359
--- /dev/null
@@ -0,0 +1,34 @@
+*** 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
+       ${resp}    Get    session    ${REST_CONTEXT}   headers=${ACCEPT_XML}
+        Should Be Equal As Strings    ${resp.status_code}    200
+       ${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}
+        ${count}=    Get Element Count    ${resp.content}    xpath=node
+        Should Be Equal As Numbers     ${count}     ${numnodes}
+Get Links Count
+    [Documentation]    Checks the number of links
+        ${resp}    Get    session    ${REST_CONTEXT}   headers=${ACCEPT_XML}
+        Should Be Equal As Strings    ${resp.status_code}    200
+        ${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
+        ${count}=    Get Element Count    ${resp.content}    xpath=link
+        Should Be Equal As Numbers     ${count}     ${numlinks}
diff --git a/test/csit/suites/karaf-vtn/050__VTN/010__vtn_manager.txt b/test/csit/suites/karaf-vtn/050__VTN/010__vtn_manager.txt
new file mode 100644 (file)
index 0000000..e553504
--- /dev/null
@@ -0,0 +1,131 @@
+*** 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
+    [Tags]    add
+    Add a vtn    Tenant1    {"description": "Virtual Tenant 1 for Hackfest network"}
+
+Add a vBridge vBridge1
+    [Documentation]    Add a vBridge vBridge1 in vtn Tenant1
+    [Tags]    add
+    Add a vBridge    Tenant1    vBridge1    {}
+
+Add a interface If1
+    [Documentation]    Add a interface if1 into vBrdige vBrdige1
+    [Tags]    add
+    Add a interface    Tenant1    vBridge1    if1    {}
+
+Add a interface if2
+    [Documentation]    Add a interface if2 into vBrdige vBrdige1
+    [Tags]    add
+    Add a interface    Tenant1    vBridge1    if2    {}
+
+Add a portmap for interface if1
+    [Documentation]    Create a portmap on Interface if1 of vBridge1
+    [Tags]    add
+    ${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
+    [Tags]    add
+    Add a vBridge    Tenant1    vBridge2    {}
+
+Add a interface If3
+    [Documentation]    Add a interface if3 into vBrdige vBrdige2
+    [Tags]    add
+    Add a interface    Tenant1    vBridge2    if3    {}
+
+Add a interface if4
+    [Documentation]    Add a interface if4 into vBrdige vBrdige2
+    [Tags]    add
+    Add a interface    Tenant1    vBridge2    if4    {}
+
+Add a portmap for interface if3
+    [Documentation]    Create a portmap on Interface if3 of vBridge2
+    [Tags]    add
+    ${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
+    Sleep    5
+    Write    h1 ping -w 10 h3
+    Sleep    10
+    ${result}    Read
+    Should Contain    ${result}    64 bytes
+
+Ping h2 to h4
+    [Documentation]    Ping h2 to h4, verify no packet loss
+    Sleep    5
+    Write    h2 ping -w 10 h4
+    Sleep    10
+    ${result}    Read
+    Should Contain    ${result}    64 bytes
+
+Delete a vtn Tenant1
+    [Documentation]    Delete a vtn Tenant1
+    [Tags]    delete
+    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/karaf-vtn/050__VTN/020__vtn_coordinator.txt b/test/csit/suites/karaf-vtn/050__VTN/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/karaf-vtn/050__VTN/030__vtn_coordinator.txt b/test/csit/suites/karaf-vtn/050__VTN/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/karaf-vtn/050__VTN/040__vtn_coordinator.txt b/test/csit/suites/karaf-vtn/050__VTN/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/karaf-vtn/050__VTN/__init__.txt b/test/csit/suites/karaf-vtn/050__VTN/__init__.txt
new file mode 100644 (file)
index 0000000..c1c7716
--- /dev/null
@@ -0,0 +1,27 @@
+*** Settings ***
+Documentation     Test suite for VTN
+Suite Setup       Start Suite
+Suite Teardown    Stop Suite
+Library     SSHLibrary
+
+*** Variables ***
+${start}=  sudo mn --controller=remote,ip=${CONTROLLER} --topo tree,2
+
+*** Keywords ***
+Start Suite  
+    Log    Start mininet
+    Open Connection   ${MININET}     prompt=>
+    Login With Public Key    ${MININET_USER}   ${USER_HOME}/.ssh/id_rsa   any 
+    Write    sudo ovs-vsctl set-manager ptcp:6644
+    Write    sudo mn -c
+    Sleep    2
+    Write    ${start}
+    Sleep    30
+    Read
+Stop Suite
+    Log    Stop mininet
+    Read
+    Write    exit 
+    Sleep    6
+    Read 
+    Close Connection 
diff --git a/test/csit/suites/karaf-vtn/060__VTN_OF13/010__vtn_manager.txt b/test/csit/suites/karaf-vtn/060__VTN_OF13/010__vtn_manager.txt
new file mode 100644 (file)
index 0000000..e553504
--- /dev/null
@@ -0,0 +1,131 @@
+*** 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
+    [Tags]    add
+    Add a vtn    Tenant1    {"description": "Virtual Tenant 1 for Hackfest network"}
+
+Add a vBridge vBridge1
+    [Documentation]    Add a vBridge vBridge1 in vtn Tenant1
+    [Tags]    add
+    Add a vBridge    Tenant1    vBridge1    {}
+
+Add a interface If1
+    [Documentation]    Add a interface if1 into vBrdige vBrdige1
+    [Tags]    add
+    Add a interface    Tenant1    vBridge1    if1    {}
+
+Add a interface if2
+    [Documentation]    Add a interface if2 into vBrdige vBrdige1
+    [Tags]    add
+    Add a interface    Tenant1    vBridge1    if2    {}
+
+Add a portmap for interface if1
+    [Documentation]    Create a portmap on Interface if1 of vBridge1
+    [Tags]    add
+    ${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
+    [Tags]    add
+    Add a vBridge    Tenant1    vBridge2    {}
+
+Add a interface If3
+    [Documentation]    Add a interface if3 into vBrdige vBrdige2
+    [Tags]    add
+    Add a interface    Tenant1    vBridge2    if3    {}
+
+Add a interface if4
+    [Documentation]    Add a interface if4 into vBrdige vBrdige2
+    [Tags]    add
+    Add a interface    Tenant1    vBridge2    if4    {}
+
+Add a portmap for interface if3
+    [Documentation]    Create a portmap on Interface if3 of vBridge2
+    [Tags]    add
+    ${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
+    Sleep    5
+    Write    h1 ping -w 10 h3
+    Sleep    10
+    ${result}    Read
+    Should Contain    ${result}    64 bytes
+
+Ping h2 to h4
+    [Documentation]    Ping h2 to h4, verify no packet loss
+    Sleep    5
+    Write    h2 ping -w 10 h4
+    Sleep    10
+    ${result}    Read
+    Should Contain    ${result}    64 bytes
+
+Delete a vtn Tenant1
+    [Documentation]    Delete a vtn Tenant1
+    [Tags]    delete
+    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/karaf-vtn/060__VTN_OF13/020__vtn_coordinator.txt b/test/csit/suites/karaf-vtn/060__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/karaf-vtn/060__VTN_OF13/030__vtn_coordinator.txt b/test/csit/suites/karaf-vtn/060__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/karaf-vtn/060__VTN_OF13/040__vtn_coordinator.txt b/test/csit/suites/karaf-vtn/060__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/karaf-vtn/060__VTN_OF13/__init__.txt b/test/csit/suites/karaf-vtn/060__VTN_OF13/__init__.txt
new file mode 100644 (file)
index 0000000..59a5057
--- /dev/null
@@ -0,0 +1,27 @@
+*** Settings ***
+Documentation     Test suite for VTN
+Suite Setup       Start Suite
+Suite Teardown    Stop Suite
+Library     SSHLibrary
+
+*** Variables ***
+${start}=  sudo mn --controller=remote,ip=${CONTROLLER} --topo tree,2 --switch ovsk,protocols=OpenFlow13
+
+*** Keywords ***
+Start Suite  
+    Log    Start mininet
+    Open Connection   ${MININET}     prompt=>
+    Login With Public Key    ${MININET_USER}   ${USER_HOME}/.ssh/id_rsa   any 
+    Write    sudo ovs-vsctl set-manager ptcp:6644
+    Write    sudo mn -c
+    Sleep    2
+    Write    ${start}
+    Sleep    30
+    Read
+Stop Suite
+    Log    Stop mininet
+    Read
+    Write    exit 
+    Sleep    6
+    Read 
+    Close Connection 
index 5aa44f7ece43f55f27ae28a4dd00e6d2bffcf2ec..98b9627f8ab2127025dc2abefdce4d090b0ce3f0 100644 (file)
@@ -2,7 +2,7 @@
 <flow xmlns="urn:opendaylight:flow:inventory">
     <strict>false</strict>
     <flow-name>FooXf101</flow-name>
-    <id>256</id>
+    <id>224</id>
     <cookie_mask>255</cookie_mask>
     <cookie>101</cookie>
     <table_id>2</table_id>
index 57b7a3dc06cae3220e075d52bb4467061a88ab08..1bdd5b5b638513f6988834b7055d2b0b70ee0ed5 100644 (file)
@@ -2,7 +2,7 @@
 <flow xmlns="urn:opendaylight:flow:inventory">
     <strict>false</strict>
     <flow-name>FooXf102</flow-name>
-    <id>257</id>
+    <id>225</id>
     <cookie_mask>255</cookie_mask>
     <cookie>102</cookie>
     <table_id>2</table_id>
index e809debbaa4804b82da2f311145b02d4cec96755..d6a1ea6735928b1fef7ddc532d9a34126eed09b2 100644 (file)
@@ -2,7 +2,7 @@
 <flow xmlns="urn:opendaylight:flow:inventory">
     <strict>false</strict>
     <flow-name>FooXf103</flow-name>
-    <id>258</id>
+    <id>226</id>
     <cookie_mask>255</cookie_mask>
     <cookie>103</cookie>
     <table_id>2</table_id>
index 3fc40418d9a14da88c7ddc188c512fc71f5d4e48..1af2fcad000023cecc79d15889c31fe4842282a0 100644 (file)
@@ -2,7 +2,7 @@
 <flow xmlns="urn:opendaylight:flow:inventory">
     <strict>false</strict>
     <flow-name>FooXf104</flow-name>
-    <id>259</id>
+    <id>227</id>
     <cookie_mask>255</cookie_mask>
     <cookie>104</cookie>
     <table_id>2</table_id>
index dc1caaabed9254da6d57cc2a5b70aed4b84f0648..11894f61a26bbcaa62bb50a34b54fc8c88a20cd2 100644 (file)
@@ -2,7 +2,7 @@
 <flow xmlns="urn:opendaylight:flow:inventory">
     <strict>false</strict>
     <flow-name>FooXf105</flow-name>
-    <id>260</id>
+    <id>228</id>
     <cookie_mask>255</cookie_mask>
     <cookie>105</cookie>
     <table_id>2</table_id>
index bfd290f5a5ea33bd9f1fea0914861ae362507c7c..77c48d453c5abc5e0a3d9d8a9b26cf697714c26f 100644 (file)
@@ -2,7 +2,7 @@
 <flow xmlns="urn:opendaylight:flow:inventory">
     <strict>false</strict>
     <flow-name>FooXf106</flow-name>
-    <id>261</id>
+    <id>229</id>
     <cookie_mask>255</cookie_mask>
     <cookie>106</cookie>
     <table_id>2</table_id>
index 8f6899d00f00dd25613e578be4f37304cefcf710..0d8fc98162a79efe7a9c3229e52865190b79b20f 100644 (file)
@@ -2,7 +2,7 @@
 <flow xmlns="urn:opendaylight:flow:inventory">
     <strict>false</strict>
     <flow-name>FooXf107</flow-name>
-    <id>262</id>
+    <id>230</id>
     <cookie_mask>255</cookie_mask>
     <cookie>107</cookie>
     <table_id>2</table_id>
index 427a54676e3273e715bbd6c9ed432d702c21fc89..a3ee70030cb3cdc46c3bd95cccf00186f7c81885 100644 (file)
@@ -2,7 +2,7 @@
 <flow xmlns="urn:opendaylight:flow:inventory">
     <strict>false</strict>
     <flow-name>FooXf108</flow-name>
-    <id>263</id>
+    <id>231</id>
     <cookie_mask>255</cookie_mask>
     <cookie>108</cookie>
     <table_id>2</table_id>
index 4dc9b86f39ae64844515fb231c53d2f823f6c89d..392be09fe33d93c27ae71f857a1d28f9bead8dce 100644 (file)
@@ -2,7 +2,7 @@
 <flow xmlns="urn:opendaylight:flow:inventory">
     <strict>false</strict>
     <flow-name>FooXf109</flow-name>
-    <id>264</id>
+    <id>232</id>
     <cookie_mask>255</cookie_mask>
     <cookie>109</cookie>
     <table_id>2</table_id>
index 2da1f8e24dd56de0b8b7edb40af1d548004e0893..f71707a30dbaad8ebfd2fe725bef1337429a91a4 100644 (file)
@@ -2,7 +2,7 @@
 <flow xmlns="urn:opendaylight:flow:inventory">
     <strict>false</strict>
     <flow-name>push-vlan-action</flow-name>
-    <id>256</id>
+    <id>233</id>
     <cookie_mask>255</cookie_mask>
     <cookie>201</cookie>
     <table_id>2</table_id>
index 405eb173bb76d7f6522df5ea896775233bbfa566..34eea91edbc7e309a18f55df48642d35ae6906d2 100644 (file)
@@ -13,7 +13,7 @@
         </instruction>
     </instructions>
     <table_id>2</table_id>
-    <id>152</id>
+    <id>234</id>
     <cookie_mask>10</cookie_mask>
     <installHw>false</installHw>
     <out_group>2</out_group>
index 5b33737b209a94d7f44b2d7c28d8575495e4f1df..410dbcb7aa843527dea881334b2f59c553014f7c 100644 (file)
@@ -2,7 +2,7 @@
 <flow xmlns="urn:opendaylight:flow:inventory">
     <strict>false</strict>
     <flow-name>set-mpls-ttl-action</flow-name>
-    <id>256</id>
+    <id>235</id>
     <cookie_mask>255</cookie_mask>
     <cookie>101</cookie>
     <table_id>2</table_id>
index 0dc120b98a7817a7a80c6d397d28469824a6a5aa..474200095fd171da2b30859dd6fe3232487d9f06 100644 (file)
@@ -2,7 +2,7 @@
 <flow xmlns="urn:opendaylight:flow:inventory">
     <strict>false</strict>
     <flow-name>push-mpls-action</flow-name>
-    <id>263</id>
+    <id>236</id>
     <cookie_mask>255</cookie_mask>
     <cookie>401</cookie>
     <table_id>2</table_id>
index a3d1df27f768b7cb85822bda24cd12231d6fca85..30a1675bba768848fb447537d16e132e655c1db5 100644 (file)
@@ -2,7 +2,7 @@
 <flow xmlns="urn:opendaylight:flow:inventory">
     <strict>false</strict>
     <flow-name>pop-mpls-action</flow-name>
-    <id>263</id>
+    <id>237</id>
     <cookie_mask>255</cookie_mask>
     <cookie>889</cookie>
     <table_id>2</table_id>
index b79244736d15fcde708496d39545f85785d49fd1..ad38fc18fa053b21076e520ae377f646e1ee744e 100644 (file)
@@ -2,7 +2,7 @@
 <flow xmlns="urn:opendaylight:flow:inventory">
     <strict>false</strict>
     <flow-name>set-field-tcp-src</flow-name>
-    <id>256</id>
+    <id>324</id>
     <cookie_mask>255</cookie_mask>
     <cookie>101</cookie>
     <table_id>2</table_id>
index 1ddaf579f524244cf6c06b4354c563e02741a4f2..7ab2be7754b6d49faa980d7d0cb9e31a65b2ff4f 100644 (file)
@@ -2,7 +2,7 @@
 <flow xmlns="urn:opendaylight:flow:inventory">
     <strict>false</strict>
     <flow-name>set-field-tcp-dst</flow-name>
-    <id>256</id>
+    <id>325</id>
     <cookie_mask>255</cookie_mask>
     <cookie>101</cookie>
     <table_id>2</table_id>
index 37032e60e6529e971ca675cc02b26960f7fe01bf..c143d2f850fe1e12732deb7935cdb1fc7efaab67 100644 (file)
@@ -2,7 +2,7 @@
 <flow xmlns="urn:opendaylight:flow:inventory">
     <strict>false</strict>
     <flow-name>set-field-udp-src</flow-name>
-    <id>256</id>
+    <id>326</id>
     <cookie_mask>255</cookie_mask>
     <cookie>101</cookie>
     <table_id>2</table_id>
index 1c9a718daea38e78986272837be00b63f6dbdc50..6204dbb166d98f8196641118b02226421581294e 100644 (file)
@@ -2,7 +2,7 @@
 <flow xmlns="urn:opendaylight:flow:inventory">
     <strict>false</strict>
     <flow-name>set-field-udp-dst</flow-name>
-    <id>256</id>
+    <id>327</id>
     <cookie_mask>255</cookie_mask>
     <cookie>101</cookie>
     <table_id>2</table_id>
index 2cc249c5c8ee696ba4af05f1799a7650d8c47b53..fbc519ec6056d2b1910b5d43b2e6b3fadafa9424 100644 (file)
@@ -15,7 +15,7 @@
         </instruction>
     </instructions>
     <table_id>2</table_id>
-    <id>133</id>
+    <id>328</id>
     <cookie_mask>255</cookie_mask>
     <match>
         <ethernet-match>
index 5b6a0543cad491d2f6aef29b0412b59db52990ac..25068e7dc3be18a50d0df3f00fd8d1a1a8221029 100644 (file)
@@ -15,7 +15,7 @@
         </instruction>
     </instructions>
     <table_id>2</table_id>
-    <id>133</id>
+    <id>329</id>
     <cookie_mask>255</cookie_mask>
     <match>
         <ethernet-match>
index a8efda6c025f09f34cbdbe6f32a8f57b210623a2..a5b48c5ab4c4f26717a54dcba92305c75f076c73 100644 (file)
@@ -2,7 +2,7 @@
 <flow xmlns="urn:opendaylight:flow:inventory">
     <strict>false</strict>
     <flow-name>set-field-ipv6-source-addr</flow-name>
-    <id>256</id>
+    <id>330</id>
     <cookie_mask>255</cookie_mask>
     <cookie>101</cookie>
     <table_id>2</table_id>
index 0ed364899b5f0c8f0b3a46e8b416c25ded746a0e..72b8bf4da468a6527090c4134fcd28c262e2a87d 100644 (file)
@@ -2,7 +2,7 @@
 <flow xmlns="urn:opendaylight:flow:inventory">
     <strict>false</strict>
     <flow-name>set-field-ipv6-dest-addr</flow-name>
-    <id>256</id>
+    <id>331</id>
     <cookie_mask>255</cookie_mask>
     <cookie>101</cookie>
     <table_id>2</table_id>
index 617d33ba5893715fb53554a1d87e4088930e3390..05f5fba34b624d62ea699a594c30ec7bfec3a974 100644 (file)
@@ -2,7 +2,7 @@
 <flow xmlns="urn:opendaylight:flow:inventory">
     <strict>false</strict>
     <flow-name>set-field-tunnel-id</flow-name>
-    <id>256</id>
+    <id>332</id>
     <cookie_mask>255</cookie_mask>
     <cookie>101</cookie>
     <table_id>2</table_id>
index fcd469080216f7fb6147c71291c76398c43a3c91..702c6f0e79d05daa298c0959b632092687ed0c3d 100644 (file)
@@ -2,7 +2,7 @@
 <flow xmlns="urn:opendaylight:flow:inventory">
     <strict>false</strict>
     <flow-name>set-field-ipv4-dst</flow-name>
-    <id>256</id>
+    <id>333</id>
     <cookie_mask>255</cookie_mask>
     <cookie>101</cookie>
     <table_id>2</table_id>
index 6d6072e966b770fbf7d95b23c1105410054b1adf..0d5fe35b966b205eed3820f14fa1b361c7783814 100644 (file)
@@ -2,7 +2,7 @@
 <flow xmlns="urn:opendaylight:flow:inventory">
     <strict>false</strict>
     <flow-name>set-field-ipv4-src</flow-name>
-    <id>256</id>
+    <id>334</id>
     <cookie_mask>255</cookie_mask>
     <cookie>101</cookie>
     <table_id>2</table_id>
index 4e109e84927eae275f35dde9c8c2a662844e9c7f..4144719959519da2e24216050cee3a8a2f3be231 100644 (file)
@@ -2,7 +2,7 @@
 <flow xmlns="urn:opendaylight:flow:inventory">
     <strict>false</strict>
     <flow-name>set-field-ip-protocol</flow-name>
-    <id>256</id>
+    <id>335</id>
     <cookie_mask>255</cookie_mask>
     <cookie>101</cookie>
     <table_id>2</table_id>
index cfebfd547e5ee5ddb53a1ea795264bbf990b4898..968aedeb572cffedb84342cadcfa8d5a81e8ba28 100644 (file)
@@ -2,7 +2,7 @@
 <flow xmlns="urn:opendaylight:flow:inventory">
     <strict>false</strict>
     <flow-name>set-field-ip-dscp</flow-name>
-    <id>256</id>
+    <id>336</id>
     <cookie_mask>255</cookie_mask>
     <cookie>101</cookie>
     <table_id>2</table_id>
index 2d14b77b17645b8bb730920c456aa0a3117736e6..25a524d1c42b10725a1d8a3e7601ede5b2dfa4f6 100644 (file)
@@ -2,7 +2,7 @@
 <flow xmlns="urn:opendaylight:flow:inventory">
     <strict>false</strict>
     <flow-name>set-field-ip-ecn</flow-name>
-    <id>256</id>
+    <id>337</id>
     <cookie_mask>255</cookie_mask>
     <cookie>101</cookie>
     <table_id>2</table_id>
index 67abb02617a23089bd83c88a61e39fb5bddf27e3..c03c3a398b784f918c0a14571e2a2814e39b3e73 100644 (file)
@@ -16,7 +16,7 @@
         </instruction>
     </instructions>
     <table_id>2</table_id>
-    <id>172</id>
+    <id>338</id>
     <cookie_mask>10</cookie_mask>
     <out_port>10</out_port>
     <installHw>false</installHw>
index fa95c3da70c1b1bde034f6b51a0a841541b518a2..2ca734410fab74b3ac3ff68a0aa86346af3d9197 100644 (file)
@@ -14,7 +14,7 @@
         </instruction>
     </instructions>
     <table_id>2</table_id>
-    <id>172</id>
+    <id>339</id>
     <cookie_mask>10</cookie_mask>
     <out_port>10</out_port>
     <installHw>false</installHw>
index 8ecfb2fcf3157023a89395732f4a18944c965dc1..3cfc3b772a56104a79a63e8a18753c4c5a4c8a31 100644 (file)
@@ -11,7 +11,7 @@
         </instruction>
     </instructions>
     <table_id>2</table_id>
-    <id>172</id>
+    <id>340</id>
     <cookie_mask>10</cookie_mask>
     <out_port>10</out_port>
     <installHw>false</installHw>
index cbdc4025591c81f56cb1cce5750d1a15e1e4d187..f7d0dd5baa20b4ea46cfb86880f1672128f04781 100644 (file)
@@ -10,7 +10,7 @@
         </instruction>
     </instructions>
     <table_id>2</table_id>
-    <id>171</id>
+    <id>341</id>
     <cookie_mask>10</cookie_mask>
     <out_port>10</out_port>
     <installHw>false</installHw>
index 9f89d82ca42e3b40b9cc5068f58db9ce74f38a6b..068865db7f9d00784e3c6780fa6a08c59d6ea05c 100644 (file)
@@ -16,7 +16,7 @@
        </instruction>
     </instructions>
     <table_id>2</table_id>
-    <id>172</id>
+    <id>342</id>
     <cookie_mask>10</cookie_mask>
     <out_port>10</out_port>
     <installHw>false</installHw>
index 45887ae004b2c6bfefcebc571b7081a30b3ec9a2..59b0a664f9a7c209b33707bcb1c76d2c6c82cb1a 100644 (file)
@@ -11,7 +11,7 @@
         </instruction>
     </instructions>
     <table_id>2</table_id>
-    <id>150</id>
+    <id>343</id>
     <cookie_mask>10</cookie_mask>
     <out_port>10</out_port>
     <installHw>false</installHw>
index 1a5035db1e893c8802e04f5e91a015416c5a8130..caf8e96b6ecb2455328225719b703ab6b4ba4ce9 100644 (file)
@@ -25,7 +25,7 @@
         </instruction>
     </instructions>
     <table_id>2</table_id>
-    <id>172</id>
+    <id>344</id>
     <cookie_mask>10</cookie_mask>
     <out_port>10</out_port>
     <installHw>false</installHw>
diff --git a/test/tools/OF_Test/robot_suites/998__Independent_OF_Tests_ovs/010__Connect_256_Switches.txt b/test/tools/OF_Test/robot_suites/998__Independent_OF_Tests_ovs/010__Connect_256_Switches.txt
new file mode 100644 (file)
index 0000000..068ae68
--- /dev/null
@@ -0,0 +1,41 @@
+*** Settings ***
+Documentation     Test suite with connection of multiple switches
+Library        OperatingSystem
+Library        Collections
+Library        XML
+Library        SSHLibrary
+Variables      ../../../../csit/variables/Variables.py
+Library        ../../../../csit/libraries/RequestsLibrary.py
+Library        ../../../../csit/libraries/Common.py
+
+*** Test Cases ***
+Are 256 Switches Connected
+      [Setup]      Start Mininet   256
+      [Teardown]   Stop Mininet
+      [Documentation]   Checks wheather switches are connected to controller
+      ${resp}=   Get   session     /restconf/operational/network-topology:network-topology/topology/flow:1    headers=${ACCEPT_XML}
+      Log    ${resp.content}
+      ${count}=   Get Element Count   ${resp.content}   xpath=node
+      Should Be Equal As Numbers    ${count}    256
+
+*** Keywords ***
+Start Mininet   [Arguments]   ${swnr}
+      [Documentation]    Starts mininet with requested number of switches (${swnr})
+      Log    Starting mininet with ${swnr} switches
+      Open Connection   ${MININET}   prompt=>     timeout=600
+      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    sudo mn --controller=remote,ip=${CONTROLLER} --topo linear,${swnr} --switch ovsk,protocols=OpenFlow13
+      Read Until   mininet>
+      Sleep     3s
+      Create Session   session   http://${CONTROLLER}:${PORT}   auth=${AUTH}   headers=${HEADERS_XML}
+Stop Mininet
+    [Documentation]    Stops mininet 
+    Log    Stopping mininet
+    Delete All Sessions
+    Read
+    Write   exit
+    Read Until    >
+    Close Connection