aboutsummaryrefslogtreecommitdiffstats
path: root/resources/libraries/python/VatExecutor.py
diff options
context:
space:
mode:
authorJan Gelety <jgelety@cisco.com>2017-02-08 12:51:31 +0100
committerPeter Mikus <pmikus@cisco.com>2017-02-13 12:45:08 +0000
commit44dc1d4781470b722c5f7d5adb197ace96b96db3 (patch)
treed4eed5a5634d5af73d7d039adff6f3d1816c96a1 /resources/libraries/python/VatExecutor.py
parentc29c69bb91057e4217952602cda71e6a85fd13b6 (diff)
Introduce simple VAT history per test case
- print list of VAT commands executed per DUT node during the test case in the func test teardown Change-Id: I18a750ebfb7560eff9f5c4f0826ef84c3f64b4a8 Signed-off-by: Jan Gelety <jgelety@cisco.com>
Diffstat (limited to 'resources/libraries/python/VatExecutor.py')
-rw-r--r--resources/libraries/python/VatExecutor.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/resources/libraries/python/VatExecutor.py b/resources/libraries/python/VatExecutor.py
index bbce83d1ad..5f7e188b7f 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']
@@ -162,8 +163,9 @@ class VatTerminal(object):
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',