diff options
author | Maciej Żenczykowski <maze@google.com> | 2022-01-07 08:01:07 -0800 |
---|---|---|
committer | Maciej Żenczykowski <maze@google.com> | 2022-01-07 08:06:36 -0800 |
commit | d3c14e9e92057c1fc9921b74d476ea9332e481b8 (patch) | |
tree | 75948bb70e6ac8e85b32b3665be67519774a061c | |
parent | 2d39f5c866a740dd3db76487c0aef8f39127841e (diff) | |
download | tests-d3c14e9e92057c1fc9921b74d476ea9332e481b8.tar.gz |
net-test: when running under Android run inside netns if possible
Will hopefully reduce flake rate...
Bug: 185330868
Test: TreeHugger
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: I233e79c637cb62a145bcf9eaeab08c219a7bd5df
-rwxr-xr-x | net/test/all_tests.py | 6 |
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. |