HC Test: Fix log archiving in honeycomb tests 08/4608/2
authorselias <samelias@cisco.com>
Mon, 9 Jan 2017 15:10:17 +0000 (16:10 +0100)
committerPeter Mikus <pmikus@cisco.com>
Tue, 10 Jan 2017 10:21:04 +0000 (10:21 +0000)
Change-Id: Iad743b3c0e2d1b57e7c6bcae521fe958fbb06ced
Signed-off-by: selias <samelias@cisco.com>
resources/libraries/python/honeycomb/HoneycombUtil.py

index c290af9..a718a24 100644 (file)
@@ -27,6 +27,7 @@ from enum import Enum, unique
 
 from robot.api import logger
 
+from resources.libraries.python.ssh import SSH
 from resources.libraries.python.HTTPRequest import HTTPRequest
 from resources.libraries.python.constants import Constants as Const
 
@@ -396,3 +397,18 @@ class HoneycombUtil(object):
         base_path = HoneycombUtil.read_path_from_url_file(url_file)
         path = base_path + path
         return HTTPRequest.delete(node, path)
+
+    @staticmethod
+    def archive_honeycomb_log(node):
+        """Copy honeycomb log file from DUT node to VIRL for archiving.
+
+        :param node: Honeycomb node.
+        :type node: dict
+        """
+
+        ssh = SSH()
+        ssh.connect(node)
+
+        cmd = "cp /var/log/honeycomb/honeycomb.log /scratch/"
+
+        ssh.exec_command_sudo(cmd)

©2016 FD.io a Linux Foundation Collaborative Project. All Rights Reserved.
Linux Foundation is a registered trademark of The Linux Foundation. Linux is a registered trademark of Linus Torvalds.
Please see our privacy policy and terms of use.