summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndroid Build Coastguard Worker <android-build-coastguard-worker@google.com>2022-01-08 04:08:18 +0000
committerAndroid Build Coastguard Worker <android-build-coastguard-worker@google.com>2022-01-08 04:08:18 +0000
commit1413ac498114dfc51297c9eaef46b805945136c5 (patch)
tree75948bb70e6ac8e85b32b3665be67519774a061c
parentd77a7ee14414a4d54d41cf26a78678ed44c1c54e (diff)
parent04b79b6cb0fd105abb4e5fb930aa3eea73eca1e8 (diff)
downloadtests-1413ac498114dfc51297c9eaef46b805945136c5.tar.gz
Snap for 8055626 from 04b79b6cb0fd105abb4e5fb930aa3eea73eca1e8 to tm-d1-release
Change-Id: I39e2cd9853646b0a3af41d247874de48314e215c
-rwxr-xr-xnet/test/all_tests.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/net/test/all_tests.py b/net/test/all_tests.py
index 17d9701..2305354 100755
--- a/net/test/all_tests.py
+++ b/net/test/all_tests.py
@@ -15,6 +15,7 @@
# limitations under the License.
import importlib
+import os
import sys
import unittest
@@ -48,8 +49,9 @@ test_modules = [
]
if __name__ == '__main__':
- # Check whether ADB over TCP is occupying TCP port 5555.
- if namespace.HasEstablishedTcpSessionOnPort(5555):
+ # Check whether ADB over TCP is occupying TCP port 5555,
+ # or if we're on a real Android device
+ if os.path.isdir('/system') or namespace.HasEstablishedTcpSessionOnPort(5555):
namespace.IfPossibleEnterNewNetworkNamespace()
# First, run InjectTests on all modules, to ensure that any parameterized
# tests in those modules are injected.