X-Git-Url: https://gerrit.fd.io/r/gitweb?a=blobdiff_plain;f=resources%2Flibraries%2Fpython%2Fhoneycomb%2FHoneycombUtil.py;h=24f81af7b357c5c81864c25a35c6b39cab3ff961;hb=c70b9cd6c48d71208cf729ba335ff9753e94b694;hp=c290af9a6e1ff7fc93495528ed25d9d49ded217f;hpb=1813672eb9f6988046bc65167235ae37b088298c;p=csit.git diff --git a/resources/libraries/python/honeycomb/HoneycombUtil.py b/resources/libraries/python/honeycomb/HoneycombUtil.py index c290af9a6e..24f81af7b3 100644 --- a/resources/libraries/python/honeycomb/HoneycombUtil.py +++ b/resources/libraries/python/honeycomb/HoneycombUtil.py @@ -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,25 @@ 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, perf=False): + """Copy honeycomb log file from DUT node to VIRL for archiving. + + :param node: Honeycomb node. + :param perf: Alternate handling, for use with performance test topology. + :type node: dict + :type perf: bool + """ + + ssh = SSH() + ssh.connect(node) + + if not perf: + cmd = "cp /var/log/honeycomb/honeycomb.log /scratch/" + ssh.exec_command_sudo(cmd) + else: + ssh.scp( + ".", + "/var/log/honeycomb/honeycomb.log", + get=True)