Create testcases in FUNCflow for testing OF1.3 features

Change-Id: I056528a26c3fbeb7e69179c6b77976f22bd05028
diff --git a/TestON/tests/FUNC/FUNCflow/FUNCflow.py b/TestON/tests/FUNC/FUNCflow/FUNCflow.py
index eeed451..80bd618 100644
--- a/TestON/tests/FUNC/FUNCflow/FUNCflow.py
+++ b/TestON/tests/FUNC/FUNCflow/FUNCflow.py
@@ -4,7 +4,6 @@
         self.default = ''
 
     def CASE1( self, main ):
-        import time
         import os
         import imp
 
@@ -20,7 +19,6 @@
 
         main.case( "Constructing test variables and building ONOS package" )
         main.step( "Constructing test variables" )
-        stepResult = main.FALSE
 
         # Test variables
         main.testOnDirectory = os.path.dirname( os.getcwd ( ) )
@@ -39,15 +37,15 @@
         main.startMNSleep = int( main.params[ 'SLEEP' ][ 'startMN' ] )
         main.addFlowSleep = int( main.params[ 'SLEEP' ][ 'addFlow' ] )
         main.delFlowSleep = int( main.params[ 'SLEEP' ][ 'delFlow' ] )
-        main.debug = main.params['DEBUG']
+        main.debug = main.params[ 'DEBUG' ]
         main.swDPID = main.params[ 'TEST' ][ 'swDPID' ]
-        main.cellData = {} # for creating cell file
-        main.CLIs = []
-        main.ONOSip = []
+        main.cellData = { } # for creating cell file
+        main.CLIs = [ ]
+        main.ONOSip = [ ]
 
         main.debug = True if "on" in main.debug else False
 
-        main.ONOSip = main.ONOSbench.getOnosIps()
+        main.ONOSip = main.ONOSbench.getOnosIps( )
 
         # Assigning ONOS cli handles to a list
         for i in range( 1,  main.maxNodes + 1 ):
@@ -66,10 +64,16 @@
 
 
         copyResult = main.ONOSbench.scp( main.Mininet1,
-                                         main.dependencyPath+main.topology,
-                                         main.Mininet1.home+'/custom/',
+                                         main.dependencyPath + main.topology,
+                                         main.Mininet1.home + '/custom/',
                                          direction="to" )
 
+        utilities.assert_equals( expect=main.TRUE,
+                                actual=copyResult,
+                                onpass="Successfully copy " + "test variables ",
+                                onfail="Failed to copy test variables" )
+
+
         if main.CLIs:
             stepResult = main.TRUE
         else:
@@ -78,8 +82,7 @@
 
         utilities.assert_equals( expect=main.TRUE,
                                  actual=stepResult,
-                                 onpass="Successfully construct " +
-                                        "test variables ",
+                                 onpass="Successfully construct " + "test variables ",
                                  onfail="Failed to construct test variables" )
 
         if gitPull == 'True':
@@ -88,10 +91,8 @@
             stepResult = onosBuildResult
             utilities.assert_equals( expect=main.TRUE,
                                      actual=stepResult,
-                                     onpass="Successfully compiled " +
-                                            "latest ONOS",
-                                     onfail="Failed to compile " +
-                                            "latest ONOS" )
+                                     onpass="Successfully compiled " + "latest ONOS",
+                                     onfail="Failed to compile " + "latest ONOS" )
         else:
             main.log.warn( "Did not pull new code so skipping mvn " +
                            "clean install" )
