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
priority = 0
barrier = "false"
- xml = xml_skeleton
+ xml = ""
json = ""
'''
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):
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}"
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
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
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}
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:
TAGS_TO_MODIFY_FOR_OC = [(['flow', 'match','metadata'], 'metadata', 'metadata-mask'),
+ (['flow', 'match','tunnel'], 'tunnel-id', 'tunnel-mask'),
]
class XmlComparator:
${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}
... - 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
${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. */
${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
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}
${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}
+++ /dev/null
-*** 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}
--- /dev/null
+*** 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}
--- /dev/null
+*** 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}
--- /dev/null
+*** 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}
--- /dev/null
+*** 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
+
--- /dev/null
+*** 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}
--- /dev/null
+*** 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
--- /dev/null
+*** 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
--- /dev/null
+
+*** 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
--- /dev/null
+*** 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
--- /dev/null
+*** 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
--- /dev/null
+*** 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
--- /dev/null
+*** 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
--- /dev/null
+
+*** 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
--- /dev/null
+*** 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
--- /dev/null
+*** 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
<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>
<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>
<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>
<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>
<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>
<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>
<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>
<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>
<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>
<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>
</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>
<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>
<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>
<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>
<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>
<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>
<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>
<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>
</instruction>
</instructions>
<table_id>2</table_id>
- <id>133</id>
+ <id>328</id>
<cookie_mask>255</cookie_mask>
<match>
<ethernet-match>
</instruction>
</instructions>
<table_id>2</table_id>
- <id>133</id>
+ <id>329</id>
<cookie_mask>255</cookie_mask>
<match>
<ethernet-match>
<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>
<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>
<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>
<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>
<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>
<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>
<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>
<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>
</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>
</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>
</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>
</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>
</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>
</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>
</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>
--- /dev/null
+*** 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