summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoreric_kuang.rs <eric_kuang.rs@realtek.com>2021-12-01 16:17:40 +0800
committerGregory Montoir <gmontoir@google.com>2021-12-26 13:18:46 +0000
commit17a08fbb06ec8a9dc425632a0bdd90b1622d5d26 (patch)
tree9ba390b721b93e463f78c33ca6b11bed5bc6559a
parent889acf768e33bdf874fdbd0dceb32de4f280d907 (diff)
downloadtests-android11-tests-dev.tar.gz
net-test: not supported in netns before 4.15 if BH_TIMEOUT_SYSCTL does not exist.android11-tests-dev
Related to the following CL which is included in 4.15: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=3733be14a32bae288b61ed28341e593baba983af Change-Id: I1cc9b9c79a1eec83c47d36790c8f944b0261ff32 Merged-In: I1cc9b9c79a1eec83c47d36790c8f944b0261ff32 Test: Run vts_kernel_net_tests with Ethernet or Wi-Fi connected Bug: 204306357 (cherry picked from commit 7b07e88d38aa3211f47dc1fcd360399d75514479)
-rwxr-xr-xnet/test/tcp_fastopen_test.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/net/test/tcp_fastopen_test.py b/net/test/tcp_fastopen_test.py
index 16e41c6..3ab9e51 100755
--- a/net/test/tcp_fastopen_test.py
+++ b/net/test/tcp_fastopen_test.py
@@ -22,6 +22,7 @@ from scapy import all as scapy
import multinetwork_base
import net_test
+import os
import packets
import tcp_metrics
@@ -67,6 +68,9 @@ class TcpFastOpenTest(multinetwork_base.MultiNetworkBaseTest):
def clearBlackhole(self):
if net_test.LINUX_VERSION < (4, 14, 0):
return
+ # Prior to 4.15 this sysctl is not namespace aware.
+ if net_test.LINUX_VERSION < (4, 15, 0) and not os.path.exists(BH_TIMEOUT_SYSCTL):
+ return
timeout = self.GetSysctl(BH_TIMEOUT_SYSCTL)
# Write to timeout to clear any pre-existing blackhole condition