WIP Case200 : IPV6 testcase implementation

Do not merge.

Add the test case for the IPV6 1HOP testing.
Add the test case for the SDNIP testting (facing issue in
intent intsallation).
Modified teh mininet driver to retrieve the IPv6 address.

Signed-off-by: subhash kumar singh <subhash_singh@criterionnetworks.com>
Signed-off-by: sathishm <sathishm@criterionnetworks.com>

Change-Id: I2e0a504a92cb8ee15609b544331d448657223abc
diff --git a/TestON/tests/FUNCipv6Intent/Dependency/FUNCIpv6IntentFunction.py b/TestON/tests/FUNCipv6Intent/Dependency/FUNCIpv6IntentFunction.py
index ec1ae9c..6930ef3 100644
--- a/TestON/tests/FUNCipv6Intent/Dependency/FUNCIpv6IntentFunction.py
+++ b/TestON/tests/FUNCipv6Intent/Dependency/FUNCIpv6IntentFunction.py
@@ -117,11 +117,10 @@
         return main.FALSE
 
     # Discover hosts using arping incase pingall discovery failed
-    main.log.info( itemName + ": Discover host using arping" )
-    main.Mininet1.arping( srcHost=host1, dstHost=host2 )
-    main.Mininet1.arping( srcHost=host2, dstHost=host1 )
-    host1 = main.CLIs[ 0 ].getHost( mac=h1Mac )
-    host2 = main.CLIs[ 0 ].getHost( mac=h2Mac )
+    #main.log.info( itemName + ": Discover host using pingall" )
+    #main.Mininet1.pingall( protocol='IPv6' )
+    #host1 = main.CLIs[ 0 ].getHost( mac=h1Mac )
+    #host2 = main.CLIs[ 0 ].getHost( mac=h2Mac )
 
     # Check flows count in each node
     checkFlowsCount( main )
@@ -147,13 +146,14 @@
     checkFlowsState( main )
 
     # Ping hosts
-    firstPingResult = pingallHosts( main, hostNames )
+    #firstPingResult = ping6allHosts( main, hostNames )
+    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" )
 
     # Ping hosts again...
-    pingTemp = pingallHosts( main, hostNames )
+    pingTemp = main.Mininet1.ping6pair(SRC=hostNames[0], TARGET=main.hostsData[ host2 ][ 'ipAddresses' ][ 0 ])
     pingResult = pingResult and pingTemp
     if pingTemp:
         main.assertReturnString += 'Initial Pingall Passed\n'
@@ -405,7 +405,7 @@
     checkFlowsState( main )
 
     # Ping hosts
-    pingTemp = main.Mininet1.ping6pair(SRC=host1, TARGET='10:1:0::5')
+    pingTemp = main.Mininet1.ping6pair(SRC=host1, TARGET=main.hostsData[ host2 ][ 'ipAddresses' ][ 0 ])
     pingResult = pingResult and pingTemp
     if pingTemp:
         main.assertReturnString += 'Initial Ping6 pair Passed\n'
@@ -687,7 +687,7 @@
     checkFlowsState( main )
 
     # Run iperf to both host
-    iperfTemp = main.Mininet1.iperftcp( host1,host2,10 )
+    iperfTemp = main.Mininet1.iperftcp( host1,host2,timeout=10 )
     iperfResult = iperfResult and iperfTemp
     if iperfTemp:
         main.assertReturnString += 'Initial Iperf Passed\n'
@@ -717,7 +717,7 @@
             main.assertReturnString += 'Link Down Topology State Failed\n'
 
         # Run iperf to both host
-        iperfTemp = main.Mininet1.iperftcp( host1,host2,10 )
+        iperfTemp = main.Mininet1.iperftcp( host1,host2,timeout=10 )
         iperfResult = iperfResult and iperfTemp
         if iperfTemp:
             main.assertReturnString += 'Link Down Iperf Passed\n'
@@ -761,7 +761,7 @@
             main.assertReturnString += 'Link Up Topology State Failed\n'
 
         # Run iperf to both host
-        iperfTemp = main.Mininet1.iperftcp( host1,host2,10 )
+        iperfTemp = main.Mininet1.iperftcp( host1,host2,timeout=10 )
         iperfResult = iperfResult and iperfTemp
         if iperfTemp:
             main.assertReturnString += 'Link Up Iperf Passed\n'
@@ -1392,6 +1392,10 @@
     getDataResult = main.TRUE
     main.log.info( "Activating reactive forwarding app " )
     activateResult = main.CLIs[ 0 ].activateApp( "org.onosproject.fwd" )
+    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 ):
@@ -1400,7 +1404,7 @@
             main.log.warn( main.CLIs[ i ].apps() )
             main.log.warn( main.CLIs[ i ].appIDs() )
 
