Driver function get_version() for obtaining commit version
diff --git a/TestON/drivers/common/cli/onosdriver.py b/TestON/drivers/common/cli/onosdriver.py
index 263bc1f..7d7e26d 100644
--- a/TestON/drivers/common/cli/onosdriver.py
+++ b/TestON/drivers/common/cli/onosdriver.py
@@ -352,6 +352,34 @@
main.cleanup()
main.exit()
+ def get_version(self):
+ '''
+ Writes the COMMIT number to the report to be parsed by Jenkins data collecter.
+ '''
+ try:
+ self.handle.sendline("export TERM=xterm-256color")
+ self.handle.expect("xterm-256color")
+ self.handle.expect("\$")
+ self.handle.sendline("cd " + self.home + "; git log -1 --pretty=fuller --decorate=short | grep -A 5 \"commit\" --color=never; cd \.\.")
+ self.handle.expect("cd ..")
+ self.handle.expect("\$")
+ response=(self.name +": \n"+ str(self.handle.before + self.handle.after))
+ lines=response.splitlines()
+ for line in lines:
+ print line
+ return lines[2]
+ 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(":::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::")
+ main.cleanup()
+ main.exit()
+
def create_cell_file(self, bench_ip, file_name, mn_ip_addrs, *onos_ip_addrs):
'''
Creates a cell file based on arguments