@@ -108,6 +109,7 @@
         - Install ONOS cluster
         - Connect to cli
         """
+        import time
 
         main.numCtrls = int( main.maxNodes )
 
@@ -123,9 +125,9 @@
 
         main.log.info( "NODE COUNT = " + str( main.numCtrls ) )
 
-        tempOnosIp = []
+        tempOnosIp = [ ]
         for i in range( main.numCtrls ):
-            tempOnosIp.append( main.ONOSip[i] )
+            tempOnosIp.append( main.ONOSip[ i ] )
 
         main.ONOSbench.createCellFile( main.ONOSbench.ip_address,
                                        "temp",
@@ -135,16 +137,15 @@
 
         main.step( "Apply cell to environment" )
         cellResult = main.ONOSbench.setCell( "temp" )
-        verifyResult = main.ONOSbench.verifyCell()
+        verifyResult = main.ONOSbench.verifyCell( )
         stepResult = cellResult and verifyResult
         utilities.assert_equals( expect=main.TRUE,
                                  actual=stepResult,
-                                 onpass="Successfully applied cell to " + \
-                                        "environment",
+                                 onpass="Successfully applied cell to " + "environment",
                                  onfail="Failed to apply cell to environment " )
 
         main.step( "Creating ONOS package" )
-        packageResult = main.ONOSbench.onosPackage()
+        packageResult = main.ONOSbench.onosPackage( )
         stepResult = packageResult
         utilities.assert_equals( expect=main.TRUE,
                                  actual=stepResult,
@@ -156,7 +157,7 @@
         onosUninstallResult = main.TRUE
         for ip in main.ONOSip:
             onosUninstallResult = onosUninstallResult and \
-                    main.ONOSbench.onosUninstall( nodeIp=ip )
+                    main.ONOSbench.onosUninstall( nodeIp = ip )
         stepResult = onosUninstallResult
         utilities.assert_equals( expect=main.TRUE,
                                  actual=stepResult,
@@ -167,7 +168,7 @@
         onosInstallResult = main.TRUE
         for i in range( main.numCtrls ):
             onosInstallResult = onosInstallResult and \
-                    main.ONOSbench.onosInstall( node=main.ONOSip[ i ] )
+                    main.ONOSbench.onosInstall( node = main.ONOSip[ i ] )
         stepResult = onosInstallResult
         utilities.assert_equals( expect=main.TRUE,
                                  actual=stepResult,
@@ -222,7 +223,7 @@
 
         main.step( "Setup Mininet Topology" )
         topology = main.Mininet1.home + '/custom/' + main.topology
-        stepResult = main.Mininet1.startNet( topoFile=topology )
+        stepResult = main.Mininet1.startNet( topoFile = topology )
 
         utilities.assert_equals( expect=main.TRUE,
                                  actual=stepResult,
@@ -241,18 +242,14 @@
 
         main.step( "Comparing MN topology to ONOS topology" )
         main.log.info( "Gathering topology information" )
-        devicesResults = main.TRUE
-        linksResults = main.TRUE
-        hostsResults = main.TRUE
         devices = main.topo.getAllDevices( main )
         hosts = main.topo.getAllHosts( main )
         ports = main.topo.getAllPorts( main )
         links = main.topo.getAllLinks( main )
-        clusters = main.topo.getAllClusters( main )
 
-        mnSwitches = main.Mininet1.getSwitches()
-        mnLinks = main.Mininet1.getLinks()
-        mnHosts = main.Mininet1.getHosts()
+        mnSwitches = main.Mininet1.getSwitches( )
+        mnLinks = main.Mininet1.getLinks( )
+        mnHosts = main.Mininet1.getHosts( )
 
         for controller in range( main.numCtrls ):
             controllerStr = str( controller + 1 )
@@ -307,32 +304,32 @@
         main.step( "Creating Host1 component" )
         main.Scapy.createHostComponent( "h1" )
         main.Scapy.createHostComponent( "h2" )
-        hosts = [main.h1, main.h2]
+        hosts = [ main.h1, main.h2 ]
         for host in hosts:
-            host.startHostCli()
-            host.startScapy()
-            host.updateSelf()
+            host.startHostCli( )
+            host.startScapy( )
+            host.updateSelf( )
             main.log.debug( host.name )
             main.log.debug( host.hostIp )
             main.log.debug( host.hostMac )
 
         main.step( "Sending/Receiving Test packet - Filter doesn't match" )
         main.log.info( "Starting Filter..." )
-        main.h2.startFilter()
+        main.h2.startFilter( )
         main.log.info( "Building Ether frame..." )
         main.h1.buildEther( dst=main.h2.hostMac )
         main.log.info( "Sending Packet..." )
         main.h1.sendPacket( )
         main.log.info( "Checking Filter..." )
-        finished = main.h2.checkFilter()
+        finished = main.h2.checkFilter( )
         main.log.debug( finished )
         i = ""
         if finished:
-            a = main.h2.readPackets()
-            for i in a.splitlines():
+            a = main.h2.readPackets( )
+            for i in a.splitlines( ):
                 main.log.info( i )
         else:
-            kill = main.h2.killFilter()
+            kill = main.h2.killFilter( )
             main.log.debug( kill )
             main.h2.handle.sendline( "" )
             main.h2.handle.expect( main.h2.scapyPrompt )
@@ -343,18 +340,18 @@
                                  onfail="Fail" )
 
         main.step( "Sending/Receiving Test packet - Filter matches" )
-        main.h2.startFilter()
+        main.h2.startFilter( )
         main.h1.buildEther( dst=main.h2.hostMac )
         main.h1.buildIP( dst=main.h2.hostIp )
         main.h1.sendPacket( )
-        finished = main.h2.checkFilter()
+        finished = main.h2.checkFilter( )
         i = ""
         if finished:
-            a = main.h2.readPackets()
-            for i in a.splitlines():
+            a = main.h2.readPackets( )
+            for i in a.splitlines( ):
                 main.log.info( i )
         else:
-            kill = main.h2.killFilter()
+            kill = main.h2.killFilter( )
             main.log.debug( kill )
             main.h2.handle.sendline( "" )
             main.h2.handle.expect( main.h2.scapyPrompt )
@@ -368,9 +365,9 @@
 
         main.step( "Clean up host components" )
         for host in hosts:
-            host.stopScapy()
-        main.Mininet1.removeHostComponent("h1")
-        main.Mininet1.removeHostComponent("h2")
+            host.stopScapy( )
+        main.Mininet1.removeHostComponent( "h1" )
+        main.Mininet1.removeHostComponent( "h2" )
 
     def CASE1000( self, main ):
         '''
@@ -389,12 +386,11 @@
         main.log.info( "Creating host components" )
         main.Scapy.createHostComponent( "h1" )
         main.Scapy.createHostComponent( "h2" )
-        hosts = [main.h1, main.h2]
-        stepResult = main.TRUE
+        hosts = [ main.h1, main.h2 ]
         for host in hosts:
-            host.startHostCli()
-            host.startScapy()
-            host.updateSelf()
+            host.startHostCli( )
+            host.startScapy( )
+            host.updateSelf( )
 
         # Add a flow that connects host1 on port1 to host2 on port2
         # send output on port2
@@ -424,21 +420,21 @@
 
         main.log.info( "Get the flows from ONOS" )
         try:
-            flows = json.loads( main.ONOSrest.flows() )
+            flows = json.loads( main.ONOSrest.flows( ) )
 
             stepResult = main.TRUE
             for f in flows:
-                if "rest" in f.get("appId"):
-                    if "ADDED" not in f.get("state"):
+                if "rest" in f.get( "appId" ):
+                    if "ADDED" not in f.get( "state" ):
                         stepResult = main.FALSE
-                        main.log.error( "Flow: %s in state: %s" % (f.get("id"), f.get("state")) )
+                        main.log.error( "Flow: %s in state: %s" % ( f.get( "id" ), f.get( "state" ) ) )
         except TypeError:
             main.log.error( "No Flows found by the REST API" )
             stepResult = main.FALSE
         except ValueError:
             main.log.error( "Problem getting Flows state from REST API.  Exiting test" )
-            main.cleanup()
-            main.exit()
+            main.cleanup( )
+            main.exit( )
 
         utilities.assert_equals( expect=main.TRUE,
                                  actual=stepResult,
@@ -449,10 +445,10 @@
 
         # get the flow IDs that were added through rest
         main.log.info( "Getting the flow IDs from ONOS" )
-        flowIds = [ f.get("id") for f in flows if "rest" in f.get("appId") ]
+        flowIds = [ f.get( "id" ) for f in flows if "rest" in f.get( "appId" ) ]
         # convert the flowIDs to ints then hex and finally back to strings
-        flowIds = [str(hex(int(x))) for x in flowIds]
-        main.log.info( "ONOS flow IDs: {}".format(flowIds) )
+        flowIds = [ str( hex( int( x ) ) ) for x in flowIds ]
+        main.log.info( "ONOS flow IDs: {}".format( flowIds ) )
 
         stepResult = main.Mininet1.checkFlowId( "s1", flowIds, debug=False )
 
@@ -472,29 +468,30 @@
         # NOTE: I believe it doesn't matter which host name it is,
         # as long as the src and dst are both specified
         main.log.info( "Starting filter on host2" )
-        main.h2.startFilter( pktFilter="ether host %s" % main.h1.hostMac)
+        main.h2.startFilter( pktFilter="ether host %s" % main.h1.hostMac )
 
         main.log.info( "Sending packet to host2" )
         main.h1.sendPacket()
 
         main.log.info( "Checking filter for our packet" )
-        stepResult = main.h2.checkFilter()
+        stepResult = main.h2.checkFilter( )
         if stepResult:
-            main.log.info( "Packet: %s" % main.h2.readPackets() )
-        else: main.h2.killFilter()
+            main.log.info( "Packet: %s" % main.h2.readPackets( ) )
+        else:
+            main.h2.killFilter( )
 
         main.log.info( "Clean up host components" )
         for host in hosts:
-            host.stopScapy()
-        main.Mininet1.removeHostComponent("h1")
-        main.Mininet1.removeHostComponent("h2")
+            host.stopScapy( )
+        main.Mininet1.removeHostComponent( "h1" )
+        main.Mininet1.removeHostComponent( "h2" )
 
         utilities.assert_equals( expect=main.TRUE,
                                  actual=stepResult,
                                  onpass="Successfully sent a packet",
                                  onfail="Failed to send a packet" )
 
-    def CASE1100( self, main ):
+    def CASE1400( self, main ):
         '''
             Add flows with IPv4 selectors and verify the flows
         '''
@@ -503,7 +500,7 @@
 
         main.case( "Verify flow IP selectors are correctly compiled" )
         main.caseExplanation = "Install two flows with only IP selectors " +\
-                "specified, then verify flows are added in ONOS, finally "+\
+                "specified, then verify flows are added in ONOS, finally " +\
                 "send a packet that only specifies the IP src and dst."
 
         main.step( "Add flows with IPv4 addresses as the only selectors" )
@@ -511,12 +508,11 @@
         main.log.info( "Creating host components" )
         main.Scapy.createHostComponent( "h1" )
         main.Scapy.createHostComponent( "h2" )
-        hosts = [main.h1, main.h2]
-        stepResult = main.TRUE
+        hosts = [ main.h1, main.h2 ]
         for host in hosts:
-            host.startHostCli()
-            host.startScapy()
-            host.updateSelf()
+            host.startHostCli( )
+            host.startScapy( )
+            host.updateSelf( )
 
         # Add a flow that connects host1 on port1 to host2 on port2
         # send output on port2
@@ -524,16 +520,16 @@
         egress = 2
         ingress = 1
         # IPv4 etherType = 0x800
-        IPv4=2048
+        ethType = main.params[ 'TEST' ][ 'ip4Type' ]
 
         # Add flows that connects host1 to host2
         main.log.info( "Add flow with port ingress 1 to port egress 2" )
         stepResult = main.ONOSrest.addFlow( deviceId=main.swDPID,
                                             egressPort=egress,
                                             ingressPort=ingress,
-                                            ethType=IPv4,
-                                            ipSrc=("IPV4_SRC", main.h1.hostIp+"/32"),
-                                            ipDst=("IPV4_DST", main.h2.hostIp+"/32"),
+                                            ethType=ethType,
+                                            ipSrc=( "IPV4_SRC", main.h1.hostIp+"/32" ),
+                                            ipDst=( "IPV4_DST", main.h2.hostIp+"/32" ),
                                             debug=main.debug )
 
         utilities.assert_equals( expect=main.TRUE,
@@ -548,21 +544,21 @@
 
         main.log.info( "Get the flows from ONOS" )
         try:
-            flows = json.loads( main.ONOSrest.flows() )
+            flows = json.loads( main.ONOSrest.flows( ) )
 
             stepResult = main.TRUE
             for f in flows:
-                if "rest" in f.get("appId"):
-                    if "ADDED" not in f.get("state"):
+                if "rest" in f.get( "appId" ):
+                    if "ADDED" not in f.get( "state" ):
                         stepResult = main.FALSE
-                        main.log.error( "Flow: %s in state: %s" % (f.get("id"), f.get("state")) )
+                        main.log.error( "Flow: %s in state: %s" % ( f.get( "id" ), f.get( "state" ) ) )
         except TypeError:
             main.log.error( "No Flows found by the REST API" )
             stepResult = main.FALSE
         except ValueError:
             main.log.error( "Problem getting Flows state from REST API.  Exiting test" )
-            main.cleanup()
-            main.exit()
+            main.cleanup( )
+            main.exit( )
 
         utilities.assert_equals( expect=main.TRUE,
                                  actual=stepResult,
@@ -573,10 +569,10 @@
 
         # get the flow IDs that were added through rest
         main.log.info( "Getting the flow IDs from ONOS" )
-        flowIds = [ f.get("id") for f in flows if "rest" in f.get("appId") ]
+        flowIds = [ f.get( "id" ) for f in flows if "rest" in f.get( "appId" ) ]
         # convert the flowIDs to ints then hex and finally back to strings
-        flowIds = [str(hex(int(x))) for x in flowIds]
-        main.log.info( "ONOS flow IDs: {}".format(flowIds) )
+        flowIds = [ str( hex( int( x ) ) ) for x in flowIds ]
+        main.log.info( "ONOS flow IDs: {}".format( flowIds ) )
 
         stepResult = main.Mininet1.checkFlowId( "s1", flowIds, debug=False )
 
@@ -594,29 +590,151 @@
 
         main.log.info( "Starting filter on host2" )
         # Defaults to ip
-        main.h2.startFilter()
+        main.h2.startFilter( )
 
         main.log.info( "Sending packet to host2" )
-        main.h1.sendPacket()
+        main.h1.sendPacket( )
 
         main.log.info( "Checking filter for our packet" )
-        stepResult = main.h2.checkFilter()
+        stepResult = main.h2.checkFilter( )
         if stepResult:
-            main.log.info( "Packet: %s" % main.h2.readPackets() )
-        else: main.h2.killFilter()
+            main.log.info( "Packet: %s" % main.h2.readPackets( ) )
+        else: main.h2.killFilter( )
 
         main.log.info( "Clean up host components" )
         for host in hosts:
-            host.stopScapy()
-        main.Mininet1.removeHostComponent("h1")
-        main.Mininet1.removeHostComponent("h2")
+            host.stopScapy( )
+        main.Mininet1.removeHostComponent( "h1" )
+        main.Mininet1.removeHostComponent( "h2" )
 
         utilities.assert_equals( expect=main.TRUE,
                                  actual=stepResult,
                                  onpass="Successfully sent a packet",
                                  onfail="Failed to send a packet" )
 
-    def CASE1200( self, main ):
+    def CASE1500 (self, main ):
+        """
+        Add flow with IPv6 selector and verify the flow
+        """
+        import json
+        import time
+        main.case( "Verify IPv6 selector is correctly compiled" )
+        main.caseExplanation = "Install two flows with only IP selectors " + \
+                               "specified, then verify flows are added in ONOS, finally " + \
+                               "send a packet that only specifies the IP src and dst."
+
+        main.step( "Add flows with IPv6 addresses as the only selectors" )
+
+        main.log.info( "Creating host components" )
+        main.Scapy.createHostComponent( "h5" )
+        main.Scapy.createHostComponent( "h6" )
+        hosts = [ main.h5, main.h6 ]
+
+        for host in hosts:
+            host.startHostCli( )
+            host.startScapy( )
+            host.updateSelf( IPv6=True )
+
+        # Add a flow that connects host1 on port1 to host2 on port2
+        # send output on port2
+        # recieve input on port1
+        egress = 6
+        ingress = 5
+        # IPv6 etherType = 0x86DD
+        ethType = main.params[ 'TEST' ][ 'ip6Type' ]
+
+        # Add flows that connects host1 to host2
+        main.log.info( "Add flow with port ingress 5 to port egress 6" )
+        stepResult = main.ONOSrest.addFlow( deviceId=main.swDPID,
+                                            egressPort=egress,
+                                            ingressPort=ingress,
+                                            ethType=ethType,
+                                            ipSrc=( "IPV6_SRC", main.h5.hostIp + "/128" ),
+                                            ipDst=( "IPV6_DST", main.h6.hostIp + "/128" ),
+                                            debug=main.debug )
+
+        utilities.assert_equals( expect=main.TRUE,
+                                 actual=stepResult,
+                                 onpass="Successfully added flows",
+                                 onfail="Failed add flows" )
+
+        # Giving ONOS time to add the flow
+        time.sleep( main.addFlowSleep )
+
+        main.step( "Check flow is in the ADDED state" )
+
+        main.log.info( "Get the flows from ONOS" )
+        try:
+            flows = json.loads( main.ONOSrest.flows( ) )
+
+            stepResult = main.TRUE
+            for f in flows:
+                if "rest" in f.get( "appId" ):
+                    if "ADDED" not in f.get( "state" ):
+                        stepResult = main.FALSE
+                        main.log.error( "Flow: %s in state: %s" % ( f.get( "id" ), f.get( "state" ) ) )
+        except TypeError:
+            main.log.error( "No Flows found by the REST API" )
+            stepResult = main.FALSE
+        except ValueError:
+            main.log.error( "Problem getting Flows state from REST API.  Exiting test" )
+            main.cleanup( )
+            main.exit( )
+
+        utilities.assert_equals( expect=main.TRUE,
+                                 actual=stepResult,
+                                 onpass="All flows are in the ADDED state",
+                                 onfail="All flows are NOT in the ADDED state" )
+
+        main.step( "Check flows are in Mininet's flow table" )
+
+        # get the flow IDs that were added through rest
+        main.log.info( "Getting the flow IDs from ONOS" )
+        flowIds = [ f.get( "id" ) for f in flows if "rest" in f.get( "appId" ) ]
+        # convert the flowIDs to ints then hex and finally back to strings
+        flowIds = [ str( hex( int( x ) ) ) for x in flowIds ]
+        main.log.info( "ONOS flow IDs: {}".format( flowIds ) )
+
+        stepResult = main.Mininet1.checkFlowId( "s1", flowIds, debug=False )
+
+        utilities.assert_equals( expect=main.TRUE,
+                                 actual=stepResult,
+                                 onpass="All flows are in mininet",
+                                 onfail="All flows are NOT in mininet" )
+
+        main.step( "Send a packet to verify the flow is correct" )
+
+        main.log.info( "Constructing packet" )
+        # No need for the MAC src dst
+        main.h5.buildEther( dst=main.h6.hostMac )
+        main.h5.buildIPv6( src=main.h5.hostIp, dst=main.h6.hostIp )
+
+        main.log.info( "Starting filter on host6" )
+        # Defaults to ip
+        main.h6.startFilter( pktFilter="ip6" )
+        main.log.info( "Sending packet to host6" )
+        main.h5.sendPacket( )
+
+        main.log.info( "Checking filter for our packet" )
+        stepResult = main.h6.checkFilter( )
+        if stepResult:
+            main.log.info( "Packet: %s" % main.h6.readPackets( ) )
+        else:
+            main.h6.killFilter( )
+
+        main.log.info( "Clean up host components" )
+        for host in hosts:
+            host.stopScapy( )
+        main.Mininet1.removeHostComponent( "h5" )
+        main.Mininet1.removeHostComponent( "h6" )
+
+        utilities.assert_equals( expect=main.TRUE,
+                                 actual=stepResult,
+                                 onpass="Successfully sent a packet",
+                                 onfail="Failed to send a packet" )
+
+
+    def CASE1100( self, main ):
         '''
             Add flow with VLAN selector and verify the flow
         '''
@@ -632,12 +750,11 @@
         main.log.info( "Creating host components" )
         main.Scapy.createHostComponent( "h3" )
         main.Scapy.createHostComponent( "h4" )
-        hosts = [main.h3, main.h4]
-        stepResult = main.TRUE
+        hosts = [ main.h3, main.h4 ]
         for host in hosts:
-            host.startHostCli()
-            host.startScapy()
-            host.updateSelf()
+            host.startHostCli( )
+            host.startScapy( )
+            host.updateSelf( )
 
 
         main.step( "Add a flow with the VLAN tag as the only selector" )
@@ -648,7 +765,7 @@
         egress = 4
         ingress = 3
         # VLAN ethType = 0x8100
-        ethType = 33024
+        ethType = main.params[ 'TEST' ][ 'vlanType' ]
 
         # Add only one flow because we don't need a response
         main.log.info( "Add flow with port ingress 1 to port egress 2" )
@@ -672,21 +789,21 @@
 
         main.log.info( "Get the flows from ONOS" )
         try:
-            flows = json.loads( main.ONOSrest.flows() )
+            flows = json.loads( main.ONOSrest.flows( ) )
 
             stepResult = main.TRUE
             for f in flows:
-                if "rest" in f.get("appId"):
-                    if "ADDED" not in f.get("state"):
+                if "rest" in f.get( "appId" ):
+                    if "ADDED" not in f.get( "state" ):
                         stepResult = main.FALSE
-                        main.log.error( "Flow: %s in state: %s" % (f.get("id"), f.get("state")) )
+                        main.log.error( "Flow: %s in state: %s" % ( f.get( "id" ), f.get( "state" ) ) )
         except TypeError:
             main.log.error( "No Flows found by the REST API" )
             stepResult = main.FALSE
         except ValueError:
             main.log.error( "Problem getting Flows state from REST API.  Exiting test" )
-            main.cleanup()
-            main.exit()
+            main.cleanup( )
+            main.exit( )
 
         utilities.assert_equals( expect=main.TRUE,
                                  actual=stepResult,
@@ -697,10 +814,10 @@
 
         # get the flow IDs that were added through rest
         main.log.info( "Getting the flow IDs from ONOS" )
-        flowIds = [ f.get("id") for f in flows if "rest" in f.get("appId") ]
+        flowIds = [ f.get( "id" ) for f in flows if "rest" in f.get( "appId" ) ]
         # convert the flowIDs to ints then hex and finally back to strings
-        flowIds = [str(hex(int(x))) for x in flowIds]
-        main.log.info( "ONOS flow IDs: {}".format(flowIds) )
+        flowIds = [ str( hex( int( x ) ) ) for x in flowIds ]
+        main.log.info( "ONOS flow IDs: {}".format( flowIds ) )
 
         stepResult = main.Mininet1.checkFlowId( "s1", flowIds, debug=False )
 
@@ -712,29 +829,29 @@
         main.step( "Send a packet to verify the flow are correct" )
 
         # The receiving interface
-        recIface = "{}-eth0.{}".format(main.h4.name, vlan)
+        recIface = "{}-eth0.{}".format( main.h4.name, vlan )
         main.log.info( "Starting filter on host2" )
         # Filter is setup to catch any packet on the vlan interface with the correct vlan tag
-        main.h4.startFilter( ifaceName=recIface, pktFilter="" )
+        main.h4.startFilter( ifaceName=recIface, pktFilter = "" )
 
         # Broadcast the packet on the vlan interface. We only care if the flow forwards
         # the packet with the correct vlan tag, not if the mac addr is correct
-        sendIface = "{}-eth0.{}".format(main.h3.name, vlan)
+        sendIface = "{}-eth0.{}".format( main.h3.name, vlan )
         main.log.info( "Broadcasting the packet with a vlan tag" )
         main.h3.sendPacket( iface=sendIface,
-                            packet="Ether()/Dot1Q(vlan={})".format(vlan) )
+                            packet="Ether()/Dot1Q(vlan={})".format( vlan ) )
 
         main.log.info( "Checking filter for our packet" )
-        stepResult = main.h4.checkFilter()
+        stepResult = main.h4.checkFilter( )
         if stepResult:
-            main.log.info( "Packet: %s" % main.h4.readPackets() )
-        else: main.h4.killFilter()
+            main.log.info( "Packet: %s" % main.h4.readPackets( ) )
+        else: main.h4.killFilter( )
 
         main.log.info( "Clean up host components" )
         for host in hosts:
-            host.stopScapy()
-        main.Mininet1.removeHostComponent("h3")
-        main.Mininet1.removeHostComponent("h4")
+            host.stopScapy( )
+        main.Mininet1.removeHostComponent( "h3" )
+        main.Mininet1.removeHostComponent( "h4" )
 
         utilities.assert_equals( expect=main.TRUE,
                                  actual=stepResult,
@@ -750,7 +867,7 @@
 
         main.case( "Verify the MPLS selector is correctly compiled on the flow." )
         main.caseExplanation = "Install one flow with an MPLS selector, " +\
-                               "verify the flow is added in ONOS, and finally "+\
+                               "verify the flow is added in ONOS, and finally " +\
                                "send a packet via scapy that has a MPLS label."
 
         main.step( "Add a flow with a MPLS selector" )
@@ -758,12 +875,11 @@
         main.log.info( "Creating host components" )
         main.Scapy.createHostComponent( "h1" )
         main.Scapy.createHostComponent( "h2" )
-        hosts = [main.h1, main.h2]
-        stepResult = main.TRUE
+        hosts = [ main.h1, main.h2 ]
         for host in hosts:
-            host.startHostCli()
+            host.startHostCli( )
             host.startScapy( main.dependencyPath )
-            host.updateSelf()
+            host.updateSelf( )
 
         # ports
         egress = 2
@@ -794,21 +910,21 @@
 
         main.log.info( "Get the flows from ONOS" )
         try:
-            flows = json.loads( main.ONOSrest.flows() )
+            flows = json.loads( main.ONOSrest.flows( ) )
 
             stepResult = main.TRUE
             for f in flows:
-                if "rest" in f.get("appId"):
-                    if "ADDED" not in f.get("state"):
+                if "rest" in f.get( "appId" ):
+                    if "ADDED" not in f.get( "state" ):
                         stepResult = main.FALSE
-                        main.log.error( "Flow: %s in state: %s" % (f.get("id"), f.get("state")) )
+                        main.log.error( "Flow: %s in state: %s" % ( f.get( "id" ), f.get( "state" ) ) )
         except TypeError:
             main.log.error( "No Flows found by the REST API" )
             stepResult = main.FALSE
         except ValueError:
             main.log.error( "Problem getting Flows state from REST API.  Exiting test" )
-            main.cleanup()
-            main.exit()
+            main.cleanup( )
+            main.exit( )
 
         utilities.assert_equals( expect=main.TRUE,
                                  actual=stepResult,
@@ -819,10 +935,10 @@
 
         # get the flow IDs that were added through rest
         main.log.info( "Getting the flow IDs from ONOS" )
-        flowIds = [ f.get("id") for f in flows if "rest" in f.get("appId") ]
+        flowIds = [ f.get( "id" ) for f in flows if "rest" in f.get( "appId" ) ]
         # convert the flowIDs to ints then hex and finally back to strings
-        flowIds = [str(hex(int(x))) for x in flowIds]
-        main.log.info( "ONOS flow IDs: {}".format(flowIds) )
+        flowIds = [ str( hex( int( x ) ) ) for x in flowIds ]
+        main.log.info( "ONOS flow IDs: {}".format( flowIds ) )
 
         stepResult = main.Mininet1.checkFlowId( "s1", flowIds, debug=True )
 
@@ -838,26 +954,26 @@
 
         main.log.info( "Constructing packet" )
         main.log.info( "Sending packet to host2" )
-        main.h1.sendPacket( packet='Ether()/MPLS(label={})'.format(mplsLabel) )
+        main.h1.sendPacket( packet='Ether()/MPLS(label={})'.format( mplsLabel ) )
 
         main.log.info( "Checking filter for our packet" )
-        stepResult = main.h2.checkFilter()
+        stepResult = main.h2.checkFilter( )
         if stepResult:
-            main.log.info( "Packet: %s" % main.h2.readPackets() )
-        else: main.h2.killFilter()
+            main.log.info( "Packet: %s" % main.h2.readPackets( ) )
+        else: main.h2.killFilter( )
 
         main.log.info( "Clean up host components" )
         for host in hosts:
-            host.stopScapy()
-        main.Mininet1.removeHostComponent("h1")
-        main.Mininet1.removeHostComponent("h2")
+            host.stopScapy( )
+        main.Mininet1.removeHostComponent( "h1" )
+        main.Mininet1.removeHostComponent( "h2" )
 
         utilities.assert_equals( expect=main.TRUE,
                                  actual=stepResult,
                                  onpass="Successfully sent a packet",
                                  onfail="Failed to send a packet" )
 
-    def CASE1400( self, main ):
+    def CASE1700( self, main ):
         '''
             Add flows with a TCP selector and verify the flow
         '''
@@ -866,7 +982,7 @@
 
         main.case( "Verify the TCP selector is correctly compiled on the flow" )
         main.caseExplanation = "Install a flow with only the TCP selector " +\
-                "specified, verify the flow is added in ONOS, and finally "+\
+                "specified, verify the flow is added in ONOS, and finally " +\
                 "send a TCP packet to verify the TCP selector is compiled correctly."
 
         main.step( "Add a flow with a TCP selector" )
@@ -874,12 +990,11 @@
         main.log.info( "Creating host components" )
         main.Scapy.createHostComponent( "h1" )
         main.Scapy.createHostComponent( "h2" )
-        hosts = [main.h1, main.h2]
-        stepResult = main.TRUE
+        hosts = [ main.h1, main.h2 ]
         for host in hosts:
-            host.startHostCli()
-            host.startScapy()
-            host.updateSelf()
+            host.startHostCli( )
+            host.startScapy( )
+            host.updateSelf( )
 
         # Add a flow that connects host1 on port1 to host2 on port2
         egress = 2
@@ -912,21 +1027,21 @@
 
         main.log.info( "Get the flows from ONOS" )
         try:
-            flows = json.loads( main.ONOSrest.flows() )
+            flows = json.loads( main.ONOSrest.flows( ) )
 
             stepResult = main.TRUE
             for f in flows:
-                if "rest" in f.get("appId"):
-                    if "ADDED" not in f.get("state"):
+                if "rest" in f.get( "appId" ):
+                    if "ADDED" not in f.get( "state" ):
                         stepResult = main.FALSE
-                        main.log.error( "Flow: %s in state: %s" % (f.get("id"), f.get("state")) )
+                        main.log.error( "Flow: %s in state: %s" % ( f.get( "id" ), f.get( "state" ) ) )
         except TypeError:
             main.log.error( "No Flows found by the REST API" )
             stepResult = main.FALSE
         except ValueError:
             main.log.error( "Problem getting Flows state from REST API.  Exiting test" )
-            main.cleanup()
-            main.exit()
+            main.cleanup( )
+            main.exit( )
 
         utilities.assert_equals( expect=main.TRUE,
                                  actual=stepResult,
@@ -937,10 +1052,10 @@
 
         # get the flow IDs that were added through rest
         main.log.info( "Getting the flow IDs from ONOS" )
-        flowIds = [ f.get("id") for f in flows if "rest" in f.get("appId") ]
+        flowIds = [ f.get( "id" ) for f in flows if "rest" in f.get( "appId" ) ]
         # convert the flowIDs to ints then hex and finally back to strings
-        flowIds = [str(hex(int(x))) for x in flowIds]
-        main.log.info( "ONOS flow IDs: {}".format(flowIds) )
+        flowIds = [ str( hex( int( x ) ) ) for x in flowIds ]
+        main.log.info( "ONOS flow IDs: {}".format( flowIds ) )
 
         stepResult = main.Mininet1.checkFlowId( "s1", flowIds, debug=False )
 
@@ -962,26 +1077,26 @@
         main.h2.startFilter( pktFilter="tcp" )
 
         main.log.info( "Sending packet to host2" )
-        main.h1.sendPacket()
+        main.h1.sendPacket( )
 
         main.log.info( "Checking filter for our packet" )
-        stepResult = main.h2.checkFilter()
+        stepResult = main.h2.checkFilter( )
         if stepResult:
-            main.log.info( "Packet: %s" % main.h2.readPackets() )
-        else: main.h2.killFilter()
+            main.log.info( "Packet: %s" % main.h2.readPackets( ) )
+        else: main.h2.killFilter( )
 
         main.log.info( "Clean up host components" )
         for host in hosts:
-            host.stopScapy()
-        main.Mininet1.removeHostComponent("h1")
-        main.Mininet1.removeHostComponent("h2")
+            host.stopScapy( )
+        main.Mininet1.removeHostComponent( "h1" )
+        main.Mininet1.removeHostComponent( "h2" )
 
         utilities.assert_equals( expect=main.TRUE,
                                  actual=stepResult,
                                  onpass="Successfully sent a packet",
                                  onfail="Failed to send a packet" )
 
-    def CASE1500( self, main ):
+    def CASE1600( self, main ):
         '''
             Add flows with a UDP selector and verify the flow
         '''
@@ -990,7 +1105,7 @@
 
         main.case( "Verify the UDP selector is correctly compiled on the flow" )
         main.caseExplanation = "Install a flow with only the UDP selector " +\
-                "specified, verify the flow is added in ONOS, and finally "+\
+                "specified, verify the flow is added in ONOS, and finally " +\
                 "send a UDP packet to verify the UDP selector is compiled correctly."
 
         main.step( "Add a flow with a UDP selector" )
@@ -998,12 +1113,11 @@
         main.log.info( "Creating host components" )
         main.Scapy.createHostComponent( "h1" )
         main.Scapy.createHostComponent( "h2" )
-        hosts = [main.h1, main.h2]
-        stepResult = main.TRUE
+        hosts = [ main.h1, main.h2 ]
         for host in hosts:
-            host.startHostCli()
-            host.startScapy()
-            host.updateSelf()
+            host.startHostCli( )
+            host.startScapy( )
+            host.updateSelf( )
 
         # Add a flow that connects host1 on port1 to host2 on port2
         egress = 2
@@ -1036,21 +1150,21 @@
 
         main.log.info( "Get the flows from ONOS" )
         try:
-            flows = json.loads( main.ONOSrest.flows() )
+            flows = json.loads( main.ONOSrest.flows( ) )
 
             stepResult = main.TRUE
             for f in flows:
-                if "rest" in f.get("appId"):
-                    if "ADDED" not in f.get("state"):
+                if "rest" in f.get( "appId" ):
+                    if "ADDED" not in f.get( "state" ):
                         stepResult = main.FALSE
-                        main.log.error( "Flow: %s in state: %s" % (f.get("id"), f.get("state")) )
+                        main.log.error( "Flow: %s in state: %s" % ( f.get( "id" ), f.get( "state" ) ) )
         except TypeError:
             main.log.error( "No Flows found by the REST API" )
             stepResult = main.FALSE
         except ValueError:
             main.log.error( "Problem getting Flows state from REST API.  Exiting test" )
-            main.cleanup()
-            main.exit()
+            main.cleanup( )
+            main.exit( )
 
         utilities.assert_equals( expect=main.TRUE,
                                  actual=stepResult,
@@ -1061,10 +1175,10 @@
 
         # get the flow IDs that were added through rest
         main.log.info( "Getting the flow IDs from ONOS" )
-        flowIds = [ f.get("id") for f in flows if "rest" in f.get("appId") ]
+        flowIds = [ f.get( "id" ) for f in flows if "rest" in f.get( "appId" ) ]
         # convert the flowIDs to ints then hex and finally back to strings
-        flowIds = [str(hex(int(x))) for x in flowIds]
-        main.log.info( "ONOS flow IDs: {}".format(flowIds) )
+        flowIds = [ str( hex( int( x ) ) ) for x in flowIds ]
+        main.log.info( "ONOS flow IDs: {}".format( flowIds ) )
 
         stepResult = main.Mininet1.checkFlowId( "s1", flowIds, debug=False )
 
@@ -1086,48 +1200,290 @@
         main.h2.startFilter( pktFilter="udp" )
 
         main.log.info( "Sending packet to host2" )
-        main.h1.sendPacket()
+        main.h1.sendPacket( )
 
         main.log.info( "Checking filter for our packet" )
-        stepResult = main.h2.checkFilter()
+        stepResult = main.h2.checkFilter( )
         if stepResult:
-            main.log.info( "Packet: %s" % main.h2.readPackets() )
-        else: main.h2.killFilter()
+            main.log.info( "Packet: %s" % main.h2.readPackets( ) )
+        else: main.h2.killFilter( )
 
         main.log.info( "Clean up host components" )
         for host in hosts:
-            host.stopScapy()
-        main.Mininet1.removeHostComponent("h1")
-        main.Mininet1.removeHostComponent("h2")
+            host.stopScapy( )
+        main.Mininet1.removeHostComponent( "h1" )
+        main.Mininet1.removeHostComponent( "h2" )
 
         utilities.assert_equals( expect=main.TRUE,
                                  actual=stepResult,
                                  onpass="Successfully sent a packet",
                                  onfail="Failed to send a packet" )
 
-
-    def CASE2000( self, main ):
+    def CASE1900( self, main ):
+        '''
+            Add flows with a ICMPv4 selector and verify the flow
+        '''
         import json
+        import time
 
-        main.case( "Delete flows that were added through rest" )
-        main.step("Deleting flows")
+        main.case( "Verify the ICMPv4 selector is correctly compiled on the flow" )
+        main.caseExplanation = "Install a flow with only the ICMPv4 selector " +\
+                "specified, verify the flow is added in ONOS, and finally " +\
+                "send a IMCPv4 packet to verify the ICMPv4 selector is compiled correctly."
 
-        main.log.info( "Getting flows" )
+        main.step( "Add a flow with a ICMPv4 selector" )
+
+        main.log.info( "Creating host components" )
+        main.Scapy.createHostComponent( "h1" )
+        main.Scapy.createHostComponent( "h2" )
+        hosts = [ main.h1, main.h2 ]
+        for host in hosts:
+            host.startHostCli( )
+            host.startScapy( )
+            host.updateSelf( )
+
+        # Add a flow that connects host1 on port1 to host2 on port2
+        egress = 2
+        ingress = 1
+        # IPv4 etherType
+        ethType = main.params[ 'TEST' ][ 'ip4Type' ]
+        # IP protocol
+        ipProto = main.params[ 'TEST' ][ 'icmpProto' ]
+
+        main.log.info( "Add a flow that connects host1 on port1 to host2 on port2" )
+        stepResult = main.ONOSrest.addFlow( deviceId=main.swDPID,
+                                            egressPort=egress,
+                                            ingressPort=ingress,
+                                            ethType=ethType,
+                                            ipProto=ipProto,
+                                            debug=main.debug )
+
+        utilities.assert_equals( expect=main.TRUE,
+                                 actual=stepResult,
+                                 onpass="Successfully added flows",
+                                 onfail="Failed add flows" )
+
+        # Giving ONOS time to add the flow
+        time.sleep( main.addFlowSleep )
+
+        main.step( "Check flow is in the ADDED state" )
+
+        main.log.info( "Get the flows from ONOS" )
         try:
-            flows = json.loads( main.ONOSrest.flows() )
+            flows = json.loads( main.ONOSrest.flows( ) )
 
             stepResult = main.TRUE
             for f in flows:
-                if "rest" in f.get("appId"):
-                    if main.debug: main.log.debug( "Flow to be deleted:\n{}".format( main.ONOSrest.pprint(f) ) )
-                    stepResult = stepResult and main.ONOSrest.removeFlow( f.get("deviceId"), f.get("id") )
+                if "rest" in f.get( "appId" ):
+                    if "ADDED" not in f.get( "state" ):
+                        stepResult = main.FALSE
+                        main.log.error( "Flow: %s in state: %s" % ( f.get( "id" ), f.get( "state" ) ) )
         except TypeError:
             main.log.error( "No Flows found by the REST API" )
             stepResult = main.FALSE
         except ValueError:
             main.log.error( "Problem getting Flows state from REST API.  Exiting test" )
-            main.cleanup()
-            main.exit()
+            main.cleanup( )
+            main.exit( )
+
+        utilities.assert_equals( expect=main.TRUE,
+                                 actual=stepResult,
+                                 onpass="All flows are in the ADDED state",
+                                 onfail="All flows are NOT in the ADDED state" )
+
+        main.step( "Check flows are in Mininet's flow table" )
+
+        # get the flow IDs that were added through rest
+        main.log.info( "Getting the flow IDs from ONOS" )
+        flowIds = [ f.get( "id" ) for f in flows if "rest" in f.get( "appId" ) ]
+        # convert the flowIDs to ints then hex and finally back to strings
+        flowIds = [ str( hex( int( x ) ) ) for x in flowIds ]
+        main.log.info( "ONOS flow IDs: {}".format( flowIds ) )
+
+        stepResult = main.Mininet1.checkFlowId( "s1", flowIds, debug=False )
+
+        utilities.assert_equals( expect=main.TRUE,
+                                 actual=stepResult,
+                                 onpass="All flows are in mininet",
+                                 onfail="All flows are NOT in mininet" )
+
+        main.step( "Send a packet to verify the flow is correct" )
+
+        main.log.info( "Constructing packet" )
+        # No need for the MAC src dst
+        main.h1.buildEther( dst=main.h2.hostMac )
+        main.h1.buildIP( dst=main.h2.hostIp )
+        main.h1.buildICMP( )
+
+        main.log.info( "Starting filter on host2" )
+        # Defaults to ip
+        main.h2.startFilter( pktFilter="icmp" )
+
+        main.log.info( "Sending packet to host2" )
+        main.h1.sendPacket( )
+
+        main.log.info( "Checking filter for our packet" )
+        stepResult = main.h2.checkFilter( )
+        if stepResult:
+            main.log.info( "Packet: %s" % main.h2.readPackets( ) )
+        else: main.h2.killFilter( )
+
+        main.log.info( "Clean up host components" )
+        for host in hosts:
+            host.stopScapy( )
+        main.Mininet1.removeHostComponent( "h1" )
+        main.Mininet1.removeHostComponent( "h2" )
+
+        utilities.assert_equals( expect=main.TRUE,
+                                 actual=stepResult,
+                                 onpass="Successfully sent a packet",
+                                 onfail="Failed to send a packet" )
+
+    def CASE2000( self, main ):
+        '''
+            Add flows with a ICMPv6 selector and verify the flow
+        '''
+        import json
+        import time
+
+        main.case( "Verify the ICMPv6 selector is correctly compiled on the flow" )
+        main.caseExplanation = "Install a flow with only the ICMPv6 selector " +\
+                "specified, verify the flow is added in ONOS, and finally " +\
+                "send a IMCPv6 packet to verify the ICMPv6 selector is compiled correctly."
+
+        main.step( "Add a flow with a ICMPv6 selector" )
+
+        main.log.info( "Creating host components" )
+        main.Scapy.createHostComponent( "h5" )
+        main.Scapy.createHostComponent( "h6" )
+        hosts =[ main.h5, main.h6 ]
+        for host in hosts:
+            host.startHostCli( )
+            host.startScapy( )
+            host.updateSelf( IPv6=True )
+
+        # Add a flow that connects host1 on port1 to host2 on port2
+        egress =6
+        ingress =5
+        # IPv6 etherType
+        ethType = main.params[ 'TEST' ][ 'ip6Type' ]
+        # IP protocol
+        ipProto = main.params[ 'TEST' ][ 'icmp6Proto' ]
+
+        main.log.info( "Add a flow that connects host1 on port1 to host2 on port2" )
+        stepResult = main.ONOSrest.addFlow( deviceId=main.swDPID,
+                                            egressPort=egress,
+                                            ingressPort=ingress,
+                                            ethType=ethType,
+                                            ipProto=ipProto,
+                                            debug=main.debug )
+
+        utilities.assert_equals( expect=main.TRUE,
+                                 actual=stepResult,
+                                 onpass="Successfully added flows",
+                                 onfail="Failed add flows" )
+
+        # Giving ONOS time to add the flow
+        time.sleep( main.addFlowSleep )
+
+        main.step( "Check flow is in the ADDED state" )
+
+        main.log.info( "Get the flows from ONOS" )
+        try:
+            flows = json.loads( main.ONOSrest.flows( ) )
+
+            stepResult = main.TRUE
+            for f in flows:
+                if "rest" in f.get( "appId" ):
+                    if "ADDED" not in f.get( "state" ):
+                        stepResult = main.FALSE
+                        main.log.error( "Flow: %s in state: %s" % ( f.get( "id" ), f.get( "state" ) ) )
+        except TypeError:
+            main.log.error( "No Flows found by the REST API" )
+            stepResult = main.FALSE
+        except ValueError:
+            main.log.error( "Problem getting Flows state from REST API.  Exiting test" )
+            main.cleanup( )
+            main.exit( )
+
+        utilities.assert_equals( expect=main.TRUE,
+                                 actual=stepResult,
+                                 onpass="All flows are in the ADDED state",
+                                 onfail="All flows are NOT in the ADDED state" )
+
+        main.step( "Check flows are in Mininet's flow table" )
+
+        # get the flow IDs that were added through rest
+        main.log.info( "Getting the flow IDs from ONOS" )
+        flowIds = [ f.get( "id" ) for f in flows if "rest" in f.get( "appId" ) ]
+        # convert the flowIDs to ints then hex and finally back to strings
+        flowIds = [ str( hex( int( x ) ) ) for x in flowIds ]
+        main.log.info( "ONOS flow IDs: {}".format( flowIds ) )
+
+        stepResult = main.Mininet1.checkFlowId( "s1", flowIds, debug=False )
+
+        utilities.assert_equals( expect=main.TRUE,
+                                 actual=stepResult,
+                                 onpass="All flows are in mininet",
+                                 onfail="All flows are NOT in mininet" )
+
+        main.step( "Send a packet to verify the flow is correct" )
+
+        main.log.info( "Constructing packet" )
+        # No need for the MAC src dst
+        main.h5.buildEther( dst=main.h6.hostMac )
+        main.h5.buildIPv6( dst=main.h6.hostIp )
+        main.h5.buildICMP( ipVersion=6 )
+
+        main.log.info( "Starting filter on host2" )
+        # Defaults to ip
+        main.h6.startFilter( pktFilter="icmp6" )
+
+        main.log.info( "Sending packet to host2" )
+        main.h5.sendPacket( )
+
+        main.log.info( "Checking filter for our packet" )
+        stepResult = main.h6.checkFilter( )
+        if stepResult:
+            main.log.info( "Packet: %s" % main.h6.readPackets( ) )
+        else: main.h6.killFilter( )
+
+        main.log.info( "Clean up host components" )
+        for host in hosts:
+            host.stopScapy( )
+        main.Mininet1.removeHostComponent( "h5" )
+        main.Mininet1.removeHostComponent( "h6" )
+
+        utilities.assert_equals( expect=main.TRUE,
+                                 actual=stepResult,
+                                 onpass="Successfully sent a packet",
+                                 onfail="Failed to send a packet" )
+
+    def CASE3000( self, main ):
+        '''
+            Delete flow
+        '''
+        import json
+
+        main.case( "Delete flows that were added through rest" )
+        main.step( "Deleting flows" )
+
+        main.log.info( "Getting flows" )
+        try:
+            flows = json.loads( main.ONOSrest.flows( ) )
+
+            stepResult = main.TRUE
+            for f in flows:
+                if "rest" in f.get( "appId" ):
+                    if main.debug: main.log.debug( "Flow to be deleted:\n{}".format( main.ONOSrest.pprint( f ) ) )
+                    stepResult = stepResult and main.ONOSrest.removeFlow( f.get( "deviceId" ), f.get( "id" ) )
+        except TypeError:
+            main.log.error( "No Flows found by the REST API" )
+            stepResult = main.FALSE
+        except ValueError:
+            main.log.error( "Problem getting Flows state from REST API.  Exiting test" )
+            main.cleanup( )
+            main.exit( )
 
         utilities.assert_equals( expect=main.TRUE,
                                  actual=stepResult,
@@ -1136,11 +1492,254 @@
 
         time.sleep( main.delFlowSleep )
 
+
+    def CASE1200(self, main ):
+        '''
+            Add flows with a ARP selector and verify the flow
+        '''
+        import json
+        import time
+
+        main.case( "Verify flow IP selectors are correctly compiled" )
+        main.caseExplanation = "Install two flows with only IP selectors " + \
+                               "specified, then verify flows are added in ONOS, finally " + \
+                               "send a packet that only specifies the IP src and dst."
+
+        main.step( "Add flows with ARP addresses as the only selectors" )
+
+        main.log.info( "Creating host components" )
+        main.Scapy.createHostComponent( "h1" )
+        main.Scapy.createHostComponent( "h2" )
+        hosts = [ main.h1, main.h2 ]
+        for host in hosts:
+            host.startHostCli( )
+            host.startScapy( )
+            host.updateSelf( )
+
+        # Add a flow that connects host1 on port1 to host2 on port2
+        # send output on port2
+        # recieve input on port1
+        egress = 2
+        ingress = 1
+        # ARP etherType = 0x0806
+        ethType = main.params[ 'TEST' ][ 'arpType' ]
+
+        # Add flows that connects host1 to host2
+        main.log.info( "Add flow with port ingress 1 to port egress 2" )
+        stepResult = main.ONOSrest.addFlow(deviceId=main.swDPID,
+                                           egressPort=egress,
+                                           ingressPort=ingress,
+                                           ethType=ethType,
+                                           priority=40001,
+                                           debug=main.debug )
+
+        utilities.assert_equals( expect=main.TRUE,
+                                 actual=stepResult,
+                                 onpass="Successfully added flows",
+                                 onfail="Failed add flows" )
+
+        # Giving ONOS time to add the flow
+        time.sleep( main.addFlowSleep )
+
+        main.step( "Check flow is in the ADDED state" )
+
+        main.log.info( "Get the flows from ONOS" )
+        try:
+            flows = json.loads( main.ONOSrest.flows( ) )
+
+            stepResult = main.TRUE
+            for f in flows:
+                if "rest" in f.get( "appId" ):
+                    if "ADDED" not in f.get( "state" ):
+                        stepResult = main.FALSE
+                        main.log.error("Flow: %s in state: %s" % ( f.get("id"), f.get( "state" ) ) )
+        except TypeError:
+            main.log.error( "No Flows found by the REST API" )
+            stepResult = main.FALSE
+        except ValueError:
+            main.log.error( "Problem getting Flows state from REST API.  Exiting test" )
+            main.cleanup( )
+            main.exit( )
+
+        utilities.assert_equals( expect=main.TRUE,
+                                 actual=stepResult,
+                                 onpass="All flows are in the ADDED state",
+                                 onfail="All flows are NOT in the ADDED state" )
+
+        main.step( "Check flows are in Mininet's flow table" )
+
+        # get the flow IDs that were added through rest
+        main.log.info( "Getting the flow IDs from ONOS" )
+        flowIds = [f.get( "id" ) for f in flows if "rest" in f.get( "appId" ) ]
+        # convert the flowIDs to ints then hex and finally back to strings
+        flowIds = [ str( hex( int( x ) ) ) for x in flowIds ]
+        main.log.info("ONOS flow IDs: {}".format( flowIds ) )
+
+        stepResult = main.Mininet1.checkFlowId( "s1", flowIds, debug=False )
+
+        utilities.assert_equals( expect=main.TRUE,
+                                 actual=stepResult,
+                                 onpass="All flows are in mininet",
+                                 onfail="All flows are NOT in mininet" )
+
+        main.step( "Send a packet to verify the flow is correct" )
+
+        main.log.info( "Constructing packet" )
+        # No need for the MAC src dst
+        main.h1.buildEther( src=main.h1.hostMac, dst=main.h2.hostMac )
+        main.h1.buildARP( pdst=main.h2.hostIp )
+
+        main.log.info( "Starting filter on host2" )
+        # Defaults to ip
+        main.h2.startFilter( pktFilter="arp" )
+
+        main.log.info( "Sending packet to host2" )
+        main.h1.sendPacket( )
+
+        main.log.info( "Checking filter for our packet" )
+        stepResult = main.h2.checkFilter( )
+        if stepResult:
+            main.log.info( "Packet: %s" % main.h2.readPackets( ) )
+        else:
+            main.h2.killFilter( )
+
+        main.log.info( "Clean up host components" )
+        for host in hosts:
+            host.stopScapy( )
+        main.Mininet1.removeHostComponent( "h1" )
+        main.Mininet1.removeHostComponent( "h2" )
+
+        utilities.assert_equals( expect=main.TRUE,
+                                 actual=stepResult,
+                                 onpass="Successfully sent a packet",
+                                 onfail="Failed to send a packet" )
+
+    def CASE1800( self, main ):
+        '''
+           Add flows with a SCTP selector and verify the flow
+        '''
+        import json
+        import time
+
+        main.case( "Verify the UDP selector is correctly compiled on the flow" )
+        main.caseExplanation = "Install a flow with only the UDP selector " + \
+                               "specified, verify the flow is added in ONOS, and finally " + \
+                               "send a UDP packet to verify the UDP selector is compiled correctly."
+
+        main.step( "Add a flow with a SCTP selector" )
+
+        main.log.info( "Creating host components" )
+        main.Scapy.createHostComponent( "h1" )
+        main.Scapy.createHostComponent( "h2" )
+        hosts = [ main.h1, main.h2 ]
+        for host in hosts:
+            host.startHostCli( )
+            host.startScapy( )
+            host.updateSelf( )
+
+        # Add a flow that connects host1 on port1 to host2 on port2
+        egress = 2
+        ingress = 1
+        # IPv4 etherType
+        ethType = main.params[ 'TEST' ][ 'ip4Type' ]
+        # IP protocol
+        ipProto = main.params[ 'TEST' ][ 'sctpProto' ]
+
+        main.log.info("Add a flow that connects host1 on port1 to host2 on port2")
+        stepResult = main.ONOSrest.addFlow( deviceId=main.swDPID,
+                                            egressPort=egress,
+                                            ingressPort=ingress,
+                                            ethType=ethType,
+                                            ipProto=ipProto,
+                                            debug=main.debug )
+
+        utilities.assert_equals( expect=main.TRUE,
+                                 actual=stepResult,
+                                 onpass="Successfully added flows",
+                                 onfail="Failed add flows" )
+
+        # Giving ONOS time to add the flow
+        time.sleep( main.addFlowSleep )
+
+        main.step( "Check flow is in the ADDED state" )
+
+        main.log.info( "Get the flows from ONOS" )
+        try:
+            flows = json.loads( main.ONOSrest.flows( ) )
+
+            stepResult = main.TRUE
+            for f in flows:
+                if "rest" in f.get( "appId" ):
+                    if "ADDED" not in f.get( "state" ):
+                        stepResult = main.FALSE
+                        main.log.error("Flow: %s in state: %s" % ( f.get( "id" ), f.get( "state" ) ) )
+        except TypeError:
+            main.log.error( "No Flows found by the REST API" )
+            stepResult = main.FALSE
+        except ValueError:
+            main.log.error( "Problem getting Flows state from REST API.  Exiting test" )
+            main.cleanup( )
+            main.exit( )
+
+        utilities.assert_equals( expect=main.TRUE,
+                                 actual=stepResult,
+                                 onpass="All flows are in the ADDED state",
+                                 onfail="All flows are NOT in the ADDED state" )
+
+        main.step( "Check flows are in Mininet's flow table" )
+
+        # get the flow IDs that were added through rest
+        main.log.info( "Getting the flow IDs from ONOS" )
+        flowIds = [ f.get( "id" ) for f in flows if "rest" in f.get( "appId" ) ]
+        # convert the flowIDs to ints then hex and finally back to strings
+        flowIds = [ str( hex( int( x ) ) ) for x in flowIds ]
+        main.log.info( "ONOS flow IDs: {}".format( flowIds ) )
+
+        stepResult = main.Mininet1.checkFlowId( "s1", flowIds, debug=False )
+
+        utilities.assert_equals( expect=main.TRUE,
+                                 actual=stepResult,
+                                 onpass="All flows are in mininet",
+                                 onfail="All flows are NOT in mininet" )
+
+        main.step( "Send a packet to verify the flow is correct" )
+
+        main.log.info( "Constructing packet" )
+        # No need for the MAC src dst
+        main.h1.buildEther( dst=main.h2.hostMac )
+        main.h1.buildIP( dst=main.h2.hostIp )
+        main.h1.buildSCTP( )
+
+        main.log.info( "Starting filter on host2" )
+        # Defaults to ip
+        main.h2.startFilter( pktFilter="sctp" )
+
+        main.log.info( "Sending packet to host2" )
+        main.h1.sendPacket( )
+
+        main.log.info( "Checking filter for our packet" )
+        stepResult = main.h2.checkFilter( )
+        if stepResult:
+            main.log.info( "Packet: %s" % main.h2.readPackets( ) )
+        else:
+            main.h2.killFilter( )
+
+        main.log.info( "Clean up host components" )
+        for host in hosts:
+            host.stopScapy( )
+        main.Mininet1.removeHostComponent( "h1" )
+        main.Mininet1.removeHostComponent( "h2" )
+
+        utilities.assert_equals( expect=main.TRUE,
+                                 actual=stepResult,
+                                 onpass="Successfully sent a packet",
+                                 onfail="Failed to send a packet" )
+
     def CASE100( self, main ):
         '''
             Report errors/warnings/exceptions
         '''
-        main.log.info("Error report: \n" )
+        main.log.info( "Error report: \n" )
         main.ONOSbench.logReport( main.ONOSip[ 0 ],
                                   [ "INFO",
                                     "FOLLOWER",