首页 > 其他分享 >CtsKeystoreTestCases 测试--和keybox相关的几条用例

CtsKeystoreTestCases 测试--和keybox相关的几条用例

时间:2023-09-11 14:34:25浏览次数:27  
标签:STATUS INSTRUMENTATION ParentRunner java -- CtsKeystoreTestCases 用例 android juni

AttestationPerformanceTest

测试方式:adb shell am instrument -r -e class android.keystore.cts.AttestationPerformanceTest -w android.keystore.cts/androidx.test.runner.AndroidJUnitRunner

需要预置keymaster key,同时设备需处于locked状态。

两个fail项:

There were 2 failures:
1) testEcKeyAttestation(android.keystore.cts.AttestationPerformanceTest)
java.security.ProviderException: Failed to generate attestation certificate chain
    at android.security.keystore.AndroidKeyStoreKeyPairGeneratorSpi.getAttestationChain(AndroidKeyStoreKeyPairGeneratorSpi.java:611)
    at android.security.keystore.AndroidKeyStoreKeyPairGeneratorSpi.createCertificateChain(AndroidKeyStoreKeyPairGeneratorSpi.java:498)
    at android.security.keystore.AndroidKeyStoreKeyPairGeneratorSpi.generateKeyPair(AndroidKeyStoreKeyPairGeneratorSpi.java:475)
    at java.security.KeyPairGenerator$Delegate.generateKeyPair(KeyPairGenerator.java:727)
    at android.keystore.cts.AttestationPerformanceTest$KeystoreAttestationMeasurable.initialSetUp(AttestationPerformanceTest.java:116)
    at android.keystore.cts.PerformanceTestBase.measure(PerformanceTestBase.java:109)
    at android.keystore.cts.PerformanceTestBase.measure(PerformanceTestBase.java:63)
    at android.keystore.cts.AttestationPerformanceTest.testEcKeyAttestation(AttestationPerformanceTest.java:60)
    at java.lang.reflect.Method.invoke(Native Method)
    at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50)
    at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
    at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:52)
    at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
    at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325)
    at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78)
    at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57)
    at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
    at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
    at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
    at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
    at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
    at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
    at androidx.test.runner.AndroidJUnit4.run(AndroidJUnit4.java:104)
    at org.junit.runners.Suite.runChild(Suite.java:128)
    at org.junit.runners.Suite.runChild(Suite.java:27)
    at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
    at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
    at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
    at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
    at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
    at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
    at org.junit.runner.JUnitCore.run(JUnitCore.java:137)
    at org.junit.runner.JUnitCore.run(JUnitCore.java:115)
    at androidx.test.internal.runner.TestExecutor.execute(TestExecutor.java:56)
    at androidx.test.runner.AndroidJUnitRunner.onStart(AndroidJUnitRunner.java:395)
    at android.app.Instrumentation$InstrumentationThread.run(Instrumentation.java:2205)
Caused by: android.security.KeyStoreException: Unknown error
    at android.security.KeyStore.getKeyStoreException(KeyStore.java:1301)
    ... 36 more
