X-Git-Url: https://gerrit.fd.io/r/gitweb?a=blobdiff_plain;f=resources%2Flibraries%2Fpython%2FVatExecutor.py;h=9db53d3a3679abba3f8d874e45c2705f18563b82;hb=b2f75ec0f52110c267b90372e657b664417c1f4b;hp=bbce83d1add0896e0170146243c67599da19d9cc;hpb=cf561a6e3d4c4fbd78ab6c9d0a9aa817bb3300fc;p=csit.git diff --git a/resources/libraries/python/VatExecutor.py b/resources/libraries/python/VatExecutor.py index bbce83d1ad..9db53d3a36 100644 --- a/resources/libraries/python/VatExecutor.py +++ b/resources/libraries/python/VatExecutor.py @@ -19,6 +19,7 @@ from robot.api import logger from resources.libraries.python.ssh import SSH from resources.libraries.python.constants import Constants +from resources.libraries.python.VatHistory import VatHistory __all__ = ['VatExecutor'] @@ -156,14 +157,15 @@ class VatTerminal(object): """ - __VAT_PROMPT = "vat# " - __LINUX_PROMPT = ":~$ " + __VAT_PROMPT = ("vat# ", ) + __LINUX_PROMPT = (":~$ ", "~]$ ") def __init__(self, node, json_param=True): json_text = ' json' if json_param else '' self.json = json_param + self._node = node self._ssh = SSH() - self._ssh.connect(node) + self._ssh.connect(self._node) self._tty = self._ssh.interactive_terminal_open() self._ssh.interactive_terminal_exec_command( self._tty, @@ -185,6 +187,7 @@ class VatTerminal(object): :return: Command output in python representation of JSON format or None if not in JSON mode. """ + VatHistory.add_to_vat_history(self._node, cmd) logger.debug("Executing command in VAT terminal: {}".format(cmd)) try: out = self._ssh.interactive_terminal_exec_command(self._tty, cmd, @@ -217,7 +220,7 @@ class VatTerminal(object): def vat_terminal_close(self): """Close VAT terminal.""" - #interactive terminal is dead, we only need to close session + # interactive terminal is dead, we only need to close session if not self._exec_failure: self._ssh.interactive_terminal_exec_command(self._tty, 'quit',