Remove module-level WifiCheck preparers
As WifiCheck is now declared in the CTS config, remove declarations in
the module configs.
Also downgrade TargetSetupErrors on failure to logged errors
bug:28234985
Change-Id: I2e1a369bc26aeca922686c4c3d8c033bb7f9fbc7
diff --git a/common/host-side/tradefed/src/com/android/compatibility/common/tradefed/targetprep/WifiCheck.java b/common/host-side/tradefed/src/com/android/compatibility/common/tradefed/targetprep/WifiCheck.java
index 5863bd8..cfc4d7c 100644
--- a/common/host-side/tradefed/src/com/android/compatibility/common/tradefed/targetprep/WifiCheck.java
+++ b/common/host-side/tradefed/src/com/android/compatibility/common/tradefed/targetprep/WifiCheck.java
@@ -62,14 +62,16 @@
if (mWifiSsid == null) { // no connection to create, check for existing connectivity
if (!device.checkConnectivity()) {
- throw new TargetSetupError("Device has no network connection, no ssid provided");
+ logError("Device has no network connection, no ssid provided, some modules " +
+ "of CTS require an active network connection");
+ return;
}
} else { // network provided in options, attempt to create new connection
logInfo("Attempting connection to \"%s\"", mWifiSsid);
if (!device.connectToWifiNetwork(mWifiSsid, mWifiPsk)) { // attempt connection
- throw new TargetSetupError(String.format(
- "Unable to connect to network \"%s\", some modules of CTS" +
- "require an active network connection", mWifiSsid));
+ logError("Unable to connect to network \"%s\", some modules of CTS" +
+ "require an active network connection", mWifiSsid);
+ return;
}
}
logInfo("Wifi is connected");
diff --git a/tests/tests/content/AndroidTest.xml b/tests/tests/content/AndroidTest.xml
index a8a8727..e87771c 100644
--- a/tests/tests/content/AndroidTest.xml
+++ b/tests/tests/content/AndroidTest.xml
@@ -14,7 +14,6 @@
limitations under the License.
-->
<configuration description="Config for CTS Content test cases">
- <target_preparer class="com.android.compatibility.common.tradefed.targetprep.WifiCheck" />
<target_preparer class="com.android.compatibility.common.tradefed.targetprep.ApkInstaller">
<option name="cleanup-apks" value="true" />
<option name="test-file-name" value="CtsContentTestCases.apk" />
diff --git a/tests/tests/net/AndroidTest.xml b/tests/tests/net/AndroidTest.xml
index dc80339..5194da3 100644
--- a/tests/tests/net/AndroidTest.xml
+++ b/tests/tests/net/AndroidTest.xml
@@ -13,7 +13,6 @@
limitations under the License.
-->
<configuration description="Config for CTS Net test cases">
- <target_preparer class="com.android.compatibility.common.tradefed.targetprep.WifiCheck" />
<target_preparer class="com.android.compatibility.common.tradefed.targetprep.ApkInstaller">
<option name="cleanup-apks" value="true" />
<option name="test-file-name" value="CtsNetTestCases.apk" />
diff --git a/tests/tests/text/AndroidTest.xml b/tests/tests/text/AndroidTest.xml
index 4b9d24d..5fef3cb 100644
--- a/tests/tests/text/AndroidTest.xml
+++ b/tests/tests/text/AndroidTest.xml
@@ -14,7 +14,6 @@
limitations under the License.
-->
<configuration description="Config for CTS Text test cases">
- <target_preparer class="com.android.compatibility.common.tradefed.targetprep.WifiCheck" />
<target_preparer class="com.android.compatibility.common.tradefed.targetprep.ApkInstaller">
<option name="cleanup-apks" value="true" />
<option name="test-file-name" value="CtsTextTestCases.apk" />
diff --git a/tests/tests/webkit/AndroidTest.xml b/tests/tests/webkit/AndroidTest.xml
index e6649e1..7e8ed69 100644
--- a/tests/tests/webkit/AndroidTest.xml
+++ b/tests/tests/webkit/AndroidTest.xml
@@ -14,7 +14,6 @@
limitations under the License.
-->
<configuration description="Config for CTS Webkit test cases">
- <target_preparer class="com.android.compatibility.common.tradefed.targetprep.WifiCheck" />
<target_preparer class="com.android.compatibility.common.tradefed.targetprep.LocationCheck" />
<target_preparer class="com.android.compatibility.common.tradefed.targetprep.ApkInstaller">
<option name="cleanup-apks" value="true" />
diff --git a/tests/tests/widget/AndroidTest.xml b/tests/tests/widget/AndroidTest.xml
index ed7742a..d0cb110 100644
--- a/tests/tests/widget/AndroidTest.xml
+++ b/tests/tests/widget/AndroidTest.xml
@@ -14,7 +14,6 @@
limitations under the License.
-->
<configuration description="Config for CTS Widget test cases">
- <target_preparer class="com.android.compatibility.common.tradefed.targetprep.WifiCheck" />
<target_preparer class="com.android.compatibility.common.tradefed.targetprep.ApkInstaller">
<option name="cleanup-apks" value="true" />
<option name="test-file-name" value="CtsWidgetTestCases.apk" />