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/FUNCipv6Intent.py b/TestON/tests/FUNCipv6Intent/FUNCipv6Intent.py
index 9ee99fb..1c91540 100644
--- a/TestON/tests/FUNCipv6Intent/FUNCipv6Intent.py
+++ b/TestON/tests/FUNCipv6Intent/FUNCipv6Intent.py
@@ -166,7 +166,7 @@
                                  onpass="Successfully applied cell to " + \
                                         "environment",
                                  onfail="Failed to apply cell to environment " )
-
+ 
         main.step( "Creating ONOS package" )
         packageResult = main.ONOSbench.onosPackage()
         stepResult = packageResult
@@ -237,7 +237,7 @@
                                  onfail="Failed to start ONOS cli" )
 
         main.step( "Checking that ONOS is ready" )
-        for i in range( 10 ):
+        for i in range( 3 ):
             ready = True
             for i in range( int( main.scale[ 0 ] ) ):
                 output = main.CLIs[ i ].summary()
@@ -334,6 +334,20 @@
                                  onfail="Failed to assign switches to " +
                                         "controller" )
 
+    def CASE13( self, main ):
+        """
+        Discover all hosts and store its data to a dictionary
+        """
+        main.case( "Discover all hosts" )
+
+        stepResult = main.TRUE
+        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" )
+
     def CASE14( self, main ):
         """
             Stop mininet
@@ -413,7 +427,7 @@
                                  actual=stepResult,
                                  onpass=main.assertReturnString,
                                  onfail=main.assertReturnString )
-
+        """
         stepResult = main.TRUE
         main.step( "IPV6: Add point intents between h1 and h9" )
         main.assertReturnString = "Assertion Result for IPV6 point intent\n"
@@ -463,24 +477,27 @@
                                  actual=stepResult,
                                  onpass=main.assertReturnString,
                                  onfail=main.assertReturnString )
-        """
+        
         main.step( "SDNIP-ICMP: Add point intents between h1 and h9" )
-        main.assertReturnString = "Assertion Result for SDNIP-ICMP IPV4 using TCP point intents\n"
+        main.assertReturnString = "Assertion Result for SDNIP-ICMP IPV6 using ICMP point intents\n"
         mac1 = main.hostsData[ 'h1' ][ 'mac' ]
         mac2 = main.hostsData[ 'h9' ][ 'mac' ]
-        try:
-            ip1 = str( main.hostsData[ 'h1' ][ 'ipAddresses' ][ 0 ] ) + "/24"
-            ip2 = str( main.hostsData[ 'h9' ][ 'ipAddresses' ][ 0 ] ) + "/24"
-        except KeyError:
-            main.log.debug( "Key Error getting IP addresses of h1 | h9 in" +
-                            "main.hostsData" )
-            ip1 = main.Mininet1.getIPAddress( 'h1')
-            ip2 = main.Mininet1.getIPAddress( 'h9')
+        main.log.debug(mac2)
+
+        # TODO : Fix is IPv6 arg format
+        # when we install the intent "add-point-intent --ethType IPV6 --ethSrc 00:00:00:00:00:01 
+        # --ethDst 00:00:00:00:00:09 --ipProto 1 --ipSrc 10:1::1/128 --ipDst 10:1::5/128 
+        # of:0000000000000005/1 of:0000000000000006/1" controller reports following error :
+        # Malformed IP prefix string: 10:1::1. Address must take form "x.x.x.x/y" or "xxxx:xxxx:xxxx:xxxx:xxxx:xxxx:xxxx:xxxx/y"
+        #ip1 = main.Mininet1.getIPAddress( 'h1', proto='IPV6' )
+        #ip2 = main.Mininet1.getIPAddress( 'h9', proto='IPV6')
 
         ipProto = main.params[ 'SDNIP' ][ 'icmpProto' ]
         # Uneccessary, not including this in the selectors
-        tcp1 = main.params[ 'SDNIP' ][ 'srcPort' ]
-        tcp2 = main.params[ 'SDNIP' ][ 'dstPort' ]
+        #tcp1 = main.params[ 'SDNIP' ][ 'srcPort' ]
+        #tcp2 = main.params[ 'SDNIP' ][ 'dstPort' ]
+        ip1 = str( main.hostsData[ 'h1' ][ 'ipAddresses' ][ 0 ] ) + "/128"
+        ip2 = str( main.hostsData[ 'h9' ][ 'ipAddresses' ][ 0 ] ) + "/128"
 
         stepResult = main.intentFunction.pointIntent(
                                            main,
@@ -500,13 +517,13 @@
                                  actual=stepResult,
                                  onpass=main.assertReturnString,
                                  onfail=main.assertReturnString )
-
+        """
         main.step( "SDNIP-TCP: Add point intents between h1 and h9" )
