Removing unnecessary feature string and adding onos-die command
diff --git a/TestON/drivers/common/cli/onosdriver.py b/TestON/drivers/common/cli/onosdriver.py
index 6bb46a0..71b397f 100644
--- a/TestON/drivers/common/cli/onosdriver.py
+++ b/TestON/drivers/common/cli/onosdriver.py
@@ -463,8 +463,7 @@
#Note that you may not want certain features listed
#on here.
core_feature_string = "export ONOS_FEATURES=webconsole,onos-api,"+\
- "onos-cli,onos-openflow,onos-app-mobility,onos-app-tvue,"+\
- "onos-app-proxyarp,"+extra_feature_string
+ "onos-cli,onos-openflow,"+extra_feature_string
mn_string = "export OCN="
onos_string = "export OC"
temp_count = 1
@@ -809,6 +808,40 @@
main.cleanup()
main.exit()
+ def onos_die(self, node_ip):
+ '''
+ Issues the command 'onos-die <node-ip>'
+ This command calls onos-kill and also stops the node
+ '''
+ try:
+ self.handle.sendline("")
+ self.handle.expect("\$")
+ cmd_str = "onos-kill "+str(node_ip)
+ self.handle.sendline(cmd_str)
+ i = self.handle.expect([
+ "Killing\sONOS",
+ "ONOS\sprocess\sis\snot\srunning",
+ pexpect.TIMEOUT], timeout=20)
+ if i == 0:
+ main.log.info("ONOS instance "+str(node_ip)+
+ " was killed and stopped")
+ return main.TRUE
+ elif i == 1:
+ main.log.info("ONOS process was not running")
+ return main.FALSE
+ except pexpect.EOF:
+ main.log.error(self.name + ": EOF exception found")
+ main.log.error(self.name + ": " + self.handle.before)
+ main.cleanup()
+ main.exit()
+ except:
+ main.log.info(self.name+" ::::::")
+ main.log.error( traceback.print_exc())
+ main.log.info(self.name+" ::::::")
+ main.cleanup()
+ main.exit()
+
+
def onos_kill(self, node_ip):
'''
Calls the command: 'onos-kill [<node-ip>]'
@@ -964,7 +997,8 @@
main.exit()
def push_test_intents_shell(self, dpid_src, dpid_dst, num_intents,
- dir_file, onos_ip, num_mult="", app_id="", report=True):
+ dir_file, onos_ip, num_mult="", app_id="", report=True,
+ options=""):
'''
Description:
Use the linux prompt to push test intents to
@@ -981,7 +1015,12 @@
'''
try:
#Create the string to sendline
- base_cmd = "onos "+str(onos_ip)+" push-test-intents "
+ if options:
+ base_cmd = "onos "+str(onos_ip)+" push-test-intents "+\
+ options+" "
+ else:
+ base_cmd = "onos "+str(onos_ip)+" push-test-intents "
+
add_dpid = base_cmd + str(dpid_src) + " " + str(dpid_dst)
if not num_mult:
add_intents = add_dpid + " " + str(num_intents)
@@ -993,7 +1032,10 @@
else:
add_app = add_intents
- send_cmd = add_app + " > " + str(dir_file) + " &"
+ if report:
+ send_cmd = add_app + " > " + str(dir_file) + " &"
+ else:
+ send_cmd = add_app + " &"
main.log.info("Send cmd: "+send_cmd)
self.handle.sendline(send_cmd)