HC Test: fix archiving artifacts in csit-hc2vpp jobs 35/4335/2
authorselias <samelias@cisco.com>
Thu, 15 Dec 2016 12:51:57 +0000 (13:51 +0100)
committerselias <samelias@cisco.com>
Thu, 15 Dec 2016 13:36:02 +0000 (14:36 +0100)
Change-Id: I392eac7404d5e1793a7de9d7a44b9defb89e7b9d
Signed-off-by: selias <samelias@cisco.com>
bootstrap-hc2vpp-integration.sh
bootstrap-hc2vpp-verify.sh
resources/libraries/python/honeycomb/HoneycombUtil.py
resources/libraries/robot/honeycomb/honeycomb.robot
tests/func/honeycomb/__init__.robot

index 0e0b842..d29d08e 100755 (executable)
@@ -212,7 +212,5 @@ PYTHONPATH=`pwd` pybot -L TRACE -W 136\
     tests/
 
 # Get Honeycomb log file from virl host
     tests/
 
 # Get Honeycomb log file from virl host
-# log only exists on DUT1
-for index in "${!VIRL_SERVER[@]}"; do
-    scp ${SSH_OPTIONS} ${VIRL_USERNAME}@${VIRL_SERVER[${index}]}:/var/log/honeycomb/honeycomb.log . || true
-done
+scp ${SSH_OPTIONS} \
+    ${VIRL_USERNAME}@${VIRL_SERVER}:/scratch/${VIRL_SID}/honeycomb.log . || true
index 2f0ec20..13a65bd 100755 (executable)
@@ -209,7 +209,5 @@ PYTHONPATH=`pwd` pybot -L TRACE -W 136\
     tests/
 
 # Get Honeycomb log file from virl host
     tests/
 
 # Get Honeycomb log file from virl host
-# log only exists on DUT1
-for index in "${!VIRL_SERVER[@]}"; do
-    scp ${SSH_OPTIONS} ${VIRL_USERNAME}@${VIRL_SERVER[${index}]}:/var/log/honeycomb/honeycomb.log . || true
-done
+scp ${SSH_OPTIONS} \
+    ${VIRL_USERNAME}@${VIRL_SERVER}:/scratch/${VIRL_SID}/honeycomb.log . || true
index 22a7e7e..f607c24 100644 (file)
@@ -437,3 +437,18 @@ class HoneycombUtil(object):
         (_, stdout, _) = ssh.exec_command(cmd, timeout=30)
 
         return stdout
         (_, stdout, _) = ssh.exec_command(cmd, timeout=30)
 
         return stdout
+
+    @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)
index 8b0a788..7d807f8 100644 (file)
 | | Stop Honeycomb service on DUTs | ${node}
 | | Clear persisted Honeycomb configuration | ${node}
 | | Setup DUT | ${node}
 | | Stop Honeycomb service on DUTs | ${node}
 | | Clear persisted Honeycomb configuration | ${node}
 | | Setup DUT | ${node}
-| | Setup Honeycomb service on DUTs | ${node}
\ No newline at end of file
+| | Setup Honeycomb service on DUTs | ${node}
+
+| Archive Honeycomb log file
+| | [Documentation] | Copy honeycomb.log file from Honeycomb node\
+| | ... | to test executor.
+| | ... | *Arguments:*
+| | ... | - node - information about a DUT node. Type: dictionary
+| | ...
+| | ... | *Example:*
+| | ...
+| | ... | \| Archive Honeycomb log file \| ${nudes['DUT1']} \|
+| | [Arguments] | ${node}
+| | Archive Honeycomb log | ${node}
\ No newline at end of file
index ec580b5..701ccc2 100644 (file)
@@ -26,4 +26,6 @@
 | ... | Configure Log Level | ${node} | TRACE | AND
 | ... | Setup Honeycomb Service On DUTs | ${node} | AND
 | ... | Set Global Variable | ${node}
 | ... | Configure Log Level | ${node} | TRACE | AND
 | ... | Setup Honeycomb Service On DUTs | ${node} | AND
 | ... | Set Global Variable | ${node}
-| Suite Teardown | Stop Honeycomb Service On DUTs | ${node}
+| Suite Teardown | Run keywords
+| ... | Stop Honeycomb Service On DUTs | ${node} | AND
+| ... | Archive Honeycomb log file | ${node}