summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGirish Moturu <gmoturu@google.com>2018-05-21 14:21:48 -0700
committerGirish Moturu <gmoturu@google.com>2018-05-21 14:21:48 -0700
commit1dbaa2f0e9cba9ae3b2d211ece9d1ab7ff6cebb1 (patch)
treec78ba7bd5508e166e08eda732cd8280e3e35fd54
parentc6afc689ed2e6267ef1467a7b64050a3c0bb2992 (diff)
downloadplatform_tools_test_connectivity-1dbaa2f0e9cba9ae3b2d211ece9d1ab7ff6cebb1.tar.gz
platform_tools_test_connectivity-1dbaa2f0e9cba9ae3b2d211ece9d1ab7ff6cebb1.tar.bz2
platform_tools_test_connectivity-1dbaa2f0e9cba9ae3b2d211ece9d1ab7ff6cebb1.zip
[tel_test_utils] Fix for tcpdump issue on oc security builds
Starting tcpdump fails on oc builds as there is tcpdump directory under /sdcard/ Bug: 79438221 Test: Verified the changes on oc-mr1-dev Change-Id: If3606d7a310853d5fe107820022ade0a689fab42
-rw-r--r--acts/framework/acts/test_utils/tel/tel_test_utils.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/acts/framework/acts/test_utils/tel/tel_test_utils.py b/acts/framework/acts/test_utils/tel/tel_test_utils.py
index f7bbe07966..8324c9d940 100644
--- a/acts/framework/acts/test_utils/tel/tel_test_utils.py
+++ b/acts/framework/acts/test_utils/tel/tel_test_utils.py
@@ -4649,6 +4649,12 @@ def start_adb_tcpdump(ad, test_name, mask="ims"):
"""
ad.log.debug("Ensuring no tcpdump is running in background")
ad.adb.shell("killall -9 tcpdump")
+ out = ad.adb.shell("ls -l /sdcard/tcpdump/")
+ if "No such file" in out or not out:
+ ad.adb.shell("mkdir /sdcard/tcpdump")
+ else:
+ ad.adb.shell("rm -rf /sdcard/tcpdump/*", ignore_status=True)
+
begin_time = epoch_to_log_line_timestamp(get_current_epoch_time())
begin_time = normalize_log_line_timestamp(begin_time)