2) testRsaKeyAttestation(android.keystore.cts.AttestationPerformanceTest)
java.security.ProviderException: Failed to generate attestation certificate chain
    at android.security.keystore.AndroidKeyStoreKeyPairGeneratorSpi.getAttestationChain(AndroidKeyStoreKeyPairGeneratorSpi.java:611)
    at android.security.keystore.AndroidKeyStoreKeyPairGeneratorSpi.createCertificateChain(AndroidKeyStoreKeyPairGeneratorSpi.java:498)
    at android.security.keystore.AndroidKeyStoreKeyPairGeneratorSpi.generateKeyPair(AndroidKeyStoreKeyPairGeneratorSpi.java:475)
    at java.security.KeyPairGenerator$Delegate.generateKeyPair(KeyPairGenerator.java:727)
    at android.keystore.cts.AttestationPerformanceTest$KeystoreAttestationMeasurable.initialSetUp(AttestationPerformanceTest.java:116)
    at android.keystore.cts.PerformanceTestBase.measure(PerformanceTestBase.java:109)
    at android.keystore.cts.PerformanceTestBase.measure(PerformanceTestBase.java:63)
    at android.keystore.cts.AttestationPerformanceTest.testRsaKeyAttestation(AttestationPerformanceTest.java:47)
    at java.lang.reflect.Method.invoke(Native Method)
    at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50)
    at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
    at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:52)
    at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
    at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325)
    at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78)
    at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57)
    at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
    at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
    at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
    at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
    at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
    at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
    at androidx.test.runner.AndroidJUnit4.run(AndroidJUnit4.java:104)
    at org.junit.runners.Suite.runChild(Suite.java:128)
    at org.junit.runners.Suite.runChild(Suite.java:27)
    at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
    at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
    at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
    at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
    at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
    at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
    at org.junit.runner.JUnitCore.run(JUnitCore.java:137)
    at org.junit.runner.JUnitCore.run(JUnitCore.java:115)
    at androidx.test.internal.runner.TestExecutor.execute(TestExecutor.java:56)
    at androidx.test.runner.AndroidJUnitRunner.onStart(AndroidJUnitRunner.java:395)
    at android.app.Instrumentation$InstrumentationThread.run(Instrumentation.java:2205)
Caused by: android.security.KeyStoreException: Unknown error
    at android.security.KeyStore.getKeyStoreException(KeyStore.java:1301)
    ... 36 more

FAILURES!!!
Tests run: 2,  Failures: 2

单独验证:

testRsaKeyAttestation 

>adb shell am instrument -r -e class android.keystore.cts.AttestationPerformanceTest#testRsaKeyAttestation -w android.keystore.cts/androidx.test.runner.AndroidJUnitRunner
INSTRUMENTATION_STATUS: class=android.keystore.cts.AttestationPerformanceTest
INSTRUMENTATION_STATUS: current=1
INSTRUMENTATION_STATUS: id=AndroidJUnitRunner
INSTRUMENTATION_STATUS: numtests=1
INSTRUMENTATION_STATUS: stream=
android.keystore.cts.AttestationPerformanceTest:
INSTRUMENTATION_STATUS: test=testRsaKeyAttestation
INSTRUMENTATION_STATUS_CODE: 1
INSTRUMENTATION_STATUS_CODE: -1
INSTRUMENTATION_STATUS_CODE: -1
INSTRUMENTATION_STATUS_CODE: -1
INSTRUMENTATION_STATUS_CODE: -1
INSTRUMENTATION_STATUS_CODE: -1
INSTRUMENTATION_STATUS_CODE: -1
INSTRUMENTATION_STATUS_CODE: -1
INSTRUMENTATION_STATUS_CODE: -1
INSTRUMENTATION_STATUS_CODE: -1
INSTRUMENTATION_STATUS: class=android.keystore.cts.AttestationPerformanceTest
INSTRUMENTATION_STATUS: current=1
INSTRUMENTATION_STATUS: id=AndroidJUnitRunner
INSTRUMENTATION_STATUS: numtests=1
INSTRUMENTATION_STATUS: stream=.
INSTRUMENTATION_STATUS: test=testRsaKeyAttestation
INSTRUMENTATION_STATUS_CODE: 0
INSTRUMENTATION_RESULT: stream=

Time: 322.029

OK (1 test)


INSTRUMENTATION_CODE: -1

testEcKeyAttestation 

>adb shell am instrument -r -e class android.keystore.cts.AttestationPerformanceTest#testEcKeyAttestation -w android.keystore.cts/androidx.test.runner.AndroidJUnitRunner
INSTRUMENTATION_STATUS: class=android.keystore.cts.AttestationPerformanceTest
INSTRUMENTATION_STATUS: current=1
INSTRUMENTATION_STATUS: id=AndroidJUnitRunner
INSTRUMENTATION_STATUS: numtests=1
INSTRUMENTATION_STATUS: stream=
android.keystore.cts.AttestationPerformanceTest:
INSTRUMENTATION_STATUS: test=testEcKeyAttestation
INSTRUMENTATION_STATUS_CODE: 1
INSTRUMENTATION_STATUS_CODE: -1
INSTRUMENTATION_STATUS_CODE: -1
INSTRUMENTATION_STATUS_CODE: -1
INSTRUMENTATION_STATUS_CODE: -1
INSTRUMENTATION_STATUS_CODE: -1
INSTRUMENTATION_STATUS_CODE: -1
INSTRUMENTATION_STATUS_CODE: -1
INSTRUMENTATION_STATUS_CODE: -1
INSTRUMENTATION_STATUS_CODE: -1
INSTRUMENTATION_STATUS_CODE: -1
INSTRUMENTATION_STATUS_CODE: -1
INSTRUMENTATION_STATUS_CODE: -1
INSTRUMENTATION_STATUS: class=android.keystore.cts.AttestationPerformanceTest
INSTRUMENTATION_STATUS: current=1
INSTRUMENTATION_STATUS: id=AndroidJUnitRunner
INSTRUMENTATION_STATUS: numtests=1
INSTRUMENTATION_STATUS: stream=.
INSTRUMENTATION_STATUS: test=testEcKeyAttestation
INSTRUMENTATION_STATUS_CODE: 0
INSTRUMENTATION_RESULT: stream=

Time: 16.358

OK (1 test)


INSTRUMENTATION_CODE: -1

KeyAttestationTest

4个fail项:

There were 4 failures:
1) testEcAttestation(android.keystore.cts.KeyAttestationTest)
java.lang.Exception: Failed on curve 0 and challege 0
    at android.keystore.cts.KeyAttestationTest.testEcAttestation(KeyAttestationTest.java:184)
    at java.lang.reflect.Method.invoke(Native Method)
    at junit.framework.TestCase.runTest(TestCase.java:168)
    at junit.framework.TestCase.runBare(TestCase.java:134)
    at junit.framework.TestResult$1.protect(TestResult.java:115)
    at androidx.test.internal.runner.junit3.AndroidTestResult.runProtected(AndroidTestResult.java:73)
    at junit.framework.TestResult.run(TestResult.java:118)
    at androidx.test.internal.runner.junit3.AndroidTestResult.run(AndroidTestResult.java:51)
    at junit.framework.TestCase.run(TestCase.java:124)
    at androidx.test.internal.runner.junit3.NonLeakyTestSuite$NonLeakyTest.run(NonLeakyTestSuite.java:62)
    at junit.framework.TestSuite.runTest(TestSuite.java:243)
    at junit.framework.TestSuite.run(TestSuite.java:238)
    at androidx.test.internal.runner.junit3.DelegatingTestSuite.run(DelegatingTestSuite.java:97)
    at androidx.test.internal.runner.junit3.AndroidTestSuite.run(AndroidTestSuite.java:65)
    at androidx.test.internal.runner.junit3.JUnit38ClassRunner.run(JUnit38ClassRunner.java:115)
    at org.junit.runners.Suite.runChild(Suite.java:128)
    at org.junit.runners.Suite.runChild(Suite.java:27)
    at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
    at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
    at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
    at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
    at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
    at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
    at org.junit.runner.JUnitCore.run(JUnitCore.java:137)
    at org.junit.runner.JUnitCore.run(JUnitCore.java:115)
    at androidx.test.internal.runner.TestExecutor.execute(TestExecutor.java:56)
    at androidx.test.runner.AndroidJUnitRunner.onStart(AndroidJUnitRunner.java:395)
    at android.app.Instrumentation$InstrumentationThread.run(Instrumentation.java:2205)
Caused by: java.security.ProviderException: Failed to generate attestation certificate chain
    at android.security.keystore.AndroidKeyStoreKeyPairGeneratorSpi.getAttestationChain(AndroidKeyStoreKeyPairGeneratorSpi.java:611)
    at android.security.keystore.AndroidKeyStoreKeyPairGeneratorSpi.createCertificateChain(AndroidKeyStoreKeyPairGeneratorSpi.java:498)
    at android.security.keystore.AndroidKeyStoreKeyPairGeneratorSpi.generateKeyPair(AndroidKeyStoreKeyPairGeneratorSpi.java:475)
    at java.security.KeyPairGenerator$Delegate.generateKeyPair(KeyPairGenerator.java:727)
    at android.keystore.cts.KeyAttestationTest.generateKeyPair(KeyAttestationTest.java:1140)
    at android.keystore.cts.KeyAttestationTest.testEcAttestation(KeyAttestationTest.java:597)
    at android.keystore.cts.KeyAttestationTest.testEcAttestation(KeyAttestationTest.java:177)
    ... 27 more
Caused by: android.security.KeyStoreException: Unknown error
    at android.security.KeyStore.getKeyStoreException(KeyStore.java:1301)
    ... 34 more
2) testEcAttestation_DeviceLocked(android.keystore.cts.KeyAttestationTest)
java.security.ProviderException: Failed to generate attestation certificate chain
    at android.security.keystore.AndroidKeyStoreKeyPairGeneratorSpi.getAttestationChain(AndroidKeyStoreKeyPairGeneratorSpi.java:611)
    at android.security.keystore.AndroidKeyStoreKeyPairGeneratorSpi.createCertificateChain(AndroidKeyStoreKeyPairGeneratorSpi.java:498)
    at android.security.keystore.AndroidKeyStoreKeyPairGeneratorSpi.generateKeyPair(AndroidKeyStoreKeyPairGeneratorSpi.java:475)
    at java.security.KeyPairGenerator$Delegate.generateKeyPair(KeyPairGenerator.java:727)
    at android.keystore.cts.KeyAttestationTest.generateKeyPair(KeyAttestationTest.java:1140)
    at android.keystore.cts.KeyAttestationTest.testEcAttestation_DeviceLocked(KeyAttestationTest.java:267)
    at java.lang.reflect.Method.invoke(Native Method)
    at junit.framework.TestCase.runTest(TestCase.java:168)
    at junit.framework.TestCase.runBare(TestCase.java:134)
    at junit.framework.TestResult$1.protect(TestResult.java:115)
    at androidx.test.internal.runner.junit3.AndroidTestResult.runProtected(AndroidTestResult.java:73)
    at junit.framework.TestResult.run(TestResult.java:118)
    at androidx.test.internal.runner.junit3.AndroidTestResult.run(AndroidTestResult.java:51)
    at junit.framework.TestCase.run(TestCase.java:124)
    at androidx.test.internal.runner.junit3.NonLeakyTestSuite$NonLeakyTest.run(NonLeakyTestSuite.java:62)
    at junit.framework.TestSuite.runTest(TestSuite.java:243)
    at junit.framework.TestSuite.run(TestSuite.java:238)
    at androidx.test.internal.runner.junit3.DelegatingTestSuite.run(DelegatingTestSuite.java:97)
    at androidx.test.internal.runner.junit3.AndroidTestSuite.run(AndroidTestSuite.java:65)
    at androidx.test.internal.runner.junit3.JUnit38ClassRunner.run(JUnit38ClassRunner.java:115)
    at org.junit.runners.Suite.runChild(Suite.java:128)
    at org.junit.runners.Suite.runChild(Suite.java:27)
    at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
    at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
    at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
    at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
    at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
    at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
    at org.junit.runner.JUnitCore.run(JUnitCore.java:137)
    at org.junit.runner.JUnitCore.run(JUnitCore.java:115)
    at androidx.test.internal.runner.TestExecutor.execute(TestExecutor.java:56)
    at androidx.test.runner.AndroidJUnitRunner.onStart(AndroidJUnitRunner.java:395)
    at android.app.Instrumentation$InstrumentationThread.run(Instrumentation.java:2205)
Caused by: android.security.KeyStoreException: Unknown error
    at android.security.KeyStore.getKeyStoreException(KeyStore.java:1301)
    ... 33 more
