changes in static tests after the initial code pushed

Change-Id: I7e11ea8ec818b952aca824ae84069f99aa794fd0
diff --git a/TestON/drivers/common/cli/networkdriver.py b/TestON/drivers/common/cli/networkdriver.py
index daa30e8..89edfb3 100755
--- a/TestON/drivers/common/cli/networkdriver.py
+++ b/TestON/drivers/common/cli/networkdriver.py
@@ -358,7 +358,7 @@
         except Exception:
             main.log.error( self.name + ": failed to get host MAC address" )
 
-    def runCmdOnHost( self, hostName, cmd ):
+    def runCmdOnHost( self, hostName, cmd, debug=False ):
         """
         Run shell command on specified host and return output
         Required:
@@ -367,7 +367,7 @@
         """
         hostComponent = self.hosts[ hostName ]
         if hostComponent:
-            return hostComponent.command( cmd )
+            return hostComponent.command( cmd, debug )
         return None
 
     def assignSwController( self, sw, ip, port="6653", ptcp="" ):
@@ -1080,7 +1080,7 @@
                     cmd = "sudo /usr/sbin/arping -c 1 -w {} {} {} {}".format( wait, intfStr, srcIp, dstIp )
                     main.log.debug( "Sending IPv4 arping from host {}".format( host ) )
                 elif self.getIPAddress( host, proto='IPV6' ):
-                    flushCmd = "sudo ip -6 neigh flush all"
+                    flushCmd = "sudo /sbin/ip -6 neigh flush all"
                     intf = hosts[host]['interfaces'][0]['name']
                     cmd = "ndisc6 -r 1 -w {} {} {}".format( wait, dstIp6, intf )
                     main.log.debug( "Sending IPv6 ND from host {}".format( host ) )
diff --git a/TestON/drivers/common/cli/onosclidriver.py b/TestON/drivers/common/cli/onosclidriver.py
index bafa284..2447717 100755
--- a/TestON/drivers/common/cli/onosclidriver.py
+++ b/TestON/drivers/common/cli/onosclidriver.py
@@ -36,6 +36,7 @@
 shreya@onlab.us
 jeremyr@opennetworking.org
 """
+import ipaddress
 import pexpect
 import re
 import json
@@ -1350,7 +1351,7 @@
             main.log.exception( self.name + ": Uncaught exception" )
             return None
 
-    def verifyHostIp( self, hostList=[], prefix="" ):
+    def verifyHostIp( self, hostList=[], prefix="", prefixLength=24 ):
         """
         Description:
             Verify that all hosts have IP address assigned to them
@@ -1365,19 +1366,28 @@
         """
         try:
             hosts = self.hosts()
-            hosts = json.loads( hosts )
+            hosts = json.loads( hosts, "utf-8" )
             if not hostList:
                 hostList = [ host[ "id" ] for host in hosts ]
+            hostList = [ str( h.lower() ) for h in hostList ]
             for host in hosts:
                 hostId = host[ "id" ]
-                if hostId not in hostList:
+                hostId = str( hostId.lower() )
+                match = False
+                for onosHostId in hostList:
+                    if onosHostId == hostId:
+                        match = True
+                if not match:
                     continue
                 ipList = host[ "ipAddresses" ]
                 main.log.debug( self.name + ": IP list on host " + str( hostId ) + ": " + str( ipList ) )
                 if not ipList:
                     main.log.warn( self.name + ": Failed to discover any IP addresses on host " + str( hostId ) )
                 else:
-                    if not any( ip.startswith( str( prefix ) ) for ip in ipList ):
+                    # if no hostIp in subnet: Get warning otherwise remove hostId from hostList
+                    subnetString = u"%s/%s" % (prefix, prefixLength)
+                    subnet =  ipaddress.ip_network( subnetString, strict=False )
+                    if not any( ipaddress.ip_address( ip ) in subnet for ip in ipList ):
                         main.log.warn( self.name + ": None of the IPs on host " + str( hostId ) + " has prefix " + str( prefix ) )
                     else:
                         main.log.debug( self.name + ": Found matching IP on host " + str( hostId ) )