added cli option onoscell & updated setCell

Change-Id: I5add9bf26475173716bc59ec74946f08ff6c99bd
diff --git a/TestON/bin/cli.py b/TestON/bin/cli.py
index a02871b..1b8bdbd 100755
--- a/TestON/bin/cli.py
+++ b/TestON/bin/cli.py
@@ -255,7 +255,7 @@
         try :
             for index, option in enumerate(args):
                 if index > 0 :
-                    if re.match("logdir|mail|example|testdir|testcases", option, flags = 0):
+                    if re.match("logdir|mail|example|testdir|testcases|onoscell", option, flags = 0):
                         index = index+1
                         options[option] = args[index]
                         options = self.testcasesInRange(index,option,args,options)
@@ -275,6 +275,7 @@
         options['example'] = None
         options['testdir'] = None
         options['testcases'] = None
+        options['onoscell'] = None
         return options   
     
     def testcasesInRange(self,index,option,args,options):
diff --git a/TestON/core/teston.py b/TestON/core/teston.py
index 7e99ffd..ff973ed 100644
--- a/TestON/core/teston.py
+++ b/TestON/core/teston.py
@@ -628,6 +628,7 @@
     verifyLogdir(options)
     verifyMail(options)
     verifyTestCases(options)
+    verifyOnosCell(options)
 
 def verifyTest(options):
     if options.testname:
@@ -692,6 +693,13 @@
             print "testcases not specifed in params, please provide in params file or 'testcases' commandline argument"
             sys.exit()
 
+def verifyOnosCell(options):
+    # Verifying onoscell option. This could be extended to do even more from here.
+    if options.onoscell:
+        main.onoscell = options.onoscell
+    else :
+        main.onoscell = main.FALSE
+
 def verifyTestScript(options):
     '''
     Verifyies test script.
diff --git a/TestON/drivers/common/cli/onosdriver.py b/TestON/drivers/common/cli/onosdriver.py
index 8d95cfc..8bc2666 100644
--- a/TestON/drivers/common/cli/onosdriver.py
+++ b/TestON/drivers/common/cli/onosdriver.py
@@ -674,6 +674,7 @@
         """
         Calls 'cell <name>' to set the environment variables on ONOSbench
         """
+        import re
         try:
             if not cellname:
                 main.log.error( "Must define cellname" )
@@ -692,9 +693,13 @@
                 self.handle.expect("\$")
                 handleMore = self.handle.before
 
-                main.log.info( "Cell call returned: " + handleBefore +
+                cell_result = handleBefore + handleAfter + handleMore
+                print cell_result
+                if( re.search( "No such cell", cell_result ) ):
+                    main.log.error( "Cell call returned: " + handleBefore +
                                handleAfter + handleMore )
-
+                    main.cleanup()
+                    main.exit()
                 return main.TRUE
 
         except pexpect.EOF: