cheets_CTS_P: Follow-up fixes for dropping disconnected network interfaces.

* Takes wwan[[:digit:]] cellular interfaces into account as well.
* Updates the moblab control files used by partners as well.

BUG=b:140428041
TEST=cheets_CTS_P.9.0_r9.arm.CtsLibcore

Change-Id: I3aed29faa9398f974b00a139a7d8a569aa8382c3
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/autotest/+/1868552
Tested-by: Kazuhiro Inaba <kinaba@chromium.org>
Auto-Submit: Kazuhiro Inaba <kinaba@chromium.org>
Reviewed-by: Li-jen Chen <lijen@google.com>
Reviewed-by: Hugo Benichi <hugobenichi@google.com>
Legacy-Commit-Queue: Commit Bot <commit-bot@chromium.org>
(cherry picked from commit d965cb98440769f674c1afa5ebb588d37cb81bf2)
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/autotest/+/1871777
Reviewed-by: Kazuhiro Inaba <kinaba@chromium.org>
Commit-Queue: Kazuhiro Inaba <kinaba@chromium.org>
diff --git a/server/site_tests/cheets_CTS_P/control.9.0_r9.arm.CtsLibcore b/server/site_tests/cheets_CTS_P/control.9.0_r9.arm.CtsLibcore
index a6fc5b9..7362a89 100644
--- a/server/site_tests/cheets_CTS_P/control.9.0_r9.arm.CtsLibcore
+++ b/server/site_tests/cheets_CTS_P/control.9.0_r9.arm.CtsLibcore
@@ -29,7 +29,7 @@
         target_plan=None,
         bundle='arm',
         uri='gs://chromeos-arc-images/cts/bundle/P/android-cts-9.0_r9-linux_x86-arm.zip',
-        precondition_commands=['ip -o link show | grep "state DOWN" | grep -o "\<\(eth\|mlan\|wlan\)[[:digit:]]" | xargs -L1 -I{} ip link delete veth_{}'],
+        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_CTS, machines)
diff --git a/server/site_tests/cheets_CTS_P/control.9.0_r9.arm.all.CtsJvmtiAttachingHostTestCases_-_CtsLogdTestCases b/server/site_tests/cheets_CTS_P/control.9.0_r9.arm.all.CtsJvmtiAttachingHostTestCases_-_CtsLogdTestCases
index e4bee61..3236010 100644
--- a/server/site_tests/cheets_CTS_P/control.9.0_r9.arm.all.CtsJvmtiAttachingHostTestCases_-_CtsLogdTestCases
+++ b/server/site_tests/cheets_CTS_P/control.9.0_r9.arm.all.CtsJvmtiAttachingHostTestCases_-_CtsLogdTestCases
@@ -30,7 +30,7 @@
         target_plan=None,
         bundle='arm',
         uri='gs://chromeos-arc-images/cts/bundle/P/android-cts-9.0_r9-linux_x86-arm.zip',
-        precondition_commands=['ip -o link show | grep "state DOWN" | grep -o "\<\(eth\|mlan\|wlan\)[[:digit:]]" | xargs -L1 -I{} ip link delete veth_{}'],
+        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_CTS, machines)
diff --git a/server/site_tests/cheets_CTS_P/control.9.0_r9.x86.CtsLibcore b/server/site_tests/cheets_CTS_P/control.9.0_r9.x86.CtsLibcore
index 46d78a5..7e60a43 100644
--- a/server/site_tests/cheets_CTS_P/control.9.0_r9.x86.CtsLibcore
+++ b/server/site_tests/cheets_CTS_P/control.9.0_r9.x86.CtsLibcore
@@ -29,7 +29,7 @@
         target_plan=None,
         bundle='x86',
         uri='gs://chromeos-arc-images/cts/bundle/P/android-cts-9.0_r9-linux_x86-x86.zip',
-        precondition_commands=['ip -o link show | grep "state DOWN" | grep -o "\<\(eth\|mlan\|wlan\)[[:digit:]]" | xargs -L1 -I{} ip link delete veth_{}'],
+        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_CTS, machines)
diff --git a/server/site_tests/cheets_CTS_P/control.9.0_r9.x86.all.CtsJvmtiAttachingHostTestCases_-_CtsLogdTestCases b/server/site_tests/cheets_CTS_P/control.9.0_r9.x86.all.CtsJvmtiAttachingHostTestCases_-_CtsLogdTestCases
index 4d48b6c..102c50e 100644
--- a/server/site_tests/cheets_CTS_P/control.9.0_r9.x86.all.CtsJvmtiAttachingHostTestCases_-_CtsLogdTestCases
+++ b/server/site_tests/cheets_CTS_P/control.9.0_r9.x86.all.CtsJvmtiAttachingHostTestCases_-_CtsLogdTestCases
@@ -30,7 +30,7 @@
         target_plan=None,
         bundle='x86',
         uri='gs://chromeos-arc-images/cts/bundle/P/android-cts-9.0_r9-linux_x86-x86.zip',
-        precondition_commands=['ip -o link show | grep "state DOWN" | grep -o "\<\(eth\|mlan\|wlan\)[[:digit:]]" | xargs -L1 -I{} ip link delete veth_{}'],
+        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_CTS, machines)
diff --git a/server/site_tests/cheets_CTS_P/control.arm.CtsLibcoreTestCases b/server/site_tests/cheets_CTS_P/control.arm.CtsLibcoreTestCases
index 709dc73..5a51dcf 100644
--- a/server/site_tests/cheets_CTS_P/control.arm.CtsLibcoreTestCases
+++ b/server/site_tests/cheets_CTS_P/control.arm.CtsLibcoreTestCases
@@ -29,7 +29,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'],
+        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_{}'],
         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 1a5ed47..b9d85a7 100644
--- a/server/site_tests/cheets_CTS_P/control.x86.CtsLibcoreTestCases
+++ b/server/site_tests/cheets_CTS_P/control.x86.CtsLibcoreTestCases
@@ -29,7 +29,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'],
+        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_{}'],
         retry_manual_tests=True,
         warn_on_test_retry=False,
         timeout=3600)