cheets_CTS_P: Remove the precondtion for dropping unpluged network I/F.

The root cause is expected to be fixed on ToT.
Let's remove the workaround and see what happens.

BUG=b:144222142
TEST=bot

Change-Id: Ic5ba27cbf51b45556bd3df69d5702ac6493dfe2d
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/autotest/+/2004788
Tested-by: Kazuhiro Inaba <kinaba@chromium.org>
Auto-Submit: Kazuhiro Inaba <kinaba@chromium.org>
Reviewed-by: Rohit Makasana <rohitbm@chromium.org>
Reviewed-by: Yoshiki Iguchi <yoshiki@chromium.org>
Commit-Queue: Kazuhiro Inaba <kinaba@chromium.org>
(cherry picked from commit f11a7520b5da1cebb73029ac2bfe91c47f515bb5)
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/autotest/+/2043251
Reviewed-by: Kazuhiro Inaba <kinaba@chromium.org>
diff --git a/server/cros/tradefed/generate_controlfiles_CTS_P.py b/server/cros/tradefed/generate_controlfiles_CTS_P.py
index e5edd46..4a6abab 100755
--- a/server/cros/tradefed/generate_controlfiles_CTS_P.py
+++ b/server/cros/tradefed/generate_controlfiles_CTS_P.py
@@ -205,14 +205,8 @@
 # TODO(b/126741318): Fix performance regression and remove this.
 _SLEEP_60_COMMAND = "\'sleep 60\'"
 
-# TODO(b/138431480): Fix CTS and remove this.
-_DROP_DISCONNECTED_IF_COMMAND = ("\'ip -o link show | grep \"state DOWN\" | " +
-    "grep -o \"\\<\\(eth\\|mlan\\|wlan\\|wwan\\)[[:digit:]]\" | " +
-    "xargs -L1 -I{} ip link delete veth_{}\'")
-
 # Preconditions applicable to public and internal tests.
 CONFIG['PRECONDITION'] = {
-    'CtsLibcoreTestCases': [_DROP_DISCONNECTED_IF_COMMAND],
     'CtsSecurityHostTestCases': [
         _SECURITY_PARANOID_COMMAND, _CONFIG_MODULE_COMMAND
     ],
@@ -241,8 +235,7 @@
     ],
     'CtsUsageStatsTestCases': _WIFI_CONNECT_COMMANDS,
     'CtsNetTestCases': _WIFI_CONNECT_COMMANDS,
-    'CtsLibcoreTestCases':
-        _WIFI_CONNECT_COMMANDS + [_DROP_DISCONNECTED_IF_COMMAND],
+    'CtsLibcoreTestCases': _WIFI_CONNECT_COMMANDS,
 }
 
 CONFIG['PUBLIC_DEPENDENCIES'] = {
diff --git a/server/site_tests/cheets_CTS_P/control.9.0_r10.arm.CtsLibcore b/server/site_tests/cheets_CTS_P/control.9.0_r10.arm.CtsLibcore
index c6d691c..873c0a8 100644
--- a/server/site_tests/cheets_CTS_P/control.9.0_r10.arm.CtsLibcore
+++ b/server/site_tests/cheets_CTS_P/control.9.0_r10.arm.CtsLibcore
@@ -28,7 +28,6 @@
         target_plan=None,
         bundle='arm',
         uri='gs://chromeos-arc-images/cts/bundle/P/android-cts-9.0_r10-linux_x86-arm.zip',
-        precondition_commands=['ip -o link show | grep "state DOWN" | grep -o "\<\(eth\|mlan\|wlan\|wwan\)[[:digit:]]" | xargs -L1 -I{} ip link delete veth_{}'],
         timeout=21600)
 
 parallel_simple(run_TS, machines)
diff --git a/server/site_tests/cheets_CTS_P/control.9.0_r10.arm.all.CtsJvmtiAttachingHostTestCases_-_CtsLogdTestCases b/server/site_tests/cheets_CTS_P/control.9.0_r10.arm.all.CtsJvmtiAttachingHostTestCases_-_CtsLogdTestCases
index 66aa10a..6550f22 100644
--- a/server/site_tests/cheets_CTS_P/control.9.0_r10.arm.all.CtsJvmtiAttachingHostTestCases_-_CtsLogdTestCases
+++ b/server/site_tests/cheets_CTS_P/control.9.0_r10.arm.all.CtsJvmtiAttachingHostTestCases_-_CtsLogdTestCases
@@ -29,7 +29,6 @@
         target_plan=None,
         bundle='arm',
         uri='gs://chromeos-arc-images/cts/bundle/P/android-cts-9.0_r10-linux_x86-arm.zip',
-        precondition_commands=['ip -o link show | grep "state DOWN" | grep -o "\<\(eth\|mlan\|wlan\|wwan\)[[:digit:]]" | xargs -L1 -I{} ip link delete veth_{}'],
         timeout=172800)
 
 parallel_simple(run_TS, machines)
