Fix the TLDK test tcpdump not found issue. 82/7582/3
authorFangyin Hu <fangyinx.hu@intel.com>
Fri, 14 Jul 2017 11:27:20 +0000 (04:27 -0700)
committerPeter Mikus <pmikus@cisco.com>
Mon, 17 Jul 2017 11:07:00 +0000 (11:07 +0000)
Add the PYBOT execute exit status code.

Change-Id: If0fc29c580177f1b187ec751c6708fc138838bed
Signed-off-by: Fangyin Hu <fangyinx.hu@intel.com>
bootstrap-TLDK.sh
resources/libraries/python/TLDK/UdpTest.py

index 4678bf5..4f731cd 100755 (executable)
@@ -17,6 +17,8 @@ set -x
 cat /etc/hostname
 cat /etc/hosts
 
+ARCHIVE_ARTIFACTS=(log.html output.xml report.html)
+
 SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
 export PYTHONPATH=${SCRIPT_DIR}
 
@@ -199,3 +201,13 @@ PYTHONPATH=`pwd` pybot -L TRACE -W 150 \
     --include vm_envAND3_node_single_link_topo \
     --noncritical EXPECTED_FAILING \
     tests/
+
+RETURN_STATUS=$(echo $?)
+
+# Archive artifacts
+mkdir archive
+for i in ${ARCHIVE_ARTIFACTS[@]}; do
+    cp $( readlink -f ${i} | tr '\n' ' ' ) archive/
+done
+
+exit ${RETURN_STATUS}
index adc8aa0..0571323 100644 (file)
@@ -114,8 +114,8 @@ class UdpTest(object):
         """
         ssh = SSH()
         ssh.connect(dut_node)
-        cmd = 'cd {0}; tcpdump -nnnn -vvv -r ./{2}/{1}_tx.pcap | ' \
-            'grep \'udp sum ok\' | wc -l' \
+        cmd = 'cd {0}; sudo /usr/sbin/tcpdump -nnnn -vvv -r ./{2}/{1}_tx.pcap' \
+              ' | grep \'udp sum ok\' | wc -l' \
             .format(con.REMOTE_FW_DIR, file_prefix, con.TLDK_TESTCONFIG)
 
         (ret_code, stdout, _) = ssh.exec_command(cmd, timeout=100)

©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.