Merge branch 'ONOS-Next' of https://github.com/OPENNETWORKINGLAB/ONLabTest into ONOS-Next
diff --git a/TestON/drivers/common/cli/onosdriver.py b/TestON/drivers/common/cli/onosdriver.py
index 43c1c30..c8b974f 100644
--- a/TestON/drivers/common/cli/onosdriver.py
+++ b/TestON/drivers/common/cli/onosdriver.py
@@ -1025,6 +1025,44 @@
self.handle.sendline("")
main.log.info("Tshark stopped")
+ def ptpd(self, args):
+ '''
+ Initiate ptp with user-specified args.
+ Required:
+ * args: specify string of args after command
+ 'sudo ptpd'
+ '''
+ try:
+ self.handle.sendline("sudo ptpd "+str(args))
+ self.handle.expect([
+ "Multiple",
+ "Error",
+ "\$"])
+ self.handle.expect("\$")
+ if i == 0:
+ handle = self.handle.before
+ main.log.info("ptpd returned an error: "+
+ str(handle))
+ return handle
+ elif i == 1:
+ handle = self.handle.before
+ main.log.error("ptpd returned an error: "+
+ str(handle))
+ return handle
+ else:
+ return main.TRUE
+
+ 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()