diff --git a/server/site_tests/cheets_CTS_P/control.9.0_r10.x86.CtsLibcore b/server/site_tests/cheets_CTS_P/control.9.0_r10.x86.CtsLibcore
index 48b6478..7c3bc10 100644
--- a/server/site_tests/cheets_CTS_P/control.9.0_r10.x86.CtsLibcore
+++ b/server/site_tests/cheets_CTS_P/control.9.0_r10.x86.CtsLibcore
@@ -28,7 +28,6 @@
         target_plan=None,
         bundle='x86',
         uri='gs://chromeos-arc-images/cts/bundle/P/android-cts-9.0_r10-linux_x86-x86.zip',
-        precondition_commands=['ip -o link show | grep "state DOWN" | grep -o "\<\(eth\|mlan\|wlan\|wwan\)[[:digit:]]" | xargs -L1 -I{} ip link delete veth_{}'],
         timeout=21600)
 
 parallel_simple(run_TS, machines)
diff --git a/server/site_tests/cheets_CTS_P/control.9.0_r10.x86.all.CtsJvmtiAttachingHostTestCases_-_CtsLogdTestCases b/server/site_tests/cheets_CTS_P/control.9.0_r10.x86.all.CtsJvmtiAttachingHostTestCases_-_CtsLogdTestCases
index b8467f4..bd16c48 100644
--- a/server/site_tests/cheets_CTS_P/control.9.0_r10.x86.all.CtsJvmtiAttachingHostTestCases_-_CtsLogdTestCases
+++ b/server/site_tests/cheets_CTS_P/control.9.0_r10.x86.all.CtsJvmtiAttachingHostTestCases_-_CtsLogdTestCases
@@ -29,7 +29,6 @@
         target_plan=None,
         bundle='x86',
         uri='gs://chromeos-arc-images/cts/bundle/P/android-cts-9.0_r10-linux_x86-x86.zip',
-        precondition_commands=['ip -o link show | grep "state DOWN" | grep -o "\<\(eth\|mlan\|wlan\|wwan\)[[:digit:]]" | xargs -L1 -I{} ip link delete veth_{}'],
         timeout=172800)
 
 parallel_simple(run_TS, machines)
diff --git a/server/site_tests/cheets_CTS_P/control.arm.CtsLibcoreTestCases b/server/site_tests/cheets_CTS_P/control.arm.CtsLibcoreTestCases
index 157899d..5f2cb41 100644
--- a/server/site_tests/cheets_CTS_P/control.arm.CtsLibcoreTestCases
+++ b/server/site_tests/cheets_CTS_P/control.arm.CtsLibcoreTestCases
@@ -28,7 +28,7 @@
         target_module='CtsLibcoreTestCases',
         target_plan=None,
         bundle='arm',
-        precondition_commands=['/usr/local/autotest/cros/scripts/wifi connect %s %s' % (ssid, wifipass), '/usr/local/autotest/cros/scripts/reorder-services-moblab.sh wifi', 'ip -o link show | grep "state DOWN" | grep -o "\<\(eth\|mlan\|wlan\|wwan\)[[:digit:]]" | xargs -L1 -I{} ip link delete veth_{}'],
+        precondition_commands=['/usr/local/autotest/cros/scripts/wifi connect %s %s' % (ssid, wifipass), '/usr/local/autotest/cros/scripts/reorder-services-moblab.sh wifi'],
         retry_manual_tests=True,
         warn_on_test_retry=False,
         timeout=3600)
diff --git a/server/site_tests/cheets_CTS_P/control.x86.CtsLibcoreTestCases b/server/site_tests/cheets_CTS_P/control.x86.CtsLibcoreTestCases
index 3232607..06e7e5c 100644
--- a/server/site_tests/cheets_CTS_P/control.x86.CtsLibcoreTestCases
+++ b/server/site_tests/cheets_CTS_P/control.x86.CtsLibcoreTestCases
@@ -28,7 +28,7 @@
         target_module='CtsLibcoreTestCases',
         target_plan=None,
         bundle='x86',
-        precondition_commands=['/usr/local/autotest/cros/scripts/wifi connect %s %s' % (ssid, wifipass), '/usr/local/autotest/cros/scripts/reorder-services-moblab.sh wifi', 'ip -o link show | grep "state DOWN" | grep -o "\<\(eth\|mlan\|wlan\|wwan\)[[:digit:]]" | xargs -L1 -I{} ip link delete veth_{}'],
+        precondition_commands=['/usr/local/autotest/cros/scripts/wifi connect %s %s' % (ssid, wifipass), '/usr/local/autotest/cros/scripts/reorder-services-moblab.sh wifi'],
         retry_manual_tests=True,
         warn_on_test_retry=False,
         timeout=3600)