-    pingResult = main.Mininet1.pingall( timeout = 600 )
+    pingResult = main.Mininet1.pingall( protocol="IPv6", timeout = 600 )
     hostsJson = json.loads( main.CLIs[ 0 ].hosts() )
     hosts = main.Mininet1.getHosts().keys()
     # TODO: Make better use of new getHosts function
diff --git a/TestON/tests/FUNCipv6Intent/Dependency/newFuncTopo.py b/TestON/tests/FUNCipv6Intent/Dependency/newFuncTopo.py
index ff63bf9..d4731f3 100755
--- a/TestON/tests/FUNCipv6Intent/Dependency/newFuncTopo.py
+++ b/TestON/tests/FUNCipv6Intent/Dependency/newFuncTopo.py
@@ -48,52 +48,38 @@
         # Initialize topology
         Topo.__init__( self )
         # Switch S5 Hosts
-        # IPv4 only Host
         host1=self.addHost( 'h1', cls=IPv6Host, v6Addr='10:1:0::1/64' )
-        # IPv6 only Host
         host2=self.addHost( 'h2', cls=IPv6Host, v6Addr='1000::2/64' )
         # Dual Stack Host
-        host3=self.addHost( 'h3', cls=IPv6Host, v6Addr='2000::2/64' )
-        # VLAN hosts
+        host3=self.addHost( 'h3', cls=dualStackHost, v6Addr='2000::2/64' )
         host4=self.addHost( 'h4', cls=IPv6Host, v6Addr='3000::2/64' )
-        host5=self.addHost( 'h5', cls=IPv6Host,v6Addr='4000::2/64' )
-        # VPN-1 and VPN-2 Hosts
+        #VLAN
+        host5=self.addHost( 'h5', cls=VLANHost,v6Addr='4000::2/64' )
         host6=self.addHost( 'h6', cls=IPv6Host, v6Addr='11:1:0::2/64' )
         host7=self.addHost( 'h7', cls=IPv6Host, v6Addr='12:1:0::2/64' )
-        # Multicast Sender
         host8=self.addHost( 'h8', cls=IPv6Host, v6Addr='10:1:0::4/64' )
 
         # Switch S6 Hosts
-        # IPv4 only Host
         host9=self.addHost( 'h9', cls=IPv6Host, v6Addr='10:1:0::5/64' )
-        # IPv6 only Host
         host10=self.addHost( 'h10', cls=IPv6Host, v6Addr='1000::3/64' )
         # Dual Stack Host
-        host11=self.addHost( 'h11', cls=IPv6Host, v6Addr='2000::3/64' )
-        # VLAN hosts
+        host11=self.addHost( 'h11', cls=dualStackHost, v6Addr='2000::3/64' )
         host12=self.addHost( 'h12', cls=IPv6Host, v6Addr='3000::3/64' )
         host13=self.addHost( 'h13', cls=IPv6Host, v6Addr='4000::3/64' )
-        # VPN-1 and VPN-2 Hosts
         host14=self.addHost( 'h14', cls=IPv6Host, v6Addr='11:1:0::3/64' )
         host15=self.addHost( 'h15', cls=IPv6Host, v6Addr='12:1:0::3/64' )
-        # Multicast Receiver
         host16=self.addHost( 'h16', cls=IPv6Host, v6Addr='10:1:0::7/64' )
 
         # Switch S7 Hosts
-        # IPv4 only Host
         host17=self.addHost( 'h17', cls=IPv6Host, v6Addr='10:1:0::8/64' )
-        # IPv6 only Host
         host18=self.addHost( 'h18', cls=IPv6Host, v6Addr='1000::4/64' )
-        # Dual Stack Host
         host19=self.addHost( 'h19', cls=IPv6Host, v6Addr='10:1:0::9/64' )
-        # VLAN hosts
         host20=self.addHost( 'h20', cls=IPv6Host, v6Addr='100:1:0::4/64' )
         host21=self.addHost( 'h21', cls=IPv6Host, v6Addr='200:1:0::4/64' )
-        # VPN-1 and VPN-2 Hosts
         host22=self.addHost( 'h22', cls=IPv6Host, v6Addr='11:1:0::4/64' )
         host23=self.addHost( 'h23', cls=IPv6Host, v6Addr='12:1:0::4/64' )
-        # Multicast Receiver
-        host24=self.addHost( 'h24', cls=IPv6Host, v6Addr='10:1:0::10/64' )
+        # VLAN 
+        host24=self.addHost( 'h24', cls=VLANHost, v6Addr='4000::5/64' )
 
         s1 = self.addSwitch( 's1' )
         s2 = self.addSwitch( 's2' )