3) testRsaAttestation(android.keystore.cts.KeyAttestationTest)
java.lang.Exception: Failed on key size 512 challenge [], purposes [2, 3] and paddings [PKCS1]
    at android.keystore.cts.KeyAttestationTest.testRsaAttestations(KeyAttestationTest.java:503)
    at android.keystore.cts.KeyAttestationTest.testRsaAttestation(KeyAttestationTest.java:361)
    at java.lang.reflect.Method.invoke(Native Method)
    at junit.framework.TestCase.runTest(TestCase.java:168)
    at junit.framework.TestCase.runBare(TestCase.java:134)
    at junit.framework.TestResult$1.protect(TestResult.java:115)
    at androidx.test.internal.runner.junit3.AndroidTestResult.runProtected(AndroidTestResult.java:73)
    at junit.framework.TestResult.run(TestResult.java:118)
    at androidx.test.internal.runner.junit3.AndroidTestResult.run(AndroidTestResult.java:51)
    at junit.framework.TestCase.run(TestCase.java:124)
    at androidx.test.internal.runner.junit3.NonLeakyTestSuite$NonLeakyTest.run(NonLeakyTestSuite.java:62)
    at junit.framework.TestSuite.runTest(TestSuite.java:243)
    at junit.framework.TestSuite.run(TestSuite.java:238)
    at androidx.test.internal.runner.junit3.DelegatingTestSuite.run(DelegatingTestSuite.java:97)
    at androidx.test.internal.runner.junit3.AndroidTestSuite.run(AndroidTestSuite.java:65)
    at androidx.test.internal.runner.junit3.JUnit38ClassRunner.run(JUnit38ClassRunner.java:115)
    at org.junit.runners.Suite.runChild(Suite.java:128)
    at org.junit.runners.Suite.runChild(Suite.java:27)
    at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
    at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
    at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
    at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
    at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
    at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
    at org.junit.runner.JUnitCore.run(JUnitCore.java:137)
    at org.junit.runner.JUnitCore.run(JUnitCore.java:115)
    at androidx.test.internal.runner.TestExecutor.execute(TestExecutor.java:56)
    at androidx.test.runner.AndroidJUnitRunner.onStart(AndroidJUnitRunner.java:395)
    at android.app.Instrumentation$InstrumentationThread.run(Instrumentation.java:2205)
Caused by: java.security.ProviderException: Failed to generate attestation certificate chain
    at android.security.keystore.AndroidKeyStoreKeyPairGeneratorSpi.getAttestationChain(AndroidKeyStoreKeyPairGeneratorSpi.java:611)
    at android.security.keystore.AndroidKeyStoreKeyPairGeneratorSpi.createCertificateChain(AndroidKeyStoreKeyPairGeneratorSpi.java:498)
    at android.security.keystore.AndroidKeyStoreKeyPairGeneratorSpi.generateKeyPair(AndroidKeyStoreKeyPairGeneratorSpi.java:475)
    at java.security.KeyPairGenerator$Delegate.generateKeyPair(KeyPairGenerator.java:727)
    at android.keystore.cts.KeyAttestationTest.generateKeyPair(KeyAttestationTest.java:1140)
    at android.keystore.cts.KeyAttestationTest.testRsaAttestation(KeyAttestationTest.java:543)
    at android.keystore.cts.KeyAttestationTest.testRsaAttestations(KeyAttestationTest.java:495)
    ... 28 more
Caused by: android.security.KeyStoreException: Unknown error
    at android.security.KeyStore.getKeyStoreException(KeyStore.java:1301)
    ... 35 more
4) testRsaAttestation_DeviceLocked(android.keystore.cts.KeyAttestationTest)
java.security.ProviderException: Failed to generate attestation certificate chain
    at android.security.keystore.AndroidKeyStoreKeyPairGeneratorSpi.getAttestationChain(AndroidKeyStoreKeyPairGeneratorSpi.java:611)
    at android.security.keystore.AndroidKeyStoreKeyPairGeneratorSpi.createCertificateChain(AndroidKeyStoreKeyPairGeneratorSpi.java:498)
    at android.security.keystore.AndroidKeyStoreKeyPairGeneratorSpi.generateKeyPair(AndroidKeyStoreKeyPairGeneratorSpi.java:475)
    at java.security.KeyPairGenerator$Delegate.generateKeyPair(KeyPairGenerator.java:727)
    at android.keystore.cts.KeyAttestationTest.generateKeyPair(KeyAttestationTest.java:1140)
    at android.keystore.cts.KeyAttestationTest.testRsaAttestation_DeviceLocked(KeyAttestationTest.java:441)
    at java.lang.reflect.Method.invoke(Native Method)
    at junit.framework.TestCase.runTest(TestCase.java:168)
    at junit.framework.TestCase.runBare(TestCase.java:134)
    at junit.framework.TestResult$1.protect(TestResult.java:115)
    at androidx.test.internal.runner.junit3.AndroidTestResult.runProtected(AndroidTestResult.java:73)
    at junit.framework.TestResult.run(TestResult.java:118)
    at androidx.test.internal.runner.junit3.AndroidTestResult.run(AndroidTestResult.java:51)
    at junit.framework.TestCase.run(TestCase.java:124)
    at androidx.test.internal.runner.junit3.NonLeakyTestSuite$NonLeakyTest.run(NonLeakyTestSuite.java:62)
    at junit.framework.TestSuite.runTest(TestSuite.java:243)
    at junit.framework.TestSuite.run(TestSuite.java:238)
    at androidx.test.internal.runner.junit3.DelegatingTestSuite.run(DelegatingTestSuite.java:97)
    at androidx.test.internal.runner.junit3.AndroidTestSuite.run(AndroidTestSuite.java:65)
    at androidx.test.internal.runner.junit3.JUnit38ClassRunner.run(JUnit38ClassRunner.java:115)
    at org.junit.runners.Suite.runChild(Suite.java:128)
    at org.junit.runners.Suite.runChild(Suite.java:27)
    at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
    at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
    at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
    at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
    at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
    at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
    at org.junit.runner.JUnitCore.run(JUnitCore.java:137)
    at org.junit.runner.JUnitCore.run(JUnitCore.java:115)
    at androidx.test.internal.runner.TestExecutor.execute(TestExecutor.java:56)
    at androidx.test.runner.AndroidJUnitRunner.onStart(AndroidJUnitRunner.java:395)
    at android.app.Instrumentation$InstrumentationThread.run(Instrumentation.java:2205)
Caused by: android.security.KeyStoreException: Unknown error
    at android.security.KeyStore.getKeyStoreException(KeyStore.java:1301)
    ... 33 more

FAILURES!!!
Tests run: 13,  Failures: 4

单独验证:

testRsaAttestation_DeviceLocked 

设备需要配置为locked状态

>adb shell am instrument -r -e class android.keystore.cts.KeyAttestationTest#testRsaAttestation_DeviceLocked -w android.keystore.cts/androidx.test.runner.AndroidJUnitRunner
INSTRUMENTATION_STATUS: class=android.keystore.cts.KeyAttestationTest
INSTRUMENTATION_STATUS: current=1
INSTRUMENTATION_STATUS: id=AndroidJUnitRunner
INSTRUMENTATION_STATUS: numtests=1
INSTRUMENTATION_STATUS: stream=
android.keystore.cts.KeyAttestationTest:
INSTRUMENTATION_STATUS: test=testRsaAttestation_DeviceLocked
INSTRUMENTATION_STATUS_CODE: 1
INSTRUMENTATION_STATUS: class=android.keystore.cts.KeyAttestationTest
INSTRUMENTATION_STATUS: current=1
INSTRUMENTATION_STATUS: id=AndroidJUnitRunner
INSTRUMENTATION_STATUS: numtests=1
INSTRUMENTATION_STATUS: stream=.
INSTRUMENTATION_STATUS: test=testRsaAttestation_DeviceLocked
INSTRUMENTATION_STATUS_CODE: 0
INSTRUMENTATION_RESULT: stream=

Time: 8.941

OK (1 test)


INSTRUMENTATION_CODE: -1

testRsaAttestation 

>adb shell am instrument -r -e class android.keystore.cts.KeyAttestationTest#testRsaAttestation -w android.keystore.cts/androidx.test.runner.AndroidJUnitRunner
INSTRUMENTATION_STATUS: class=android.keystore.cts.KeyAttestationTest
INSTRUMENTATION_STATUS: current=1
INSTRUMENTATION_STATUS: id=AndroidJUnitRunner
INSTRUMENTATION_STATUS: numtests=1
INSTRUMENTATION_STATUS: stream=
android.keystore.cts.KeyAttestationTest:
INSTRUMENTATION_STATUS: test=testRsaAttestation
INSTRUMENTATION_STATUS_CODE: 1
INSTRUMENTATION_STATUS: class=android.keystore.cts.KeyAttestationTest
INSTRUMENTATION_STATUS: current=1
INSTRUMENTATION_STATUS: id=AndroidJUnitRunner
INSTRUMENTATION_STATUS: numtests=1
INSTRUMENTATION_STATUS: stream=.
INSTRUMENTATION_STATUS: test=testRsaAttestation
INSTRUMENTATION_STATUS_CODE: 0
INSTRUMENTATION_RESULT: stream=

Time: 208.62

OK (1 test)


INSTRUMENTATION_CODE: -1

testEcAttestation_DeviceLocked 

设备需要配置为locked状态

>adb shell am instrument -r -e class android.keystore.cts.KeyAttestationTest#testEcAttestation_DeviceLocked -w android.keystore.cts/androidx.test.runner.AndroidJUnitRunner
INSTRUMENTATION_STATUS: class=android.keystore.cts.KeyAttestationTest
INSTRUMENTATION_STATUS: current=1
INSTRUMENTATION_STATUS: id=AndroidJUnitRunner
INSTRUMENTATION_STATUS: numtests=1
INSTRUMENTATION_STATUS: stream=
android.keystore.cts.KeyAttestationTest:
INSTRUMENTATION_STATUS: test=testEcAttestation_DeviceLocked
INSTRUMENTATION_STATUS_CODE: 1
INSTRUMENTATION_STATUS: class=android.keystore.cts.KeyAttestationTest
INSTRUMENTATION_STATUS: current=1
INSTRUMENTATION_STATUS: id=AndroidJUnitRunner
INSTRUMENTATION_STATUS: numtests=1
INSTRUMENTATION_STATUS: stream=.
INSTRUMENTATION_STATUS: test=testEcAttestation_DeviceLocked
INSTRUMENTATION_STATUS_CODE: 0
INSTRUMENTATION_RESULT: stream=

Time: 1.091

OK (1 test)


INSTRUMENTATION_CODE: -1

testEcAttestation 

>adb shell am instrument -r -e class android.keystore.cts.KeyAttestationTest#testEcAttestation -w android.keystore.cts/androidx.test.runner.AndroidJUnitRunner
INSTRUMENTATION_STATUS: class=android.keystore.cts.KeyAttestationTest
INSTRUMENTATION_STATUS: current=1
INSTRUMENTATION_STATUS: id=AndroidJUnitRunner
INSTRUMENTATION_STATUS: numtests=1
INSTRUMENTATION_STATUS: stream=
android.keystore.cts.KeyAttestationTest:
INSTRUMENTATION_STATUS: test=testEcAttestation
INSTRUMENTATION_STATUS_CODE: 1
INSTRUMENTATION_STATUS: class=android.keystore.cts.KeyAttestationTest
INSTRUMENTATION_STATUS: current=1
INSTRUMENTATION_STATUS: id=AndroidJUnitRunner
INSTRUMENTATION_STATUS: numtests=1
INSTRUMENTATION_STATUS: stream=.
INSTRUMENTATION_STATUS: test=testEcAttestation
INSTRUMENTATION_STATUS_CODE: 0
INSTRUMENTATION_RESULT: stream=

Time: 85.976

OK (1 test)


INSTRUMENTATION_CODE: -1

 

标签:STATUS,INSTRUMENTATION,ParentRunner,java,--,CtsKeystoreTestCases,用例,android,juni
From: https://www.cnblogs.com/xiululu/p/17693482.html

相关文章

  • 以程序员视角讲述关于api数据接口的应用
    作为一名程序员,API数据接口是我们日常工作中不可或缺的一部分。API,即ApplicationProgrammingInterface,应用程序编程接口,是一种用于访问特定软件包或服务的预定义函数和过程。通过API,我们可以从各种数据源获取数据,并将其用于构建应用程序、网站或其他数字工具。下面,我将以一个程序......
  • 数学禁忌公式
    欧拉公式(Euler'sformula):e^ix=cos(x)+i*sin(x)皮亚诺定理(Peano'stheorem):对于连续函数f(x),存在一个多项式序列逐点收敛到f(x)黎曼和(Riemannsum):近似计算定积分的方法泰勒公式(Taylor'sformula):将函数展开成幂级数的形式傅里叶级数(Fourierseries):将周期函数分......
  • IGES文件格式解析与格式转换
    IGES文件格式简介IGS是根据IGES标准生成的文件,主要用于不同三维软件系统的文件转换。IGES标准,是建立在波音公司CAD/CAM集成信息网络、通用电气公司的中心数据库和其他各种数据交换格式之上的。其最初版本仅限于描述工程图纸的几何图形和注释,随后又将电气、有限元、工厂设计和建筑设......
  • 软件测试|好用的pycharm插件推荐(三)——Rainbow Brackets
    简介我们平时写代码的时候,括号是让我们非常头疼的地方,特别是代码逻辑很多,层层嵌套的情况。一眼很难看出,代码是从哪个括号开始,到哪个反括号结束的。这个时候要是有一款工具能够让我们一眼就看出代码从哪个括号开始,到哪个反括号结束,无疑对我们会有很大帮助。PyCharmRainbowBracket......
  • 大屏屏幕自适应大小的JS写法
    本项目用的是vue开发,首先需要定义一下根节点app节点的大小,这里用1920的默认宽度定义<style>#app{width:1920px;margin:0auto;transform:scale(1);transform-origin:00;}</style>js部分通过缩放的写法去在......
  • springcloud日常学习
    一、 Ribbon客户端负载均衡1. 负载均衡介绍  ① LB,即负载均衡(LoadBalance),负载均衡是微服务架构中经常使用的一种技术。负载均衡是我们处理高并发、缓解网络压力和进行服务端扩容的重要手段之一,简单的说就是将用户的请求平摊的分配到多个服务上,从而实现系统的高可用性集群。......
  • 澳洲本科就读期间被处分COE被取消无学位的解决办法
    澳洲本科就读期间被处分COE被取消无学位的解决办法在澳洲留学的学生可以注意一下,就读期间可能会有这些情况影响自己的学业,以及签证COE比如:1、低于学校规定的出勤率,一般来说不能低于70%,严格的院校要求不能低于80%;2、必修科目重复不及格两次及以上;3、连续两学期超过50%以上的科目不及......
  • Lnton羚通视频分析算法开发平台关于AI智能识别操作行为流程规范识别算法分析展示
    Lnton羚通的算法算力云平台是一款优秀的解决方案,具有突出的特点。它提供高性能、高可靠性、高可扩展性和低成本的特性,使用户能够高效地执行复杂计算任务。此外,平台还提供丰富的算法库和工具,并支持用户上传和部署自定义算法,提升了平台的灵活性和个性化能力。AI工人操作行为流程规范......
  • 数据库----初识
    《世界诞生的前夜----开发环境配置》在进入数据库开发软件时遇到这样一个错误:  看起来是SQLServer(数据库管理系统)发生了错误,  找到数据库管理系统设置工具,让SQLServer运行起来就行了......
  • 日志是你的朋友:为什么每个开发者都应该写日志
    大家好,我是小米,一个热衷于技术分享的程序员。今天我想和大家聊一聊一个在编写代码时常常被忽视,却极为重要的话题——为什么要写有意义的日志。在日常的编程工作中,我们经常听到“日志”这个词,但是有些人可能并不理解为什么要在代码中写入日志,或者觉得这只是一种不必要的繁琐。但是,当......