diff --git a/TestON/tests/FUNC/FUNCipv6Intent/FUNCipv6Intent.py b/TestON/tests/FUNC/FUNCipv6Intent/FUNCipv6Intent.py
old mode 100755
new mode 100644
index d13762e..4cc4bc9
--- a/TestON/tests/FUNC/FUNCipv6Intent/FUNCipv6Intent.py
+++ b/TestON/tests/FUNC/FUNCipv6Intent/FUNCipv6Intent.py
@@ -1,5 +1,6 @@
 # Testing the basic intent for ipv6 functionality of ONOS
 
+
 class FUNCipv6Intent:
 
     def __init__( self ):
@@ -49,7 +50,7 @@
             gitPull = main.params[ 'GIT' ][ 'pull' ]
             main.numSwitch = int( main.params[ 'MININET' ][ 'switch' ] )
             main.numLinks = int( main.params[ 'MININET' ][ 'links' ] )
-            main.cellData = {} # for creating cell file
+            main.cellData = {}  # for creating cell file
             main.hostsData = {}
             main.CLIs = []
             main.ONOSip = []
@@ -59,7 +60,7 @@
             print main.ONOSip
 
             # Assigning ONOS cli handles to a list
-            for i in range( 1,  main.maxNodes + 1 ):
+            for i in range( 1, main.maxNodes + 1 ):
                 main.CLIs.append( getattr( main, 'ONOScli' + str( i ) ) )
 
             # -- INIT SECTION, ONLY RUNS ONCE -- #
@@ -69,9 +70,9 @@
                                             ".py" )
 
             main.intentFunction = imp.load_source( wrapperFile2,
-                                            main.dependencyPath +
-                                            wrapperFile2 +
-                                            ".py" )
+                                                   main.dependencyPath +
+                                                   wrapperFile2 +
+                                                   ".py" )
 
             main.topo = imp.load_source( wrapperFile3,
                                          main.dependencyPath +
@@ -89,7 +90,7 @@
                 main.log.error( "Did not properly created list of ONOS CLI handle" )
                 stepResult = main.FALSE
         except Exception as e:
-            main.log.exception(e)
+            main.log.exception( e )
             main.cleanup()
             main.exit()
 
@@ -135,8 +136,6 @@
         main.caseExplanation = "Set up ONOS with " + str( main.numCtrls ) +\
                                 " node(s) ONOS cluster"
 
-
-
         #kill off all onos processes
         main.log.info( "Safety check, killing all ONOS processes" +
                        " before initiating environment setup" )
@@ -148,7 +147,7 @@
 
         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", main.Mininet1.ip_address,
@@ -160,7 +159,7 @@
         stepResult = cellResult and verifyResult
         utilities.assert_equals( expect=main.TRUE,
                                  actual=stepResult,
-                                 onpass="Successfully applied cell to " + \
+                                 onpass="Successfully applied cell to " +
                                         "environment",
                                  onfail="Failed to apply cell to environment " )
 
@@ -199,7 +198,7 @@
         main.step( "Set up ONOS secure SSH" )
         secureSshResult = main.TRUE
         for i in range( int( main.numCtrls ) ):
-            secureSshResult = secureSshResult and main.ONOSbench.onosSecureSSH( node=main.ONOSip[i] )
+            secureSshResult = secureSshResult and main.ONOSbench.onosSecureSSH( node=main.ONOSip[ i ] )
         utilities.assert_equals( expect=main.TRUE, actual=secureSshResult,
                                  onpass="Test step PASS",
                                  onfail="Test step FAIL" )
@@ -257,12 +256,12 @@
             main.exit()
 
         main.step( "setup the ipv6NeighbourDiscovery" )
-        cfgResult1 = main.CLIs[0].setCfg( "org.onosproject.incubator.net.neighbour.impl.NeighbourResolutionManager", "ndpEnabled", "true" )
-        cfgResult2 = main.CLIs[0].setCfg( "org.onosproject.provider.host.impl.HostLocationProvider", "useIpv6ND", "true" )
+        cfgResult1 = main.CLIs[ 0 ].setCfg( "org.onosproject.incubator.net.neighbour.impl.NeighbourResolutionManager", "ndpEnabled", "true" )
+        cfgResult2 = main.CLIs[ 0 ].setCfg( "org.onosproject.provider.host.impl.HostLocationProvider", "useIpv6ND", "true" )
         cfgResult = cfgResult1 and cfgResult2
         utilities.assert_equals( expect=main.TRUE, actual=cfgResult,
-                                onpass="ipv6NeighborDiscovery cfg is set to true",
-                                onfail="Failed to cfg set ipv6NeighborDiscovery" )
+                                 onpass="ipv6NeighborDiscovery cfg is set to true",
+                                 onfail="Failed to cfg set ipv6NeighborDiscovery" )
 
         # Remove the first element in main.scale list
         main.scale.remove( main.scale[ 0 ] )