-        main.assertReturnString = "Assertion Result for SDNIP-TCP IPV4 using ICMP point intents\n"
-        mac1 = main.hostsData[ 'h1' ][ 'mac' ]
-        mac2 = main.hostsData[ 'h9' ][ 'mac' ]
-        ip1 = str( main.hostsData[ 'h1' ][ 'ipAddresses' ][ 0 ] ) + "/32"
-        ip2 = str( main.hostsData[ 'h9' ][ 'ipAddresses' ][ 0 ] ) + "/32"
+        main.assertReturnString = "Assertion Result for SDNIP-TCP IPV6 using TCP point intents\n"
+        mac1 = main.hostsData[ 'h3' ][ 'mac' ]
+        mac2 = main.hostsData[ 'h11' ][ 'mac' ]
+        ip1 = str( main.hostsData[ 'h3' ][ 'ipAddresses' ][ 0 ] ) + "/128"
+        ip2 = str( main.hostsData[ 'h11' ][ 'ipAddresses' ][ 0 ] ) + "/128"
         ipProto = main.params[ 'SDNIP' ][ 'tcpProto' ]
         tcp1 = main.params[ 'SDNIP' ][ 'srcPort' ]
         tcp2 = main.params[ 'SDNIP' ][ 'dstPort' ]
@@ -514,10 +531,10 @@
         stepResult = main.intentFunction.pointIntentTcp(
                                            main,
                                            name="SDNIP-TCP",
-                                           host1="h1",
-                                           host2="h9",
-                                           deviceId1="of:0000000000000005/1",
-                                           deviceId2="of:0000000000000006/1",
+                                           host1="h3",
+                                           host2="h11",
+                                           deviceId1="of:0000000000000005/3",
+                                           deviceId2="of:0000000000000006/3",
                                            mac1=mac1,
                                            mac2=mac2,
                                            ethType="IPV4",
@@ -528,22 +545,22 @@
                                            tcp2=tcp2 )
 
         utilities.assert_equals( expect=main.TRUE,
-                             actual=stepResult,
+                                 actual=stepResult,
                                  onpass=main.assertReturnString,
                                  onfail=main.assertReturnString )
-
+        """
         main.step( "DUALSTACK1: Add point intents between h3 and h11" )
-        main.assertReturnString = "Assertion Result for Dualstack1 IPV4 with mac address point intents\n"
+        main.assertReturnString = "Assertion Result for Dualstack1 IPV6 with mac address point intents\n"
         stepResult = main.intentFunction.pointIntent(
                                        main,
                                        name="DUALSTACK1",
                                        host1="h3",
                                        host2="h11",
-                                       deviceId1="of:0000000000000005",
-                                       deviceId2="of:0000000000000006",
-                                       port1="3",
-                                       port2="3",
-                                       ethType="IPV4",
+                                       deviceId1="of:0000000000000005/3",
+                                       deviceId2="of:0000000000000006/3",
+                                       port1="",
+                                       port2="",
+                                       ethType="IPV6",
                                        mac1="00:00:00:00:00:03",
                                        mac2="00:00:00:00:00:0B",
                                        bandwidth="",
@@ -553,8 +570,8 @@
                                        ip2="",
                                        tcp1="",
                                        tcp2="",
-                                       sw1="s5",
-                                       sw2="s2",
+                                       sw1="",
+                                       sw2="",
                                        expectedLink=18 )
 
         utilities.assert_equals( expect=main.TRUE,
@@ -562,20 +579,20 @@
                                  onpass=main.assertReturnString,
                                  onfail=main.assertReturnString )
 
-        main.step( "VLAN: Add point intents between h5 and h21" )
-        main.assertReturnString = "Assertion Result for VLAN IPV4 with mac address point intents\n"
+        main.step( "VLAN: Add point intents between h5 and h24" )
+        main.assertReturnString = "Assertion Result for VLAN IPV6 with mac address point intents\n"
         stepResult = main.intentFunction.pointIntent(
                                        main,
                                        name="VLAN",
                                        host1="h5",
-                                       host2="h21",
+                                       host2="h24",
                                        deviceId1="of:0000000000000005/5",
-                                       deviceId2="of:0000000000000007/5",
+                                       deviceId2="of:0000000000000007/8",
                                        port1="",
                                        port2="",
-                                       ethType="IPV4",
+                                       ethType="IPV6",
                                        mac1="00:00:00:00:00:05",
-                                       mac2="00:00:00:00:00:15",
+                                       mac2="00:00:00:00:00:18",
                                        bandwidth="",
                                        lambdaAlloc=False,
                                        ipProto="",
@@ -583,17 +600,17 @@
                                        ip2="",
                                        tcp1="",
                                        tcp2="",
-                                       sw1="s5",
-                                       sw2="s2",
+                                       sw1="",
+                                       sw2="",
                                        expectedLink=18 )
 
         utilities.assert_equals( expect=main.TRUE,
                                  actual=stepResult,
                                  onpass=main.assertReturnString,
                                  onfail=main.assertReturnString )
-
-        main.step( "1HOP: Add point intents between h1 and h3" )
-        main.assertReturnString = "Assertion Result for 1HOP IPV4 with no mac address point intents\n"
+        
+        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.hostIntent( main,
                                               name='1HOP',
                                               host1='h1',