STS Implement apis for the proxy auto-config runner
Bug: 137314631
Test: AdbUtils.runProxyAutoConfig("CVE-XXXX-XXXX", getDevice());
Change-Id: I4bb973c9ce5b734446fce56d90d9812f04158106
Merged-In: I4bb973c9ce5b734446fce56d90d9812f04158106
diff --git a/hostsidetests/securitybulletin/AndroidTest.xml b/hostsidetests/securitybulletin/AndroidTest.xml
index c49e0a5..dd6f978 100644
--- a/hostsidetests/securitybulletin/AndroidTest.xml
+++ b/hostsidetests/securitybulletin/AndroidTest.xml
@@ -16,6 +16,10 @@
<configuration description="Config for the CTS Security bulletin host tests">
<target_preparer class="com.android.compatibility.common.tradefed.targetprep.FilePusher">
<option name="cleanup" value="true" />
+ <!--__________________-->
+ <!-- Utilities -->
+ <option name="push" value="pacrunner->/data/local/tmp/pacrunner" />
+
<option name="push" value="CVE-2016-8460->/data/local/tmp/CVE-2016-8460" />
<option name="push" value="CVE-2016-8482->/data/local/tmp/CVE-2016-8482" />
<option name="push" value="CVE-2016-6730->/data/local/tmp/CVE-2016-6730" />
diff --git a/hostsidetests/securitybulletin/src/android/security/cts/AdbUtils.java b/hostsidetests/securitybulletin/src/android/security/cts/AdbUtils.java
index a09f137..204dee8 100644
--- a/hostsidetests/securitybulletin/src/android/security/cts/AdbUtils.java
+++ b/hostsidetests/securitybulletin/src/android/security/cts/AdbUtils.java
@@ -240,6 +240,15 @@
runPocGetExitStatus(pocName, device, timeout) != 113);
}
+ public static int runProxyAutoConfig(String pacName, ITestDevice device) throws Exception {
+ runCommandLine("chmod +x /data/local/tmp/pacrunner", device);
+ String targetPath = "/data/local/tmp/" + pacName + ".pac";
+ AdbUtils.pushResource("/" + pacName + ".pac", targetPath, device);
+ int code = runCommandGetExitCode("/data/local/tmp/pacrunner " + targetPath, device);
+ runCommandLine("rm " + targetPath, device);
+ return code;
+ }
+
/**
* Executes a given poc within a given timeout. Returns error if the
* given poc doesnt complete its execution within timeout. It also deletes