@@ -348,9 +347,9 @@
         main.step( "Discover all hosts using pingall " )
         stepResult = main.intentFunction.getHostsData( main )
         utilities.assert_equals( expect=main.TRUE,
-                                actual=stepResult,
-                                onpass="Successfully discovered hosts",
-                                onfail="Failed to discover hosts" )
+                                 actual=stepResult,
+                                 onpass="Successfully discovered hosts",
+                                 onfail="Failed to discover hosts" )
 
     def CASE16( self, main ):
         """
@@ -377,7 +376,7 @@
                                 "to start up fresh"
 
         main.step( "Stopping Mininet Topology" )
-        topoResult = main.Mininet1.stopNet( )
+        topoResult = main.Mininet1.stopNet()
         stepResult = topoResult
         utilities.assert_equals( expect=main.TRUE,
                                  actual=stepResult,
@@ -434,33 +433,33 @@
         main.step( "IPV6: Add host intents between h1 and h9" )
         stepResult = main.TRUE
         stepResult = main.intentFunction.hostIntent( main,
-                                              name='IPV6',
-                                              host1='h1',
-                                              host2='h9',
-                                              host1Id='00:00:00:00:00:01/-1',
-                                              host2Id='00:00:00:00:00:09/-1',
-                                              sw1='s5',
-                                              sw2='s2',
-                                              expectedLink=18 )
+                                                     name='IPV6',
+                                                     host1='h1',
+                                                     host2='h9',
+                                                     host1Id='00:00:00:00:00:01/-1',
+                                                     host2Id='00:00:00:00:00:09/-1',
+                                                     sw1='s5',
+                                                     sw2='s2',
+                                                     expectedLink=18 )
 
         utilities.assert_equals( expect=main.TRUE,
                                  actual=stepResult,
                                  onpass="IPV6: Host intent test successful " +
                                         "between two IPV6 hosts",
                                  onfail="IPV6: Host intent test failed " +
-                                        "between two IPV6 hosts")
+                                        "between two IPV6 hosts" )
 
         main.step( "DUALSTACK1: Add host intents between h3 and h11" )
         stepResult = main.TRUE
         stepResult = main.intentFunction.hostIntent( main,
-                                              name='DUALSTACK',
-                                              host1='h3',
-                                              host2='h11',
-                                              host1Id='00:00:00:00:00:03/-1',
-                                              host2Id='00:00:00:00:00:0B/-1',
-                                              sw1='s5',
-                                              sw2='s2',
-                                              expectedLink=18 )
+                                                     name='DUALSTACK',
+                                                     host1='h3',
+                                                     host2='h11',
+                                                     host1Id='00:00:00:00:00:03/-1',
+                                                     host2Id='00:00:00:00:00:0B/-1',
+                                                     sw1='s5',
+                                                     sw2='s2',
+                                                     expectedLink=18 )
 
         utilities.assert_equals( expect=main.TRUE,
                                  actual=stepResult,
@@ -474,11 +473,11 @@
         main.step( "1HOP: Add host intents between h1 and h3" )
         stepResult = main.TRUE
         stepResult = main.intentFunction.hostIntent( main,
-                                              name='1HOP',
-                                              host1='h1',
-                                              host2='h9',
-                                              host1Id='00:00:00:00:00:01/-1',
-                                              host2Id='00:00:00:00:00:09/-1')
+                                                     name='1HOP',
+                                                     host1='h1',
+                                                     host2='h9',
+                                                     host1Id='00:00:00:00:00:01/-1',
+                                                     host2Id='00:00:00:00:00:09/-1' )
 
         utilities.assert_equals( expect=main.TRUE,
                                  actual=stepResult,
@@ -492,14 +491,14 @@
         main.step( "VLAN: Add vlan host intents between h5 and h24" )
         stepResult = main.TRUE
         stepResult = main.intentFunction.hostIntent( main,
-                                              name='VLAN1',
-                                              host1='h5',
-                                              host2='h24',
-                                              host1Id='00:00:00:00:00:05/100',
-                                              host2Id='00:00:00:00:00:18/100',
-                                              sw1='s5',
-                                              sw2='s2',
-                                              expectedLink=18 )
+                                                     name='VLAN1',
+                                                     host1='h5',
+                                                     host2='h24',
+                                                     host1Id='00:00:00:00:00:05/100',
+                                                     host2Id='00:00:00:00:00:18/100',
+                                                     sw1='s5',
+                                                     sw2='s2',
+                                                     expectedLink=18 )
 
         utilities.assert_equals( expect=main.TRUE,
                                  actual=stepResult,
@@ -563,7 +562,7 @@
                                        host1="h1",
                                        host2="h9",
                                        deviceId1="of:0000000000000005/1",
-                                       deviceId2="of:0000000000000006/1")
+                                       deviceId2="of:0000000000000006/1" )
 
         utilities.assert_equals( expect=main.TRUE,
                                  actual=stepResult,
@@ -612,7 +611,7 @@
                                        ip2="",
                                        tcp1="",
                                        tcp2="",
-                                       expectedLink="")
+                                       expectedLink="" )
         utilities.assert_equals( expect=main.TRUE,
                                  actual=stepResult,
                                  onpass=main.assertReturnString,
@@ -621,7 +620,7 @@
         main.assertReturnString = "Assertion Result for SDNIP-ICMP IPV6 using ICMP point intents\n"
         mac1 = main.hostsData[ 'h1' ][ 'mac' ]
         mac2 = main.hostsData[ 'h9' ][ 'mac' ]
-        main.log.debug(mac2)
+        main.log.debug( mac2 )
         ipProto = main.params[ 'SDNIP' ][ 'icmpProto' ]
         ip1 = str( main.hostsData[ 'h1' ][ 'ipAddresses' ][ 0 ] ) + "/128"
         ip2 = str( main.hostsData[ 'h9' ][ 'ipAddresses' ][ 0 ] ) + "/128"
@@ -732,11 +731,11 @@
         main.step( "1HOP: Add point intents between h1 and h9" )
         main.assertReturnString = "Assertion Result for 1HOP IPV6 with no mac address point intents\n"
         stepResult = main.intentFunction.pointIntent( main,
-                                              name='1HOP',
-                                              host1="h1",
-                                              host2="h9",
-                                              deviceId1="of:0000000000000005/1",
-                                              deviceId2="of:0000000000000006/1")
+                                                      name='1HOP',
+                                                      host1="h1",
+                                                      host2="h9",
+                                                      deviceId1="of:0000000000000005/1",
+                                                      deviceId2="of:0000000000000006/1" )
         utilities.assert_equals( expect=main.TRUE,
                                  actual=stepResult,
                                  onpass=main.assertReturnString,
@@ -781,7 +780,7 @@
                                " OVS running in Mininet "
         main.step( "NOOPTION: Add single point to multi point intents" )
         hostNames = [ 'h1', 'h9', 'h17' ]
-        devices = [ 'of:0000000000000005/1','of:0000000000000006/1', 'of:0000000000000007/1' ]
+        devices = [ 'of:0000000000000005/1', 'of:0000000000000006/1', 'of:0000000000000007/1' ]
         main.assertReturnString = "Assertion results for IPV6 single to multi point intent with no options set\n"
         stepResult = main.TRUE
         stepResult = main.intentFunction.singleToMultiIntent(
@@ -791,7 +790,7 @@
                                          devices=devices,
                                          sw1="s5",
                                          sw2="s2",
-                                         expectedLink=18)
+                                         expectedLink=18 )
         utilities.assert_equals( expect=main.TRUE,
                                  actual=stepResult,
                                  onpass=main.assertReturnString,
@@ -800,7 +799,7 @@
         main.assertReturnString = "Assertion results for IPV6 single to multi point intent with IPV6 type and MAC addresses\n"
         hostNames = [ 'h1', 'h9', 'h17' ]
         devices = [ 'of:0000000000000005/1', 'of:0000000000000006/1', 'of:0000000000000007/1' ]
-        macs = [ '00:00:00:00:00:01','00:00:00:00:00:09' ,'00:00:00:00:00:11' ]
+        macs = [ '00:00:00:00:00:01', '00:00:00:00:00:09', '00:00:00:00:00:11' ]
         stepResult = main.TRUE
         stepResult = main.intentFunction.singleToMultiIntent(
                                          main,
@@ -810,7 +809,7 @@
                                          macs=macs,
                                          ethType="IPV6",
                                          sw1="",
-                                         sw2="")
+                                         sw2="" )
         utilities.assert_equals( expect=main.TRUE,
                                  actual=stepResult,
                                  onpass=main.assertReturnString,
@@ -827,7 +826,7 @@
                                          devices=devices,
                                          ethType="IPV6",
                                          sw1="",
-                                         sw2="")
+                                         sw2="" )
         utilities.assert_equals( expect=main.TRUE,
                                  actual=stepResult,
                                  onpass=main.assertReturnString,
@@ -836,7 +835,7 @@
         main.assertReturnString = "Assertion results for IPV6 single to multi point intent with IPV6 type and MAC addresses in the same VLAN\n"
         hostNames = [ 'h5', 'h24' ]
         devices = [ 'of:0000000000000005/5', 'of:0000000000000007/8' ]
-        macs = [ '00:00:00:00:00:05','00:00:00:00:00:18' ]
+        macs = [ '00:00:00:00:00:05', '00:00:00:00:00:18' ]
         stepResult = main.TRUE
         stepResult = main.intentFunction.singleToMultiIntent(
                                          main,
@@ -846,13 +845,13 @@
                                          macs=macs,
                                          ethType="IPV6",
                                          sw1="",
-                                         sw2="")
+                                         sw2="" )
         utilities.assert_equals( expect=main.TRUE,
                                  actual=stepResult,
                                  onpass=main.assertReturnString,
                                  onfail=main.assertReturnString )
         main.intentFunction.report( main )
-      
+
     def CASE4000( self, main ):
         """
             Add multi point to single point intents
@@ -893,7 +892,7 @@
         main.assertReturnString = "Assertion results for NOOPTION multi to single point intent\n"
         stepResult = main.TRUE
         hostNames = [ 'h17', 'h9' ]
-        devices = ['of:0000000000000007/1', 'of:0000000000000006/1' ]
+        devices = [ 'of:0000000000000007/1', 'of:0000000000000006/1' ]
         stepResult = main.intentFunction.multiToSingleIntent(
                                          main,
                                          name="NOOPTION",
@@ -910,7 +909,7 @@
         main.assertReturnString = "Assertion results for IPV6 multi to single point intent with IPV6 type and MAC addresses\n"
         hostNames = [ 'h1', 'h9', 'h17' ]
         devices = [ 'of:0000000000000005/1', 'of:0000000000000006/1', 'of:0000000000000007/1' ]
-        macs = [ '00:00:00:00:00:01','00:00:00:00:00:09' ,'00:00:00:00:00:11' ]
+        macs = [ '00:00:00:00:00:01', '00:00:00:00:00:09', '00:00:00:00:00:11' ]
         stepResult = main.TRUE
         installResult = main.intentFunction.multiToSingleIntent(
                                          main,
@@ -939,7 +938,7 @@
                                          ethType="IPV6",
                                          sw1="",
                                          sw2="",
-                                         expectedLink="")
+                                         expectedLink="" )
         utilities.assert_equals( expect=main.TRUE,
                                  actual=stepResult,
                                  onpass=main.assertReturnString,
@@ -949,7 +948,7 @@
         main.assertReturnString = "Assertion results for IPV6 multi to single point intent with IPV6 type and no MAC addresses in the same VLAN\n"
         hostNames = [ 'h5', 'h24' ]
         devices = [ 'of:0000000000000005/5', 'of:0000000000000007/8' ]
-        macs = [ '00:00:00:00:00:05','00:00:00:00:00:18' ]
+        macs = [ '00:00:00:00:00:05', '00:00:00:00:00:18' ]
         stepResult = main.TRUE
         stepResult = main.intentFunction.multiToSingleIntent(
                                          main,
@@ -960,7 +959,7 @@
                                          ethType="IPV6",
                                          sw1="",
                                          sw2="",
-                                         expectedLink="")
+                                         expectedLink="" )
         utilities.assert_equals( expect=main.TRUE,
                                  actual=stepResult,
                                  onpass=main.assertReturnString,
@@ -981,8 +980,8 @@
         main.step( "Testing host mobility by moving h1 from s5 to s6" )
         h1PreMove = main.hostsData[ "h1" ][ "location" ][ 0:19 ]
 
-        main.log.info( "Moving h1 from s5 to s6")
-        main.Mininet1.moveHostv6( "h1","s5","s6" )
+        main.log.info( "Moving h1 from s5 to s6" )
+        main.Mininet1.moveHostv6( "h1", "s5", "s6" )
         main.intentFunction.getHostsData( main )
         h1PostMove = main.hostsData[ "h1" ][ "location" ][ 0:19 ]
 
@@ -997,11 +996,11 @@
         main.assertReturnString = "Assert result for IPV6 host intent between h1, moved, and h9\n"
         stepResult = main.TRUE
         stepResult = main.intentFunction.hostIntent( main,
-                                              name='IPV6 Mobility IPV6',
-                                              host1='h1',
-                                              host2='h9',
-                                              host1Id='00:00:00:00:00:01/-1',
-                                              host2Id='00:00:00:00:00:09/-1')
+                                                     name='IPV6 Mobility IPV6',
+                                                     host1='h1',
+                                                     host2='h9',
+                                                     host1Id='00:00:00:00:00:01/-1',
+                                                     host2Id='00:00:00:00:00:09/-1' )
 
         utilities.assert_equals( expect=main.TRUE,
                                  actual=stepResult,
@@ -1048,7 +1047,7 @@
                                   point intent end point failure with IPV6 type and MAC addresses\n"
         hostNames = [ 'h8', 'h9', 'h17' ]
         devices = [ 'of:0000000000000005/8', 'of:0000000000000006/1', 'of:0000000000000007/1' ]
-        macs = [ '00:00:00:00:00:08','00:00:00:00:00:09' ,'00:00:00:00:00:11' ]        
+        macs = [ '00:00:00:00:00:08', '00:00:00:00:00:09', '00:00:00:00:00:11' ]
         testResult = main.TRUE
         testResult = main.intentFunction.testEndPointFail(
                                          main,
@@ -1101,7 +1100,7 @@
                                   point intent end point failure with IPV6 type and no MAC addresses in the same VLAN\n"
         hostNames = [ 'h5', 'h24' ]
         devices = [ 'of:0000000000000005/5', 'of:0000000000000007/8' ]
-        macs = [ '00:00:00:00:00:05','00:00:00:00:00:18' ]
+        macs = [ '00:00:00:00:00:05', '00:00:00:00:00:18' ]
         testResult = main.TRUE
         testResult = main.intentFunction.testEndPointFail(
                                          main,
@@ -1151,7 +1150,7 @@
                                   point intent end point failure with IPV6 type and MAC addresses\n"
         hostNames = [ 'h8', 'h9', 'h17' ]
         devices = [ 'of:0000000000000005/8', 'of:0000000000000006/1', 'of:0000000000000007/1' ]
-        macs = [ '00:00:00:00:00:08','00:00:00:00:00:09' ,'00:00:00:00:00:11' ]  
+        macs = [ '00:00:00:00:00:08', '00:00:00:00:00:09', '00:00:00:00:00:11' ]
         testResult = main.TRUE
         testResult = main.intentFunction.testEndPointFail(
                                          main,
@@ -1203,7 +1202,7 @@
                                   intent endpoint failure with IPV6 type and MAC addresses in the same VLAN\n"
         hostNames = [ 'h5', 'h24' ]
         devices = [ 'of:0000000000000005/5', 'of:0000000000000007/8' ]
-        macs = [ '00:00:00:00:00:05','00:00:00:00:00:18' ]
+        macs = [ '00:00:00:00:00:05', '00:00:00:00:00:18' ]
         testResult = main.TRUE
         testResult = main.intentFunction.testEndPointFail(
                                          main,
diff --git a/TestON/tests/FUNC/FUNCipv6Intent/dependencies/FUNCIpv6IntentFunction.py b/TestON/tests/FUNC/FUNCipv6Intent/dependencies/FUNCIpv6IntentFunction.py
old mode 100755
new mode 100644
index 863d406..511eb32
--- a/TestON/tests/FUNC/FUNCipv6Intent/dependencies/FUNCIpv6IntentFunction.py
+++ b/TestON/tests/FUNC/FUNCipv6Intent/dependencies/FUNCIpv6IntentFunction.py
@@ -7,9 +7,11 @@
 import copy
 import json
 
+
 def __init__( self ):
     self.default = ''
 
+
 def hostIntent( main,
                 name,
                 host1,
@@ -66,7 +68,6 @@
         Returns main.TRUE if all verification passed, otherwise return
         main.FALSE; returns main.FALSE if there is a key error
     """
-
     # Assert variables
     assert main, "There is no main variable"
     assert name, "variable name is empty"
@@ -80,7 +81,7 @@
     h2Mac = mac2
     vlan1 = vlan1
     vlan2 = vlan2
-    hostNames = [ host1 , host2 ]
+    hostNames = [ host1, host2 ]
     intentsId = []
     stepResult = main.TRUE
     pingResult = main.TRUE
@@ -152,10 +153,10 @@
         main.assertReturnString += 'Initial Flow State Failed\n'
 
     # Ping hosts
-    firstPingResult = main.Mininet1.ping6pair(SRC=hostNames[0], TARGET=main.hostsData[ host2 ][ 'ipAddresses' ][ 0 ])
+    firstPingResult = main.Mininet1.ping6pair( SRC=hostNames[ 0 ], TARGET=main.hostsData[ host2 ][ 'ipAddresses' ][ 0 ] )
     if not firstPingResult:
         main.log.debug( "First ping failed, there must be" +
-                       " something wrong with ONOS performance" )
+                        " something wrong with ONOS performance" )
 
     # Ping hosts again...
     pingTemp = ping6allHosts( main, hostNames )
@@ -267,6 +268,7 @@
 
     return stepResult
 
+
 def pointIntent( main,
                  name,
                  host1,
@@ -289,7 +291,6 @@
                  sw1="",
                  sw2="",
                  expectedLink=0 ):
-
     """
     Description:
         Verify add-point-intent
@@ -339,7 +340,6 @@
                        be two links lower than the links before the two
                        switches are down
     """
-
     assert main, "There is no main variable"
     assert name, "variable name is empty"
     assert host1 and host2, "You must specify hosts"
@@ -363,35 +363,35 @@
     # Adding bidirectional point  intents
     main.log.info( itemName + ": Adding point intents" )
     intent1 = main.CLIs[ onosNode ].addPointIntent( ingressDevice=deviceId1,
-                                             egressDevice=deviceId2,
-                                             portIngress=port1,
-                                             portEgress=port2,
-                                             ethType=ethType,
-                                             ethSrc=mac1,
-                                             ethDst=mac2,
-                                             bandwidth=bandwidth,
-                                             lambdaAlloc=lambdaAlloc,
-                                             ipProto=ipProto,
-                                             ipSrc=ip1,
-                                             ipDst=ip2,
-                                             tcpSrc=tcp1,
-                                             tcpDst=tcp2 )
+                                                    egressDevice=deviceId2,
+                                                    portIngress=port1,
+                                                    portEgress=port2,
+                                                    ethType=ethType,
+                                                    ethSrc=mac1,
+                                                    ethDst=mac2,
+                                                    bandwidth=bandwidth,
+                                                    lambdaAlloc=lambdaAlloc,
+                                                    ipProto=ipProto,
+                                                    ipSrc=ip1,
+                                                    ipDst=ip2,
+                                                    tcpSrc=tcp1,
+                                                    tcpDst=tcp2 )
 
     intentsId.append( intent1 )
     intent2 = main.CLIs[ onosNode ].addPointIntent( ingressDevice=deviceId2,
-                                             egressDevice=deviceId1,
-                                             portIngress=port2,
-                                             portEgress=port1,
-                                             ethType=ethType,
-                                             ethSrc=mac2,
-                                             ethDst=mac1,
-                                             bandwidth=bandwidth,
-                                             lambdaAlloc=lambdaAlloc,
-                                             ipProto=ipProto,
-                                             ipSrc=ip2,
-                                             ipDst=ip1,
-                                             tcpSrc=tcp2,
-                                             tcpDst=tcp1 )
+                                                    egressDevice=deviceId1,
+                                                    portIngress=port2,
+                                                    portEgress=port1,
+                                                    ethType=ethType,
+                                                    ethSrc=mac2,
+                                                    ethDst=mac1,
+                                                    bandwidth=bandwidth,
+                                                    lambdaAlloc=lambdaAlloc,
+                                                    ipProto=ipProto,
+                                                    ipSrc=ip2,
+                                                    ipDst=ip1,
+                                                    tcpSrc=tcp2,
+                                                    tcpDst=tcp1 )
     intentsId.append( intent2 )
 
     # Check intents state
@@ -527,6 +527,7 @@
 
     return stepResult
 
+
 def pointIntentTcp( main,
                     name,
                     host1,
@@ -549,7 +550,6 @@
                     sw1="",
                     sw2="",
                     expectedLink=0 ):
-
     """
     Description:
         Verify add-point-intent only for TCP
@@ -599,7 +599,6 @@
                        be two links lower than the links before the two
                        switches are down
     """
-
     assert main, "There is no main variable"
     assert name, "variable name is empty"
     assert host1 and host2, "You must specify hosts"
@@ -714,7 +713,7 @@
         main.assertReturnString += 'Initial Flow State Failed\n'
 
         # Run iperf to both host
-    iperfTemp = main.Mininet1.iperftcpipv6( host1,host2 )
+    iperfTemp = main.Mininet1.iperftcpipv6( host1, host2 )
     iperfResult = iperfResult and iperfTemp
     if iperfTemp:
         main.assertReturnString += 'Initial Iperf6 Passed\n'
@@ -744,7 +743,7 @@
             main.assertReturnString += 'Link Down Topology State Failed\n'
 
         # Run iperf to both host
-        iperfTemp = main.Mininet1.iperftcpipv6( host1,host2 )
+        iperfTemp = main.Mininet1.iperftcpipv6( host1, host2 )
         iperfResult = iperfResult and iperfTemp
         if iperfTemp:
             main.assertReturnString += 'Link Down Iperf6 Passed\n'
@@ -788,7 +787,7 @@
             main.assertReturnString += 'Link Up Topology State Failed\n'
 
         # Run iperf to both host
-        iperfTemp = main.Mininet1.iperftcpipv6( host1,host2,timeout=10 )
+        iperfTemp = main.Mininet1.iperftcpipv6( host1, host2, timeout=10 )
         iperfResult = iperfResult and iperfTemp
         if iperfTemp:
             main.assertReturnString += 'Link Up Iperf6 Passed\n'
@@ -821,6 +820,7 @@
 
     return stepResult
 
+
 def singleToMultiIntent( main,
                          name,
                          hostNames="",
@@ -843,8 +843,8 @@
     in the same order index wise. All devices in the list should have the same
     format, either all the devices have its port or it doesn't.
     eg. hostName = [ 'h1', 'h2' ,..  ]
-        devices = [ 'of:0000000000000001', 'of:0000000000000002', ...]
-        ports = [ '1', '1', ..]
+        devices = [ 'of:0000000000000001', 'of:0000000000000002', ... ]
+        ports = [ '1', '1', .. ]
         ...
     Description:
         Verify add-single-to-multi-intent iterates through the list of given
@@ -891,7 +891,6 @@
                        be two links lower than the links before the two
                        switches are down
     """
-
     assert main, "There is no main variable"
     assert hostNames, "You must specify hosts"
     assert devices or main.hostsData, "You must specify devices"
@@ -923,11 +922,11 @@
         devices = []
         main.log.info( "singleToMultiIntent function is using main.hostsData" )
         for host in hostNames:
-               devices.append( main.hostsData.get( host ).get( 'location' ) )
-               macsDict[ main.hostsData.get( host ).get( 'location' ) ] = \
-                           main.hostsData.get( host ).get( 'mac' )
-               ipDict[ main.hostsData.get( host ).get( 'location' ) ] = \
-                           main.hostsData.get( host ).get( 'ipAddresses' )
+            devices.append( main.hostsData.get( host ).get( 'location' ) )
+            macsDict[ main.hostsData.get( host ).get( 'location' ) ] = \
+                        main.hostsData.get( host ).get( 'mac' )
+            ipDict[ main.hostsData.get( host ).get( 'location' ) ] = \
+                        main.hostsData.get( host ).get( 'ipAddresses' )
 
     pingResult = main.TRUE
     intentResult = main.TRUE
@@ -961,7 +960,7 @@
             srcMac = ""
         else:
             srcMac = macsDict[ ingressDevice ]
-            if srcMac == None:
+            if srcMac is None:
                 main.log.debug( "There is no MAC in device - " + ingressDevice )
                 srcMac = ""
 
@@ -981,7 +980,6 @@
                                             tcpSrc="",
                                             tcpDst="" ) )
 
-
     # Check intents state
     time.sleep( main.checkIntentSleep )
     intentResult = checkIntentState( main, intentsId )
@@ -1007,10 +1005,10 @@
     else:
         main.assertReturnString += 'Initial Flow State Failed\n'
 
-    firstPingResult = main.Mininet1.ping6pair(SRC=hostNames[0], TARGET=main.hostsData[ hostNames[1] ][ 'ipAddresses' ][0])
+    firstPingResult = main.Mininet1.ping6pair( SRC=hostNames[ 0 ], TARGET=main.hostsData[ hostNames[ 1 ] ][ 'ipAddresses' ][ 0 ] )
     if not firstPingResult:
         main.log.debug( "First ping failed, there must be" +
-                       " something wrong with ONOS performance" )
+                        " something wrong with ONOS performance" )
 
     # Ping hosts again...
     pingTemp = ping6allHosts( main, hostNames )
@@ -1119,6 +1117,7 @@
 
     return stepResult
 
+
 def multiToSingleIntent( main,
                          name,
                          hostNames="",
@@ -1141,8 +1140,8 @@
     same order index wise. All devices in the list should have the same
     format, either all the devices have its port or it doesn't.
     eg. hostName = [ 'h1', 'h2' ,..  ]
-        devices = [ 'of:0000000000000001', 'of:0000000000000002', ...]
-        ports = [ '1', '1', ..]
+        devices = [ 'of:0000000000000001', 'of:0000000000000002', ... ]
+        ports = [ '1', '1', .. ]
         ...
     Description:
         Verify add-multi-to-single-intent
@@ -1189,7 +1188,6 @@
                        switches are down
         Note - Don't use more than 2 hosts for MultiToSingle Intent with no mac address option.
     """
-
     assert main, "There is no main variable"
     assert hostNames, "You must specify hosts"
     assert devices or main.hostsData, "You must specify devices"
@@ -1220,11 +1218,11 @@
         devices = []
         main.log.info( "multiToSingleIntent function is using main.hostsData" )
         for host in hostNames:
-               devices.append( main.hostsData.get( host ).get( 'location' ) )
-               macsDict[ main.hostsData.get( host ).get( 'location' ) ] = \
-                           main.hostsData.get( host ).get( 'mac' )
-               ipDict[ main.hostsData.get( host ).get( 'location' ) ] = \
-                           main.hostsData.get( host ).get( 'ipAddresses' )
+            devices.append( main.hostsData.get( host ).get( 'location' ) )
+            macsDict[ main.hostsData.get( host ).get( 'location' ) ] = \
+                        main.hostsData.get( host ).get( 'mac' )
+            ipDict[ main.hostsData.get( host ).get( 'location' ) ] = \
+                        main.hostsData.get( host ).get( 'ipAddresses' )
 
     pingResult = main.TRUE
     intentResult = main.TRUE
@@ -1258,7 +1256,7 @@
             dstMac = ""
         else:
             dstMac = macsDict[ egressDevice ]
-            if dstMac == None:
+            if dstMac is None:
                 main.log.debug( "There is no MAC in device - " + egressDevice )
                 dstMac = ""
 
@@ -1409,6 +1407,7 @@
 
     return stepResult
 
+
 def testEndPointFail( main,
                       name,
                       test="",
@@ -1433,7 +1432,6 @@
     """
     Test Multipoint Topology for Endpoint failures
     """
-
     assert main, "There is no main variable"
     assert hostNames, "You must specify hosts"
     assert devices or main.hostsData, "You must specify devices"
@@ -1464,11 +1462,11 @@
         devices = []
         main.log.info( "multiIntent function is using main.hostsData" )
         for host in hostNames:
-               devices.append( main.hostsData.get( host ).get( 'location' ) )
-               macsDict[ main.hostsData.get( host ).get( 'location' ) ] = \
-                           main.hostsData.get( host ).get( 'mac' )
-               ipDict[ main.hostsData.get( host ).get( 'location' ) ] = \
-                           main.hostsData.get( host ).get( 'ipAddresses' )
+            devices.append( main.hostsData.get( host ).get( 'location' ) )
+            macsDict[ main.hostsData.get( host ).get( 'location' ) ] = \
+                        main.hostsData.get( host ).get( 'mac' )
+            ipDict[ main.hostsData.get( host ).get( 'location' ) ] = \
+                        main.hostsData.get( host ).get( 'ipAddresses' )
 
     pingResult = main.TRUE
     intentResult = main.TRUE
@@ -1486,7 +1484,7 @@
     # Check flows count in each node
     checkFlowsCount( main )
 
-    if test=="MultipletoSingle":
+    if test == "MultipletoSingle":
         for i in range( len( devices ) ):
             egressDevice = devicesCopy[ i ]
             ingressDeviceList = copy.copy( devicesCopy )
@@ -1502,7 +1500,7 @@
                 dstMac = ""
             else:
                 dstMac = macsDict[ egressDevice ]
-                if dstMac == None:
+                if dstMac is None:
                     main.log.debug( "There is no MAC in device - " + egressDevice )
                     dstMac = ""
 
@@ -1522,8 +1520,7 @@
                                                 tcpSrc="",
                                                 tcpDst="" ) )
 
-
-    elif test=="SingletoMultiple":
+    elif test == "SingletoMultiple":
         for i in range( len( devices ) ):
             ingressDevice = devicesCopy[ i ]
             egressDeviceList = copy.copy( devicesCopy )
@@ -1539,7 +1536,7 @@
                 srcMac = ""
             else:
                 srcMac = macsDict[ ingressDevice ]
-                if srcMac == None:
+                if srcMac is None:
                     main.log.debug( "There is no MAC in device - " + ingressDevice )
                     srcMac = ""
 
@@ -1560,7 +1557,7 @@
                                                 tcpDst="" ) )
 
     else:
-        main.log.info("Invalid test Name - Type either SingletoMultiple or MultipletoSingle")
+        main.log.info( "Invalid test Name - Type either SingletoMultiple or MultipletoSingle" )
         return main.FALSE
 
     # Check intents state
@@ -1598,7 +1595,7 @@
 
     # Test rerouting if these variables exist
     if sw1 and sw2 and sw3 and sw4 and sw5 and expectedLink1 and expectedLink2:
-    # Take two links down
+        # Take two links down
         # Take first link down
         linkDownResult1 = link( main, sw1, sw2, "down" )
         if linkDownResult1:
@@ -1678,7 +1675,7 @@
             main.assertReturnString += 'Isolation Link Down Topology State Failed\n'
 
         # Ping hosts after isolation
-        main.log.info("Ping will fail if the node is isolated correctly.It will ping only after bringing up the isolation link")
+        main.log.info( "Ping will fail if the node is isolated correctly.It will ping only after bringing up the isolation link" )
         pingIsolation = ping6allHosts( main, hostNames )
         if pingIsolation:
             main.assertReturnString += 'Isolation Link Down Ping6all Passed\n'
@@ -1686,7 +1683,7 @@
             main.assertReturnString += 'Isolation Link Down Ping6all Failed\n'
 
         # Check intent state after isolation
-        main.log.info("Intent will be in FAILED state if the node is isolated correctly.It will be in INSTALLED state only after bringing up isolation link")
+        main.log.info( "Intent will be in FAILED state if the node is isolated correctly.It will be in INSTALLED state only after bringing up isolation link" )
         intentIsolation = checkIntentState( main, intentsId )
         if intentIsolation:
             main.assertReturnString += 'Isolation Link Down Intent State Passed\n'
@@ -1779,25 +1776,26 @@
 
     return testResult
 
+
 def ping6allHosts( main, hostList ):
     # Ping all host in the hosts list variable
     main.log.info( "Pinging: " + str( hostList ) )
     return main.Mininet1.pingIpv6Hosts( hostList )
 
+
 def getHostsData( main ):
     """
         Use fwd app and pingall to discover all the hosts
     """
-
     activateResult = main.TRUE
     appCheck = main.TRUE
     getDataResult = main.TRUE
     main.log.info( "Activating reactive forwarding app " )
     activateResult = main.CLIs[ 0 ].activateApp( "org.onosproject.fwd" )
-    main.CLIs[ 0 ].setCfg( "org.onosproject.provider.host.impl.HostLocationProvider", "useIpv6ND", "true")
+    main.CLIs[ 0 ].setCfg( "org.onosproject.provider.host.impl.HostLocationProvider", "useIpv6ND", "true" )
     main.CLIs[ 0 ].setCfg( "org.onosproject.incubator.net.neighbour.impl.NeighbourResolutionManager", "ndpEnabled", "true" )
-    main.CLIs[ 0 ].setCfg( "org.onosproject.fwd.ReactiveForwarding", "ipv6Forwarding", "true")
-    main.CLIs[ 0 ].setCfg( "org.onosproject.fwd.ReactiveForwarding", "matchIpv6Address", "true")
+    main.CLIs[ 0 ].setCfg( "org.onosproject.fwd.ReactiveForwarding", "ipv6Forwarding", "true" )
+    main.CLIs[ 0 ].setCfg( "org.onosproject.fwd.ReactiveForwarding", "matchIpv6Address", "true" )
     time.sleep( main.fwdSleep )
 
     for i in range( main.numCtrls ):
@@ -1806,7 +1804,7 @@
             main.log.warn( main.CLIs[ i ].apps() )
             main.log.warn( main.CLIs[ i ].appIDs() )
 
-    pingResult = main.Mininet1.pingall( protocol="IPv6", timeout = 600 )
+    pingResult = main.Mininet1.pingall( protocol="IPv6", timeout=600 )
     hostsJson = json.loads( main.CLIs[ 0 ].hosts() )
     hosts = main.Mininet1.getHosts().keys()
     for host in hosts:
@@ -1833,11 +1831,12 @@
 
     main.log.info( "Removing the automatically configured ipv6 link-local addresses in hostsData to avoid unnecessary ping with these addresses during initial ping test - link-local starts with 'fe' " )
     for host in main.hostsData.keys():
-     if main.hostsData[ host ].get( 'ipAddresses' ) != None:
-      main.hostsData[ host ][ 'ipAddresses' ] = [ v for v in main.hostsData[ host ][ 'ipAddresses' ] if not v.startswith('fe') ]
+        if main.hostsData[ host ].get( 'ipAddresses' ) is not None:
+            main.hostsData[ host ][ 'ipAddresses' ] = [ v for v in main.hostsData[ host ][ 'ipAddresses' ] if not v.startswith( 'fe' ) ]
     print main.hostsData
     return getDataResult
 
+
 def checkTopology( main, expectedLink ):
     statusResult = main.TRUE
     # Check onos topology
@@ -1853,12 +1852,12 @@
         main.log.info( itemName + ": Topology match" )
     return statusResult
 
+
 def checkIntentState( main, intentsId ):
     """
         This function will check intent state to make sure all the intents
         are in INSTALLED state
     """
-
     intentResult = main.TRUE
     results = []
 
@@ -1892,13 +1891,15 @@
 
     return intentResult
 
+
 def checkFlowsState( main ):
 
     main.log.info( itemName + ": Check flows state" )
     checkFlowsResult = main.CLIs[ 0 ].checkFlowsState()
     return checkFlowsResult
 
-def link( main, sw1, sw2, option):
+
+def link( main, sw1, sw2, option ):
 
     # link down
     main.log.info( itemName + ": Bring link " + option + "between " +
@@ -1906,11 +1907,11 @@
     linkResult = main.Mininet1.link( end1=sw1, end2=sw2, option=option )
     return linkResult
 
+
 def removeAllIntents( main, intentsId ):
     """
         Remove all intents in the intentsId
     """
-
     onosSummary = []
     removeIntentResult = main.TRUE
     # Remove intents
@@ -1938,11 +1939,11 @@
 
     return removeIntentResult
 
+
 def checkFlowsCount( main ):
     """
         Check flows count in each node
     """
-
     flowsCount = []
     main.log.info( itemName + ": Checking flows count in each ONOS node" )
     for i in range( main.numCtrls ):
@@ -1956,7 +1957,7 @@
             flowsCount.append( summaryJson.get( 'flows' ) )
 
     if flowsCount:
-        if all( flows==flowsCount[ 0 ] for flows in flowsCount ):
+        if all( flows == flowsCount[ 0 ] for flows in flowsCount ):
             main.log.info( itemName + ": There are " + str( flowsCount[ 0 ] ) +
                            " flows in all ONOS node" )
         else:
@@ -1969,6 +1970,7 @@
 
     return main.TRUE
 
+
 def checkLeaderChange( leaders1, leaders2 ):
     """
         Checks for a change in intent partition leadership.
@@ -1982,7 +1984,7 @@
     try:
         leaders1 = json.loads( leaders1 )
         leaders2 = json.loads( leaders2 )
-    except ( AttributeError, TypeError):
+    except ( AttributeError, TypeError ):
         main.log.exception( self.name + ": Object not as expected" )
         return main.FALSE
     except Exception:
@@ -1995,22 +1997,22 @@
         if "intent" in dict1.get( "topic", [] ):
             for dict2 in leaders2:
                 if dict1.get( "topic", 0 ) == dict2.get( "topic", 0 ) and \
-                    dict1.get( "leader", 0 ) != dict2.get( "leader", 0 ):
+                        dict1.get( "leader", 0 ) != dict2.get( "leader", 0 ):
                     mismatch = True
-                    main.log.error( "{0} changed leader from {1} to {2}".\
-                        format( dict1.get( "topic", "no-topic" ),\
-                            dict1.get( "leader", "no-leader" ),\
-                            dict2.get( "leader", "no-leader" ) ) )
+                    main.log.error( "{0} changed leader from {1} to {2}".
+                                    format( dict1.get( "topic", "no-topic" ),
+                                            dict1.get( "leader", "no-leader" ),
+                                            dict2.get( "leader", "no-leader" ) ) )
     if mismatch:
         return main.FALSE
     else:
         return main.TRUE
 
+
 def report( main ):
     """
     Report errors/warnings/exceptions
     """
-
     main.ONOSbench.logReport( main.ONOSip[ 0 ],
                               [ "INFO",
                                 "FOLLOWER",
@@ -2023,17 +2025,17 @@
     main.log.info( "ERROR report: \n" )
     for i in range( main.numCtrls ):
         main.ONOSbench.logReport( main.ONOSip[ i ],
-                [ "ERROR" ],
-                "d" )
+                                  [ "ERROR" ],
+                                  "d" )
 
     main.log.info( "EXCEPTIONS report: \n" )
     for i in range( main.numCtrls ):
         main.ONOSbench.logReport( main.ONOSip[ i ],
-                [ "Except" ],
-                "d" )
+                                  [ "Except" ],
+                                  "d" )
 
     main.log.info( "WARNING report: \n" )
     for i in range( main.numCtrls ):
         main.ONOSbench.logReport( main.ONOSip[ i ],
-                [ "WARN" ],
-                "d" )
+                                  [ "WARN" ],
+                                  "d" )
diff --git a/TestON/tests/FUNC/FUNCipv6Intent/dependencies/startUp.py b/TestON/tests/FUNC/FUNCipv6Intent/dependencies/startUp.py
index 2ec1ae4..8122586 100644
--- a/TestON/tests/FUNC/FUNCipv6Intent/dependencies/startUp.py
+++ b/TestON/tests/FUNC/FUNCipv6Intent/dependencies/startUp.py
@@ -1,16 +1,15 @@
 """
     This wrapper function is use for starting up onos instance
 """
-
 import time
 import os
 import json
 
+
 def onosBuild( main, gitBranch ):
     """
         This includes pulling ONOS and building it using maven install
     """
-
     buildResult = main.FALSE
 
     # Git checkout a branch of ONOS
@@ -18,10 +17,10 @@
     # Does the git pull on the branch that was checked out
     if not checkOutResult:
         main.log.warn( "Failed to checked out " + gitBranch +
-                                           " branch")
+                                           " branch" )
     else:
         main.log.info( "Successfully checked out " + gitBranch +
-                                           " branch")
+                                           " branch" )
     gitPullResult = main.ONOSbench.gitPull()
     if gitPullResult == main.ERROR:
         main.log.error( "Error pulling git branch" )
diff --git a/TestON/tests/FUNC/FUNCipv6Intent/dependencies/topo.py b/TestON/tests/FUNC/FUNCipv6Intent/dependencies/topo.py
index d834a09..7217d4d 100644
--- a/TestON/tests/FUNC/FUNCipv6Intent/dependencies/topo.py
+++ b/TestON/tests/FUNC/FUNCipv6Intent/dependencies/topo.py
@@ -1,11 +1,11 @@
 """
     These functions can be used for topology comparisons
 """
-
 import time
 import os
 import json
 
+
 def getAllDevices( main ):
     """
         Return a list containing the devices output from each ONOS node
@@ -13,9 +13,9 @@
     devices = []
     threads = []
     for i in range( main.numCtrls ):
-        t = main.Thread( target=main.CLIs[i].devices,
+        t = main.Thread( target=main.CLIs[ i ].devices,
                          name="devices-" + str( i ),
-                         args=[ ] )
+                         args=[] )
         threads.append( t )
         t.start()
 
@@ -24,6 +24,7 @@
         devices.append( t.result )
     return devices
 
+
 def getAllHosts( main ):
     """
         Return a list containing the hosts output from each ONOS node
@@ -32,9 +33,9 @@
     ipResult = main.TRUE
     threads = []
     for i in range( main.numCtrls ):
-        t = main.Thread( target=main.CLIs[i].hosts,
+        t = main.Thread( target=main.CLIs[ i ].hosts,
                          name="hosts-" + str( i ),
-                         args=[ ] )
+                         args=[] )
         threads.append( t )
         t.start()
 
@@ -43,6 +44,7 @@
         hosts.append( t.result )
     return hosts
 
+
 def getAllPorts( main ):
     """
         Return a list containing the ports output from each ONOS node
@@ -50,9 +52,9 @@
     ports = []
     threads = []
     for i in range( main.numCtrls ):
-        t = main.Thread( target=main.CLIs[i].ports,
+        t = main.Thread( target=main.CLIs[ i ].ports,
                          name="ports-" + str( i ),
-                         args=[ ] )
+                         args=[] )
         threads.append( t )
         t.start()
 
@@ -61,6 +63,7 @@
         ports.append( t.result )
     return ports
 
+
 def getAllLinks( main ):
     """
         Return a list containing the links output from each ONOS node
@@ -68,9 +71,9 @@
     links = []
     threads = []
     for i in range( main.numCtrls ):
-        t = main.Thread( target=main.CLIs[i].links,
+        t = main.Thread( target=main.CLIs[ i ].links,
                          name="links-" + str( i ),
-                         args=[ ] )
+                         args=[] )
         threads.append( t )
         t.start()
 
@@ -79,6 +82,7 @@
         links.append( t.result )
     return links
 
+
 def getAllClusters( main ):
     """
         Return a list containing the clusters output from each ONOS node
@@ -86,9 +90,9 @@
     clusters = []
     threads = []
     for i in range( main.numCtrls ):
-        t = main.Thread( target=main.CLIs[i].clusters,
+        t = main.Thread( target=main.CLIs[ i ].clusters,
                          name="clusters-" + str( i ),
-                         args=[ ] )
+                         args=[] )
         threads.append( t )
         t.start()
 
