Skip to content

jalong4/AttestProps

Repository files navigation

>>>>> gd2md-html alert: ERRORs: 0; WARNINGs: 0; ALERTS: 9.

  • See top comment block for details on ERRORs and WARNINGs.
  • In the converted Markdown or HTML, search for inline alerts that start with >>>>> gd2md-html alert: for specific instances that need correction.

Links to alert messages:

alert1 alert2 alert3 alert4 alert5 alert6 alert7 alert8 alert9

>>>>> PLEASE check and correct alert issues and delete this message and the inline alerts.


Attestestation Test App

Table of Contents

[TOC]

Description

Attestprops is a test app that calls the Attestation API’s.

The app works on a Android or Android TV device.

>>>>> gd2md-html alert: inline image link here (to images/image1.png). Store image on your image server and adjust path/filename/extension if necessary.
(Back to top)(Next alert)
>>>>>

alt_text

Mobile Screenshot Screenshot from Android TV Device

The app also contains instrumented tests which will allow Attestestation testing to be integrated into workflows, such as Continues Build process or Factory production line testing.

When built there are 2 apk’s produced, the apk for the app which shows the UI above and the apk which contains the test runner that runs the tests by launching the app apk and performing instrumented tests on a device or emulator.

Running Tests and Viewing Test Summary

The tests can be run a number of different ways, either from Android Studio, from adb, or using the gradlew command.

If you use Android Studio or gradlew from the command line, you will need to download the source. However, if you do, you will also get a Test Summary report.

Below is an example of a Test Summary Report. More details on how to access this report can be found later in the document.

>>>>> gd2md-html alert: inline image link here (to images/image2.png). Store image on your image server and adjust path/filename/extension if necessary.
(Back to top)(Next alert)
>>>>>

alt_text

How to Download the apk’s

The apk’s can be found here

Downloading the Source

The source can be found here https://github.com/jalong4/AttestProps

Change Log

Dec 5 changes

Added Instrumented tests

Run all tests:

Install both the app and test apks using adb install <apk name> and then run the tests using the commands below:

adb shell am instrument -w -e class com.google.jimlongja.attestprops.AttestPropsTest \

com.google.jimlongja.attestprops.test/androidx.test.runner.AndroidJUnitRunner

To run a specific test:

adb shell am instrument -w -e class \

com.google.jimlongja.attestprops.AttestPropsTest#VerifiedBootIsSupported \

com.google.jimlongja.attestprops.test/androidx.test.runner.AndroidJUnitRunner

Download the source

You can download the source from here, download the zip file and unzip it to a folder.

If you download the source you can run the tests from android studio by:

Run tests from Android Studio

Open source folder in Android Studio and run the tests. This will install both the app and test apks and run the tests.

Run Tests from Command Line

Run from command line from the root folder of the source code:

./gradlew connectedAndroidTest

Or use the abbreviation

./gradlew cAT

Or run a specific test via gradlew

./gradlew connectedAndroidTest \
-Pandroid.testInstrumentationRunnerArguments.class= \
com.google.jimlongja.attestprops.AttestPropsTest#VerifiedBootIsSupported 

Command to filter output to just test status or Failed or Skipped

./gradlew connectedAndroidTest --info \
-Pandroid.testInstrumentationRunnerArguments.class=com.google.jimlongja.attestprops.AttestPropsTest 2>&1 | \
grep "com.google.jimlongja.attestprops.AttestPropsTest > \|Total tests"

Sample Output:

>>>>> gd2md-html alert: inline image link here (to images/image3.png). Store image on your image server and adjust path/filename/extension if necessary.
(Back to top)(Next alert)
>>>>>

alt_text

On Sabrina with Android Q

>>>>> gd2md-html alert: inline image link here (to images/image4.png). Store image on your image server and adjust path/filename/extension if necessary.
(Back to top)(Next alert)
>>>>>

alt_text

Note: My Sabrina is an EVT. The Sabrina sold in store will passVerifiedBootStateIsVerified

On Pixel 3 with Android Q

>>>>> gd2md-html alert: inline image link here (to images/image5.png). Store image on your image server and adjust path/filename/extension if necessary.
(Back to top)(Next alert)
>>>>>

alt_text

Pixel 3 does not fail any tests. Skipped tests in this case means that the test doesn’t apply until Android S (SDK level 31 and higher).

Here is the associated test summary:

>>>>> gd2md-html alert: inline image link here (to images/image6.png). Store image on your image server and adjust path/filename/extension if necessary.
(Back to top)(Next alert)
>>>>>

alt_text

Note that skipped tests show as “passed” on the html summary.

If you don’t filter the output, it’s a bit confusing as the output will look like the command fails if any of the tests fail (which they mostly will until we get all the features supported in Android S). See screenshot below:

>>>>> gd2md-html alert: inline image link here (to images/image7.png). Store image on your image server and adjust path/filename/extension if necessary.
(Back to top)(Next alert)
>>>>>

alt_text

View Test Summary

After running the gradle command, you can open an html summary file by typing the following command from your terminal prompt:

open -a "Google Chrome" app/build/reports/androidTests/connected/flavors/debugAndroidTest/index.html

This will give a test summary web page. See screenshot below:

>>>>> gd2md-html alert: inline image link here (to images/image8.png). Store image on your image server and adjust path/filename/extension if necessary.
(Back to top)(Next alert)
>>>>>

alt_text

Here is a different view using my Pixel 3 phone as the device under test:

>>>>> gd2md-html alert: inline image link here (to images/image9.png). Store image on your image server and adjust path/filename/extension if necessary.
(Back to top)(Next alert)
>>>>>

alt_text

About

Android Test App which calls Attestation API's

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages