CTS問題分析7
17138 ワード
CTS/GTS問題分析7
ctsフレームワークによる問題を完全に記録したことがなく,この問題で分析方法を記録した.
問題の初探査
テストコマンド:run cts-on-gsi-m CtsMediaTestCases
host logで次のようにエラーを報告します.09-29 17:24:12 I/RemoteAndroidTest: Running am instrument -w -r --no-hidden-api-checks --abi arm64-v8a -e testFile /data/local/tmp/ajur/includes.txt -e debug false -e newRunListenerMode true -e log true -e notAnnotation android.platform.test.annotations.RestrictedBuildTest,android.platform.test.annotations.AppModeInstant -e notTestFile /data/local/tmp/ajur/excludes.txt -e timeout_msec 1800000 android.media.cts/android.support.test.runner.AndroidJUnitRunner on unknown-aosp_on_arm64-8bec9538
09-29 17:24:12 I/InstrumentationResultParser: test run failed: 'Instrumentation run failed due to 'Process crashed.''
devicelogでエラーを報告:09-26 20:22:55.132 18904 18904 D AndroidRuntime: Shutting down VM
09-26 20:22:55.132 18904 18904 E AndroidRuntime: FATAL EXCEPTION: main
09-26 20:22:55.132 18904 18904 E AndroidRuntime: Process: android.media.cts, PID: 18904
09-26 20:22:55.132 18904 18904 E AndroidRuntime: java.lang.RuntimeException: Exception thrown in onCreate() of ComponentInfo{android.media.cts/android.support.test.runner.AndroidJUnitRunner}: java.lang.IllegalArgumentException: "android.media.cts.DecoderTest#testH265HDR10StaticMetadata " not recognized as valid package name
09-26 20:22:55.132 18904 18904 E AndroidRuntime: at android.app.ActivityThread.handleBindApplication(ActivityThread.java:5868)
09-26 20:22:55.132 18904 18904 E AndroidRuntime: at android.app.ActivityThread.access$1100(ActivityThread.java:199)
09-26 20:22:55.132 18904 18904 E AndroidRuntime: at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1650)
09-26 20:22:55.132 18904 18904 E AndroidRuntime: at android.os.Handler.dispatchMessage(Handler.java:106)
09-26 20:22:55.132 18904 18904 E AndroidRuntime: at android.os.Looper.loop(Looper.java:193)
09-26 20:22:55.132 18904 18904 E AndroidRuntime: at android.app.ActivityThread.main(ActivityThread.java:6669)
09-26 20:22:55.132 18904 18904 E AndroidRuntime: at java.lang.reflect.Method.invoke(Native Method)
09-26 20:22:55.132 18904 18904 E AndroidRuntime: at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)
09-26 20:22:55.132 18904 18904 E AndroidRuntime: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:858)
09-26 20:22:55.132 18904 18904 E AndroidRuntime: Caused by: java.lang.IllegalArgumentException: "android.media.cts.DecoderTest#testH265HDR10StaticMetadata " not recognized as valid package name
09-26 20:22:55.132 18904 18904 E AndroidRuntime: at android.support.test.internal.runner.RunnerArgs$Builder.validatePackage(RunnerArgs.java:506)
09-26 20:22:55.132 18904 18904 E AndroidRuntime: at android.support.test.internal.runner.RunnerArgs$Builder.parseFromFile(RunnerArgs.java:449)
09-26 20:22:55.132 18904 18904 E AndroidRuntime: at android.support.test.internal.runner.RunnerArgs$Builder.fromBundle(RunnerArgs.java:242)
09-26 20:22:55.132 18904 18904 E AndroidRuntime: at android.support.test.runner.AndroidJUnitRunner.parseRunnerArgs(AndroidJUnitRunner.java:336)
09-26 20:22:55.132 18904 18904 E AndroidRuntime: at android.support.test.runner.AndroidJUnitRunner.onCreate(AndroidJUnitRunner.java:275)
09-26 20:22:55.132 18904 18904 E AndroidRuntime: at android.app.ActivityThread.handleBindApplication(ActivityThread.java:5863)
09-26 20:22:55.132 18904 18904 E AndroidRuntime: ... 8 more
09-26 20:22:55.136 18904 18904 I Process : Sending signal. PID: 18904 SIG: 9
実はここを見て明らかにgoogleの問題であることを見ることができて、caseの問題ではありませんてフレームワークの問題で、急いでいる時直接フィードバックすることができて、私のここまで歩いて判断する必要はありません
もんだいぶんせき
case問題かフレームワーク問題かを判断すると、まずv 3とv 4のCtsMediaTestCases.apkこのテストapkはすべて反コンパイルを引き出して、必要な時010-エディターを借りて魔数の頭を直して、まずapkをjarパッケージに反編成して、先にcaseの中で間違いの位置の大体の論理を理解します
caseと比較してここでは修正されていませんが、フレームワークの問題です.ここで間違った論理はAndroidJUnitRunnerにある.JAvaでは、ソースコードがありません.そうしないと、この問題は非常にやりやすいです.ソースコードがなければsmaliでlogを加えるしかありません.ちょっと面倒です.まずエラースタックを整理しますpublic void onCreate(Bundle paramBundle)
{
this.mArguments = paramBundle;
parseRunnerArgs(this.mArguments);
if (waitForDebugger(this.mRunnerArgs))
{
Log.i("AndroidJUnitRunner", "Waiting for debugger to connect...");
Debug.waitForDebugger();
Log.i("AndroidJUnitRunner", "Debugger connected.");
}
if (isPrimaryInstrProcess(this.mRunnerArgs.targetProcess)) {
this.mUsageTrackerFacilitator = new UsageTrackerFacilitator(this.mRunnerArgs);
} else {
this.mUsageTrackerFacilitator = new UsageTrackerFacilitator(false);
}
super.onCreate(paramBundle);
paramBundle = this.mRunnerArgs.appListeners.iterator();
while (paramBundle.hasNext())
{
ApplicationLifecycleCallback localApplicationLifecycleCallback = (ApplicationLifecycleCallback)paramBundle.next();
ApplicationLifecycleMonitorRegistry.getInstance().addLifecycleCallback(localApplicationLifecycleCallback);
}
addScreenCaptureProcessors(this.mRunnerArgs);
if ((this.mRunnerArgs.orchestratorService != null) && (isPrimaryInstrProcess(this.mRunnerArgs.targetProcess)))
{
this.mOrchestratorListener = new OrchestratedInstrumentationListener(this);
this.mOrchestratorListener.connect(getContext());
return;
}
start();
}
private void parseRunnerArgs(Bundle paramBundle)
{
this.mRunnerArgs = new RunnerArgs.Builder().fromManifest(this).fromBundle(this, paramBundle).build();
}
public Builder fromBundle(Instrumentation paramInstrumentation, Bundle paramBundle)
{
this.debug = parseBoolean(paramBundle.getString("debug"));
this.delayInMillis = parseUnsignedInt(paramBundle.get("delay_msec"), "delay_msec");
this.tests.addAll(parseTestClasses(paramBundle.getString("class")));
this.notTests.addAll(parseTestClasses(paramBundle.getString("notClass")));
this.testPackages.addAll(parseTestPackages(paramBundle.getString("package")));
this.notTestPackages.addAll(parseTestPackages(paramBundle.getString("notPackage")));
RunnerArgs.TestFileArgs localTestFileArgs = parseFromFile(paramInstrumentation, paramBundle.getString("testFile"));
this.tests.addAll(RunnerArgs.TestFileArgs.access$2900(localTestFileArgs));
this.testPackages.addAll(RunnerArgs.TestFileArgs.access$3000(localTestFileArgs));
paramInstrumentation = parseFromFile(paramInstrumentation, paramBundle.getString("notTestFile"));
this.notTests.addAll(RunnerArgs.TestFileArgs.access$2900(paramInstrumentation));
this.notTestPackages.addAll(RunnerArgs.TestFileArgs.access$3000(paramInstrumentation));
this.listeners.addAll(parseLoadAndInstantiateClasses(paramBundle.getString("listener"), RunListener.class, null));
this.filters.addAll(parseLoadAndInstantiateClasses(paramBundle.getString("filter"), Filter.class, paramBundle));
this.runnerBuilderClasses.addAll(parseAndLoadClasses(paramBundle.getString("runnerBuilder"), RunnerBuilder.class));
this.testSize = paramBundle.getString("size");
this.annotation = paramBundle.getString("annotation");
this.notAnnotations.addAll(parseStrings(paramBundle.getString("notAnnotation")));
this.testTimeout = parseUnsignedLong(paramBundle.getString("timeout_msec"), "timeout_msec");
this.numShards = parseUnsignedInt(paramBundle.get("numShards"), "numShards");
this.shardIndex = parseUnsignedInt(paramBundle.get("shardIndex"), "shardIndex");
this.logOnly = parseBoolean(paramBundle.getString("log"));
this.disableAnalytics = parseBoolean(paramBundle.getString("disableAnalytics"));
this.appListeners.addAll(parseLoadAndInstantiateClasses(paramBundle.getString("appListener"), ApplicationLifecycleCallback.class, null));
this.codeCoverage = parseBoolean(paramBundle.getString("coverage"));
this.codeCoveragePath = paramBundle.getString("coverageFile");
this.suiteAssignment = parseBoolean(paramBundle.getString("suiteAssignment"));
this.classLoader = ((ClassLoader)parseLoadAndInstantiateClass(paramBundle.getString("classLoader"), ClassLoader.class));
this.classpathToScan = parseClasspath(paramBundle.getString("classpathToScan"));
if (paramBundle.containsKey("remoteMethod")) {
this.remoteMethod = parseTestClass(paramBundle.getString("remoteMethod"));
}
this.orchestratorService = paramBundle.getString("orchestratorService");
this.listTestsForOrchestrator = parseBoolean(paramBundle.getString("listTestsForOrchestrator"));
this.targetProcess = paramBundle.getString("targetProcess");
this.screenCaptureProcessors.addAll(parseLoadAndInstantiateClasses(paramBundle.getString("screenCaptureProcessors"), ScreenCaptureProcessor.class, null));
this.shellExecBinderKey = paramBundle.getString("shellExecBinderKey");
this.newRunListenerMode = parseBoolean(paramBundle.getString("newRunListenerMode"));
return this;
}
/* Error */
private RunnerArgs.TestFileArgs parseFromFile(Instrumentation paramInstrumentation, String paramString)
{
// Byte code:
// 0: aconst_null
// 1: astore 4
// 3: aconst_null
// 4: astore 5
// 6: aconst_null
// 7: astore_3
// 8: new 379 android/support/test/internal/runner/RunnerArgs$TestFileArgs
// 11: dup
// 12: aconst_null
// 13: invokespecial 382 android/support/test/internal/runner/RunnerArgs$TestFileArgs: (Landroid/support/test/internal/runner/RunnerArgs$1;)V
// 16: astore 7
// 18: aload_2
// 19: ifnonnull +6 -> 25
// 22: aload 7
// 24: areturn
// 25: aload_0
// 26: aload_1
// 27: aload_2
// 28: invokespecial 384 android/support/test/internal/runner/RunnerArgs$Builder:openFile (Landroid/app/Instrumentation;Ljava/lang/String;)Ljava/io/BufferedReader;
// 31: astore_1
// 32: aload_1
// 33: astore_3
// 34: aload_1
// 35: astore 4
// 37: aload_1
// 38: astore 5
// 40: aload_1
// 41: invokevirtual 387 java/io/BufferedReader:readLine ()Ljava/lang/String;
// 44: astore 8
// 46: aload 8
// 48: ifnull +165 -> 213
// 51: aload_1
// 52: astore_3
// 53: aload_1
// 54: astore 4
// 56: aload_1
// 57: astore 5
// 59: aload 8
// 61: invokestatic 208 java/lang/String:valueOf (Ljava/lang/Object;)Ljava/lang/String;
// 64: astore 6
// 66: aload_1
// 67: astore_3
// 68: aload_1
// 69: astore 4
// 71: aload_1
// 72: astore 5
// 74: aload 6
// 76: invokevirtual 182 java/lang/String:length ()I
// 79: ifeq +24 -> 103
// 82: aload_1
// 83: astore_3
// 84: aload_1
// 85: astore 4
// 87: aload_1
// 88: astore 5
// 90: ldc_w 389
// 93: aload 6
// 95: invokevirtual 231 java/lang/String:concat (Ljava/lang/String;)Ljava/lang/String;
// 98: astore 6
// 100: goto +23 -> 123
// 103: aload_1
// 104: astore_3
// 105: aload_1
// 106: astore 4
// 108: aload_1
// 109: astore 5
// 111: new 168 java/lang/String
// 114: dup
// 115: ldc_w 389
// 118: invokespecial 232 java/lang/String: (Ljava/lang/String;)V
// 121: astore 6
// 123: aload_1
// 124: astore_3
// 125: aload_1
// 126: astore 4
// 128: aload_1
// 129: astore 5
// 131: ldc_w 391
// 134: aload 6
// 136: invokestatic 397 android/util/Log:i (Ljava/lang/String;Ljava/lang/String;)I
// 139: pop
// 140: aload_1
// 141: astore_3
// 142: aload_1
// 143: astore 4
// 145: aload_1
// 146: astore 5
// 148: aload 8
// 150: invokestatic 399 android/support/test/internal/runner/RunnerArgs$Builder:isClassOrMethod (Ljava/lang/String;)Z
// 153: ifeq +30 -> 183
// 156: aload_1
// 157: astore_3
// 158: aload_1
// 159: astore 4
// 161: aload_1
// 162: astore 5
// 164: aload 7
// 166: invokestatic 403 android/support/test/internal/runner/RunnerArgs$TestFileArgs:access$2900 (Landroid/support/test/internal/runner/RunnerArgs$TestFileArgs;)Ljava/util/List;
// 169: aload 8
// 171: invokestatic 407 android/support/test/internal/runner/RunnerArgs$Builder:parseTestClass (Ljava/lang/String;)Landroid/support/test/internal/runner/RunnerArgs$TestArg;
// 174: invokeinterface 198 2 0
// 179: pop
// 180: goto -148 -> 32
// 183: aload_1
// 184: astore_3
// 185: aload_1
// 186: astore 4
// 188: aload_1
// 189: astore 5
// 191: aload 7
// 193: invokestatic 410 android/support/test/internal/runner/RunnerArgs$TestFileArgs:access$3000 (Landroid/support/test/internal/runner/RunnerArgs$TestFileArgs;)Ljava/util/List;
// 196: aload 8
// 198: invokestatic 413 android/support/test/internal/runner/RunnerArgs$Builder:validatePackage (Ljava/lang/String;)Ljava/lang/String;
// 201: invokestatic 417 android/support/test/internal/runner/RunnerArgs$Builder:parseTestPackages (Ljava/lang/String;)Ljava/util/List;
最も肝心な一歩は逆編成されていないことを発見して、バイトコードだけあって、とても便利な判断ができなくて、smaliと結びつけて論理を整理するしかありません@VisibleForTesting
static String validatePackage(String paramString)
{
if (paramString.matches("^([\\p{L}_$][\\p{L}\\p{N}_$]*\\.)*[\\p{L}_$][\\p{L}\\p{N}_$]*$")) {
return paramString;
}
throw new IllegalArgumentException(String.format("\"%s\" not recognized as valid package name", new Object[] { paramString }));
}
validatePackageエラー、スタックによるpackagenameは「android.media.cts.DecoderTest#testH 265 HDR 10 StaticMetadata」
ではなぜこれを報告するのかというと、validatePackageではsmaliでソースコードのないところにlogを付けて、エラーを報告したときだけプラスのlogがあることを発見し、エラーを報告したときだけvalidatePackageを実行することを説明しています.この情報はとても重要です
parseFromFileでvalidatePackageを検索すると、呼び出しは1つしかありません.論理を整理します.以下は重要な情報です..line 445
invoke-static {v3}, Landroid/support/test/internal/runner/RunnerArgs$Builder;->isClassOrMethod(Ljava/lang/String;)Z
move-result v2
if-eqz v2, :cond_2
.line 446
invoke-static {v0}, Landroid/support/test/internal/runner/RunnerArgs$TestFileArgs;->access$2900(Landroid/support/test/internal/runner/RunnerArgs$TestFileArgs;)Ljava/util/List;
move-result-object v2
invoke-static {v3}, Landroid/support/test/internal/runner/RunnerArgs$Builder;->parseTestClass(Ljava/lang/String;)Landroid/support/test/internal/runner/RunnerArgs$TestArg;
move-result-object v4
invoke-interface {v2, v4}, Ljava/util/List;->add(Ljava/lang/Object;)Z
goto :goto_0
.line 449
:cond_2
invoke-static {v0}, Landroid/support/test/internal/runner/RunnerArgs$TestFileArgs;->access$3000(Landroid/support/test/internal/runner/RunnerArgs$TestFileArgs;)Ljava/util/List;
move-result-object v2
invoke-static {v3}, Landroid/support/test/internal/runner/RunnerArgs$Builder;->validatePackage(Ljava/lang/String;)Ljava/lang/String;
move-result-object v4
つまりisClassOrMethodを呼び出してfalseを返す問題@VisibleForTesting
static boolean isClassOrMethod(String paramString)
{
return paramString.matches("^([\\p{L}_$][\\p{L}\\p{N}_$]*\\.)*[\\p{Lu}_$][\\p{L}\\p{N}_$]*(#[\\p{L}_$][\\p{L}\\p{N}_$]*)?$");
}
"android.media.cts.DecoderTest#testH 265 HDR 10 StaticMetadata"は正規表現を通らずvalidatePackageロジックに入り、自然にエラーを報告する
では、この「android.media.cts.DecoderTest#testH 265 HDR 10 StaticMetadata」はどこで付与されているのでしょうか.フレームワークの中でvts-tradefed.jar
vts-tradefed.JAr、cts-on-gsi-exclude.xml、やっぱりスペースが1つ増えました
問題の修正と検証
https://partnerissuetracker.corp.google.com/u/1/issues/116722365
https://android-review.googlesource.com/c/platform/test/vts/+/773225
以上のchangeパッケージを持って、9.0 R 4のtoolsフォルダに入れて置き換えると、意外にも使えないことに気づきました.googleここではよくこのような問題があります.そのフレームワークツールはどのバージョンで編んだのか分かりません.これもgoogleとコミュニケーションできるポイントです.Constance Wu呉暁丹
もちろんローカルで解いてvts-tradefed.jarは利用できますが、幸いなことにexcludesから解析したので、ここではそんなに面倒な必要はありません.txtで解析したエラー結果
2つのファイルを新規作成します.txt(includes.txtと同じ)、excludes 1.txt(excludes.txtの余分なスペースを削除)
そしてadb install CtsMediaTestCases.apk
adb push includes1.txt /data/local/tmp/ajur
adb push excludes1.txt /data/local/tmp/ajur
adb shell am instrument -w -r --no-hidden-api-checks --abi arm64-v8a -e testFile /data/local/tmp/ajur/includes1.txt -e debug false -e newRunListenerMode true -e log true -e notAnnotation android.platform.test.annotations.RestrictedBuildTest,android.platform.test.annotations.AppModeInstant -e notTestFile /data/local/tmp/ajur/excludes1.txt -e timeout_msec 1800000 android.media.cts/android.support.test.runner.AndroidJUnitRunner
ケースは正常に動作し、changeが絶対に有効であることを示します.
まとめ
Googleのcaseは絶対にテストしていません.しかもフレームワークの問題ですが、論理はまだcaseの中にあります.
09-29 17:24:12 I/RemoteAndroidTest: Running am instrument -w -r --no-hidden-api-checks --abi arm64-v8a -e testFile /data/local/tmp/ajur/includes.txt -e debug false -e newRunListenerMode true -e log true -e notAnnotation android.platform.test.annotations.RestrictedBuildTest,android.platform.test.annotations.AppModeInstant -e notTestFile /data/local/tmp/ajur/excludes.txt -e timeout_msec 1800000 android.media.cts/android.support.test.runner.AndroidJUnitRunner on unknown-aosp_on_arm64-8bec9538
09-29 17:24:12 I/InstrumentationResultParser: test run failed: 'Instrumentation run failed due to 'Process crashed.''
09-26 20:22:55.132 18904 18904 D AndroidRuntime: Shutting down VM
09-26 20:22:55.132 18904 18904 E AndroidRuntime: FATAL EXCEPTION: main
09-26 20:22:55.132 18904 18904 E AndroidRuntime: Process: android.media.cts, PID: 18904
09-26 20:22:55.132 18904 18904 E AndroidRuntime: java.lang.RuntimeException: Exception thrown in onCreate() of ComponentInfo{android.media.cts/android.support.test.runner.AndroidJUnitRunner}: java.lang.IllegalArgumentException: "android.media.cts.DecoderTest#testH265HDR10StaticMetadata " not recognized as valid package name
09-26 20:22:55.132 18904 18904 E AndroidRuntime: at android.app.ActivityThread.handleBindApplication(ActivityThread.java:5868)
09-26 20:22:55.132 18904 18904 E AndroidRuntime: at android.app.ActivityThread.access$1100(ActivityThread.java:199)
09-26 20:22:55.132 18904 18904 E AndroidRuntime: at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1650)
09-26 20:22:55.132 18904 18904 E AndroidRuntime: at android.os.Handler.dispatchMessage(Handler.java:106)
09-26 20:22:55.132 18904 18904 E AndroidRuntime: at android.os.Looper.loop(Looper.java:193)
09-26 20:22:55.132 18904 18904 E AndroidRuntime: at android.app.ActivityThread.main(ActivityThread.java:6669)
09-26 20:22:55.132 18904 18904 E AndroidRuntime: at java.lang.reflect.Method.invoke(Native Method)
09-26 20:22:55.132 18904 18904 E AndroidRuntime: at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)
09-26 20:22:55.132 18904 18904 E AndroidRuntime: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:858)
09-26 20:22:55.132 18904 18904 E AndroidRuntime: Caused by: java.lang.IllegalArgumentException: "android.media.cts.DecoderTest#testH265HDR10StaticMetadata " not recognized as valid package name
09-26 20:22:55.132 18904 18904 E AndroidRuntime: at android.support.test.internal.runner.RunnerArgs$Builder.validatePackage(RunnerArgs.java:506)
09-26 20:22:55.132 18904 18904 E AndroidRuntime: at android.support.test.internal.runner.RunnerArgs$Builder.parseFromFile(RunnerArgs.java:449)
09-26 20:22:55.132 18904 18904 E AndroidRuntime: at android.support.test.internal.runner.RunnerArgs$Builder.fromBundle(RunnerArgs.java:242)
09-26 20:22:55.132 18904 18904 E AndroidRuntime: at android.support.test.runner.AndroidJUnitRunner.parseRunnerArgs(AndroidJUnitRunner.java:336)
09-26 20:22:55.132 18904 18904 E AndroidRuntime: at android.support.test.runner.AndroidJUnitRunner.onCreate(AndroidJUnitRunner.java:275)
09-26 20:22:55.132 18904 18904 E AndroidRuntime: at android.app.ActivityThread.handleBindApplication(ActivityThread.java:5863)
09-26 20:22:55.132 18904 18904 E AndroidRuntime: ... 8 more
09-26 20:22:55.136 18904 18904 I Process : Sending signal. PID: 18904 SIG: 9
public void onCreate(Bundle paramBundle)
{
this.mArguments = paramBundle;
parseRunnerArgs(this.mArguments);
if (waitForDebugger(this.mRunnerArgs))
{
Log.i("AndroidJUnitRunner", "Waiting for debugger to connect...");
Debug.waitForDebugger();
Log.i("AndroidJUnitRunner", "Debugger connected.");
}
if (isPrimaryInstrProcess(this.mRunnerArgs.targetProcess)) {
this.mUsageTrackerFacilitator = new UsageTrackerFacilitator(this.mRunnerArgs);
} else {
this.mUsageTrackerFacilitator = new UsageTrackerFacilitator(false);
}
super.onCreate(paramBundle);
paramBundle = this.mRunnerArgs.appListeners.iterator();
while (paramBundle.hasNext())
{
ApplicationLifecycleCallback localApplicationLifecycleCallback = (ApplicationLifecycleCallback)paramBundle.next();
ApplicationLifecycleMonitorRegistry.getInstance().addLifecycleCallback(localApplicationLifecycleCallback);
}
addScreenCaptureProcessors(this.mRunnerArgs);
if ((this.mRunnerArgs.orchestratorService != null) && (isPrimaryInstrProcess(this.mRunnerArgs.targetProcess)))
{
this.mOrchestratorListener = new OrchestratedInstrumentationListener(this);
this.mOrchestratorListener.connect(getContext());
return;
}
start();
}
private void parseRunnerArgs(Bundle paramBundle)
{
this.mRunnerArgs = new RunnerArgs.Builder().fromManifest(this).fromBundle(this, paramBundle).build();
}
public Builder fromBundle(Instrumentation paramInstrumentation, Bundle paramBundle)
{
this.debug = parseBoolean(paramBundle.getString("debug"));
this.delayInMillis = parseUnsignedInt(paramBundle.get("delay_msec"), "delay_msec");
this.tests.addAll(parseTestClasses(paramBundle.getString("class")));
this.notTests.addAll(parseTestClasses(paramBundle.getString("notClass")));
this.testPackages.addAll(parseTestPackages(paramBundle.getString("package")));
this.notTestPackages.addAll(parseTestPackages(paramBundle.getString("notPackage")));
RunnerArgs.TestFileArgs localTestFileArgs = parseFromFile(paramInstrumentation, paramBundle.getString("testFile"));
this.tests.addAll(RunnerArgs.TestFileArgs.access$2900(localTestFileArgs));
this.testPackages.addAll(RunnerArgs.TestFileArgs.access$3000(localTestFileArgs));
paramInstrumentation = parseFromFile(paramInstrumentation, paramBundle.getString("notTestFile"));
this.notTests.addAll(RunnerArgs.TestFileArgs.access$2900(paramInstrumentation));
this.notTestPackages.addAll(RunnerArgs.TestFileArgs.access$3000(paramInstrumentation));
this.listeners.addAll(parseLoadAndInstantiateClasses(paramBundle.getString("listener"), RunListener.class, null));
this.filters.addAll(parseLoadAndInstantiateClasses(paramBundle.getString("filter"), Filter.class, paramBundle));
this.runnerBuilderClasses.addAll(parseAndLoadClasses(paramBundle.getString("runnerBuilder"), RunnerBuilder.class));
this.testSize = paramBundle.getString("size");
this.annotation = paramBundle.getString("annotation");
this.notAnnotations.addAll(parseStrings(paramBundle.getString("notAnnotation")));
this.testTimeout = parseUnsignedLong(paramBundle.getString("timeout_msec"), "timeout_msec");
this.numShards = parseUnsignedInt(paramBundle.get("numShards"), "numShards");
this.shardIndex = parseUnsignedInt(paramBundle.get("shardIndex"), "shardIndex");
this.logOnly = parseBoolean(paramBundle.getString("log"));
this.disableAnalytics = parseBoolean(paramBundle.getString("disableAnalytics"));
this.appListeners.addAll(parseLoadAndInstantiateClasses(paramBundle.getString("appListener"), ApplicationLifecycleCallback.class, null));
this.codeCoverage = parseBoolean(paramBundle.getString("coverage"));
this.codeCoveragePath = paramBundle.getString("coverageFile");
this.suiteAssignment = parseBoolean(paramBundle.getString("suiteAssignment"));
this.classLoader = ((ClassLoader)parseLoadAndInstantiateClass(paramBundle.getString("classLoader"), ClassLoader.class));
this.classpathToScan = parseClasspath(paramBundle.getString("classpathToScan"));
if (paramBundle.containsKey("remoteMethod")) {
this.remoteMethod = parseTestClass(paramBundle.getString("remoteMethod"));
}
this.orchestratorService = paramBundle.getString("orchestratorService");
this.listTestsForOrchestrator = parseBoolean(paramBundle.getString("listTestsForOrchestrator"));
this.targetProcess = paramBundle.getString("targetProcess");
this.screenCaptureProcessors.addAll(parseLoadAndInstantiateClasses(paramBundle.getString("screenCaptureProcessors"), ScreenCaptureProcessor.class, null));
this.shellExecBinderKey = paramBundle.getString("shellExecBinderKey");
this.newRunListenerMode = parseBoolean(paramBundle.getString("newRunListenerMode"));
return this;
}
/* Error */
private RunnerArgs.TestFileArgs parseFromFile(Instrumentation paramInstrumentation, String paramString)
{
// Byte code:
// 0: aconst_null
// 1: astore 4
// 3: aconst_null
// 4: astore 5
// 6: aconst_null
// 7: astore_3
// 8: new 379 android/support/test/internal/runner/RunnerArgs$TestFileArgs
// 11: dup
// 12: aconst_null
// 13: invokespecial 382 android/support/test/internal/runner/RunnerArgs$TestFileArgs: (Landroid/support/test/internal/runner/RunnerArgs$1;)V
// 16: astore 7
// 18: aload_2
// 19: ifnonnull +6 -> 25
// 22: aload 7
// 24: areturn
// 25: aload_0
// 26: aload_1
// 27: aload_2
// 28: invokespecial 384 android/support/test/internal/runner/RunnerArgs$Builder:openFile (Landroid/app/Instrumentation;Ljava/lang/String;)Ljava/io/BufferedReader;
// 31: astore_1
// 32: aload_1
// 33: astore_3
// 34: aload_1
// 35: astore 4
// 37: aload_1
// 38: astore 5
// 40: aload_1
// 41: invokevirtual 387 java/io/BufferedReader:readLine ()Ljava/lang/String;
// 44: astore 8
// 46: aload 8
// 48: ifnull +165 -> 213
// 51: aload_1
// 52: astore_3
// 53: aload_1
// 54: astore 4
// 56: aload_1
// 57: astore 5
// 59: aload 8
// 61: invokestatic 208 java/lang/String:valueOf (Ljava/lang/Object;)Ljava/lang/String;
// 64: astore 6
// 66: aload_1
// 67: astore_3
// 68: aload_1
// 69: astore 4
// 71: aload_1
// 72: astore 5
// 74: aload 6
// 76: invokevirtual 182 java/lang/String:length ()I
// 79: ifeq +24 -> 103
// 82: aload_1
// 83: astore_3
// 84: aload_1
// 85: astore 4
// 87: aload_1
// 88: astore 5
// 90: ldc_w 389
// 93: aload 6
// 95: invokevirtual 231 java/lang/String:concat (Ljava/lang/String;)Ljava/lang/String;
// 98: astore 6
// 100: goto +23 -> 123
// 103: aload_1
// 104: astore_3
// 105: aload_1
// 106: astore 4
// 108: aload_1
// 109: astore 5
// 111: new 168 java/lang/String
// 114: dup
// 115: ldc_w 389
// 118: invokespecial 232 java/lang/String: (Ljava/lang/String;)V
// 121: astore 6
// 123: aload_1
// 124: astore_3
// 125: aload_1
// 126: astore 4
// 128: aload_1
// 129: astore 5
// 131: ldc_w 391
// 134: aload 6
// 136: invokestatic 397 android/util/Log:i (Ljava/lang/String;Ljava/lang/String;)I
// 139: pop
// 140: aload_1
// 141: astore_3
// 142: aload_1
// 143: astore 4
// 145: aload_1
// 146: astore 5
// 148: aload 8
// 150: invokestatic 399 android/support/test/internal/runner/RunnerArgs$Builder:isClassOrMethod (Ljava/lang/String;)Z
// 153: ifeq +30 -> 183
// 156: aload_1
// 157: astore_3
// 158: aload_1
// 159: astore 4
// 161: aload_1
// 162: astore 5
// 164: aload 7
// 166: invokestatic 403 android/support/test/internal/runner/RunnerArgs$TestFileArgs:access$2900 (Landroid/support/test/internal/runner/RunnerArgs$TestFileArgs;)Ljava/util/List;
// 169: aload 8
// 171: invokestatic 407 android/support/test/internal/runner/RunnerArgs$Builder:parseTestClass (Ljava/lang/String;)Landroid/support/test/internal/runner/RunnerArgs$TestArg;
// 174: invokeinterface 198 2 0
// 179: pop
// 180: goto -148 -> 32
// 183: aload_1
// 184: astore_3
// 185: aload_1
// 186: astore 4
// 188: aload_1
// 189: astore 5
// 191: aload 7
// 193: invokestatic 410 android/support/test/internal/runner/RunnerArgs$TestFileArgs:access$3000 (Landroid/support/test/internal/runner/RunnerArgs$TestFileArgs;)Ljava/util/List;
// 196: aload 8
// 198: invokestatic 413 android/support/test/internal/runner/RunnerArgs$Builder:validatePackage (Ljava/lang/String;)Ljava/lang/String;
// 201: invokestatic 417 android/support/test/internal/runner/RunnerArgs$Builder:parseTestPackages (Ljava/lang/String;)Ljava/util/List;
@VisibleForTesting
static String validatePackage(String paramString)
{
if (paramString.matches("^([\\p{L}_$][\\p{L}\\p{N}_$]*\\.)*[\\p{L}_$][\\p{L}\\p{N}_$]*$")) {
return paramString;
}
throw new IllegalArgumentException(String.format("\"%s\" not recognized as valid package name", new Object[] { paramString }));
}
.line 445
invoke-static {v3}, Landroid/support/test/internal/runner/RunnerArgs$Builder;->isClassOrMethod(Ljava/lang/String;)Z
move-result v2
if-eqz v2, :cond_2
.line 446
invoke-static {v0}, Landroid/support/test/internal/runner/RunnerArgs$TestFileArgs;->access$2900(Landroid/support/test/internal/runner/RunnerArgs$TestFileArgs;)Ljava/util/List;
move-result-object v2
invoke-static {v3}, Landroid/support/test/internal/runner/RunnerArgs$Builder;->parseTestClass(Ljava/lang/String;)Landroid/support/test/internal/runner/RunnerArgs$TestArg;
move-result-object v4
invoke-interface {v2, v4}, Ljava/util/List;->add(Ljava/lang/Object;)Z
goto :goto_0
.line 449
:cond_2
invoke-static {v0}, Landroid/support/test/internal/runner/RunnerArgs$TestFileArgs;->access$3000(Landroid/support/test/internal/runner/RunnerArgs$TestFileArgs;)Ljava/util/List;
move-result-object v2
invoke-static {v3}, Landroid/support/test/internal/runner/RunnerArgs$Builder;->validatePackage(Ljava/lang/String;)Ljava/lang/String;
move-result-object v4
@VisibleForTesting
static boolean isClassOrMethod(String paramString)
{
return paramString.matches("^([\\p{L}_$][\\p{L}\\p{N}_$]*\\.)*[\\p{Lu}_$][\\p{L}\\p{N}_$]*(#[\\p{L}_$][\\p{L}\\p{N}_$]*)?$");
}
adb install CtsMediaTestCases.apk
adb push includes1.txt /data/local/tmp/ajur
adb push excludes1.txt /data/local/tmp/ajur
adb shell am instrument -w -r --no-hidden-api-checks --abi arm64-v8a -e testFile /data/local/tmp/ajur/includes1.txt -e debug false -e newRunListenerMode true -e log true -e notAnnotation android.platform.test.annotations.RestrictedBuildTest,android.platform.test.annotations.AppModeInstant -e notTestFile /data/local/tmp/ajur/excludes1.txt -e timeout_msec 1800000 android.media.cts/android.support.test.runner.AndroidJUnitRunner