Difference between revisions of "Test Standards"

From eLinux.org
Jump to: navigation, search
(Test Execution API (E): add device discovery protocol)
(38 intermediate revisions by 4 users not shown)
Line 10: Line 10:
 
Here are some things we'd like to standardize in open source automated testing:
 
Here are some things we'd like to standardize in open source automated testing:
 
= Terminology and Framework =
 
= Terminology and Framework =
* test nomenclature (test glossary)
+
* Test nomenclature - See the [[Test Glossary]]
 
* CI loop diagram
 
* CI loop diagram
 +
== Diagram ==
 +
Below is a diagram for the high level CI loop:
 +
 +
The boxes represent different processes, hardware, or storage locations.  Lines between boxes indicate APIs or control flow,
 +
and are labeled with letters.  The intent of this is to provide a reference model for the test standards.
 +
 +
[[File:CI-Loop-high-level-arch-v3.jpg|1000px|high level CI loop]]
 +
 +
= Board management (G) =
 +
This standard has a set of APIs or interfaces for managing the devices under test (DUTs)
 +
It includes things like:
 +
* board reservation
 +
* image instantiation (in the case of VMs or emulators)
 +
* board provisioning (installation of software under test)
 +
* power control (or, in the case of VMs - VM start)
 +
** See [[Test Power Control Notes]]
 +
* bus control
 +
* power measurement
 +
* attribute discovery
 +
* console monitoring
 +
* file transfer to/from the board
 +
* command execution
 +
 +
See [[Board Management Layer Notes]]
 +
 +
== Power Control ==
 +
The power control API is a standard for controlling the power state of a board
 +
in a board farm (inside an automated testing farm).
 +
 +
See [[Test Power Control Notes]]
 +
 +
=== Standards ===
 +
pdudaemon was selected as the standard for controlling power to a board in a lab.
 +
 +
The document containing this standard is at:
 +
* https://github.com/dave-pigott/pdudaemon/blob/master/share/powercontrolapi.md
 +
or
 +
* https://docs.google.com/document/d/1-f2VNVlOnaJUSKUUWeYko3wXh7_ertbFD55y_0dTZvI
 +
 +
== Board IO connections ==
 +
This consists of the ability to control or test features of the board that are related
 +
to busses or other connections to the device under test.  This could include
 +
things like:
 +
* serial ports
 +
* USB buses
 +
* i2c
 +
* CAN
 +
 +
It might also involve any other aspect of board IO, such as audio, video, gpio, leds,
 +
etc.
 +
 +
In general, the connection might be between the board farm controller node and the DUT (interface G)
 +
or between some special hardware and the DUT (interface H, controlled by interface J).
 +
 +
See [[Board IO connection Testing]]
  
 
= Test Definition =
 
= Test Definition =
* fields
+
The test definition is the set of attributes, code, and data that are used to perform a test.
* file format (json, xml, etc.)
+
A test definition standard would specify things like the following:
* meta-data
+
 
* visualization control
+
* fields - the data elements of a test
** ex: chart_config.json
+
* file format (json, xml, etc.) - how a test is expressed and transported
* instructions
+
* meta-data - data describing the test
 +
* visualization control - information used for visualization of results
 +
* instructions - executable code to perform the test
 +
 
 +
See [[Test Definition Project]] for more information about a project to
 +
harmonize test definitions across multiple test systems.
 +
 
 +
== Test Definition server ==
 +
The test definition itself is separate from the API or interface to a test definition server.
 +
A test definition server is a place where test definitions are stored.
 +
 
 +
In 2019, there is not central repository for test definitions that hold open source test definitions for
 +
multiple test frameworks.
  
=== Test dependencies ===
+
But there is some movement towards storing auto-generated test (produced by fuzzers) for the linux kernel
 +
in a centralized location.  See this repository: https://git.kernel.org/pub/scm/linux/kernel/git/shuah/linux-arts.git/
 +
Discussion about the creation of this repository is at: https://lwn.net/Articles/799162/
 +
 
 +
 
 +
== Test dependencies ==
 
* how to specify test dependencies
 
* how to specify test dependencies
 
** ex: assert_define ENV_VAR_NAME
 
** ex: assert_define ENV_VAR_NAME
Line 29: Line 101:
 
See [[Test_Dependencies]]
 
See [[Test_Dependencies]]
  
== Pass Criteria ==
+
= Test Execution API (E) =
* what tests can be skipped (this is more part of test execution and control)
+
See [[Test Execution Notes]] for more details and miscellaneous notes.
* what test results can be ignored (xfail)
 
* min required pass counts, max allowed failures
 
* thresholds for measurement results
 
** requires testcase id, number and operator
 
 
 
 
 
  
= Test Execution API (E) =
 
 
* test API
 
* test API
 
* host/target abstraction
 
* host/target abstraction
** kernel installation
+
** kernel installation / provisioning
 +
*** See [[Board Provisioning Notes]]
 
** file operations
 
** file operations
 
** console access
 
** console access
Line 48: Line 114:
 
** test execution:
 
** test execution:
 
*** ex: 'make test'
 
*** ex: 'make test'
 +
*** runtest.sh?
 +
*** communicating lab and board-specific parameters to a test
 +
**** See [[LTP device discovery protocol]]
 
* test phases
 
* test phases
 +
 +
= Build Artifacts =
 +
* test package format
 +
** meta-data for each test
 +
** test results
 +
** baseline expected results for particular tests on particular platforms
 +
 +
== Test package format ==
 +
This is a package intended to be installed on a target (as opposed to the collection of test definition
 +
information that may be stored elsewhere in the test system)
 +
 +
== Test server ==
 +
This is a place where tests or test packages can be stored, and downloaded for use in a CI framework.
 +
 +
See [[Test Server Notes]]
  
 
= Run Artifacts =
 
= Run Artifacts =
Line 55: Line 139:
 
* monitor results (power log, trace log)
 
* monitor results (power log, trace log)
 
* snapshots
 
* snapshots
 +
  
 
== Results Format ==
 
== Results Format ==
 +
See [[Test Results Format Notes]] for details and miscellaneous notes
 +
 +
The results format is the output from the test and creates is part of the interface between
 +
the test program and the test execution layer (or test harness).
 +
 +
The main thing that the format communicates is the list of testcases (or metrics, in the case of benchmarks)
 +
and the result of the testcase (pass, fail, etc.)
 +
 
* test log output format
 
* test log output format
 
** counts
 
** counts
 
** subtest results
 
** subtest results
 
** Candidate formats:
 
** Candidate formats:
*** https://testanything.org/
+
*** [https://testanything.org/ TAP (TestAnythingProtocol)]
 +
*** [https://github.com/testing-cabal/subunit SubUnit]
 +
*** JUnit
 +
 
 +
=== Server-based results storage ===
 +
==== yocto project ====
 +
All our test results for YP builds are added to a git repository:
  
One aspect of the result format is the result or status code for individual
+
http://git.yoctoproject.org/cgit.cgi/yocto-testresults/
test cases or the test itself.
 
See [[Test Result Codes]]
 
  
= Build Artifacts =
+
(they're stored in a json format). the YP project doesn't have good tools to analyse
* test package format
+
the data yet but are at least storing them.
** meta-data for each test
+
 
** test results
+
==== Fuego ====
** baseline expected results for particular tests on particular platforms
+
Uses the fserver project (https://github.com/tbird20d/fserver) to store run results in a common location.
 +
 
 +
Data is stored using Fuego's run.json format (http://fuegotest.org/wiki/run.json)
 +
 
 +
Fuego can also save results to a kernelci backend and a Squad backend.
 +
 
 +
==== KernelCI ====
 +
Site: https://kerneci.org/
 +
 
 +
A test has the results from a test: https://api.kernelci.org/schema-test.html
 +
A test group is a collection of test cases:
 +
See https://api.kernelci.org/schema-test-group.html
 +
and
 +
https://api.kernelci.org/schema-test-case.html
 +
 
 +
==== SQUAD ====
 +
The results backend for LKFT is: https://qa-reports.linaro.org/lkft/
 +
 
 +
Source code for SQUAD: https://github.com/linaro/squad
 +
 
 +
Documentation: https://squad.readthedocs.io/en/latest/
 +
 
 +
==== BigQuery common results server project ====
 +
The client for this is at:
 +
https://github.com/spbnick/kcidb
 +
 
 +
The server for this is at:
 +
??
 +
 
 +
=== Standards ===
 +
The Linux kernel kselftest uses TAP as the preferred output format.
 +
 
 +
= Pass Criteria =
 +
The pass criteria is a set of data that indicate to the test framework how to interpret
 +
the results from a test.  They can indicate the following:
 +
 
 +
* what tests can be skipped (this is more part of test execution and control)
 +
* what test results can be ignored (xfail)
 +
* min required pass counts, max allowed failures
 +
* thresholds for measurement results
 +
** requires testcase id, number and operator
 +
 
 +
The pass criteria allows separation of things like expected failure from the test code itself,
 +
to allow for situations where different sets of results are interpreted as success or failure
 +
depending on factors outside the test (for example, kernel version, kernel configuration,
 +
available hardware, etc.)
 +
 
 +
For things like functional unit tests, a single failing result should result in the
 +
overall failure of a test suite.  However, for system tests or benchmarks, it is often
 +
the case that some results must be interpreted in a context-sensitive manner, or some
 +
set of testcases are ignored for expediency's sake.
  
** what tests can be skipped etc.
+
= Miscelaneous (uncategorized) =
 +
* environment variables used to create an SDK build environment for a board
 +
* environment variables used for controlling execution of a test
 +
* location of kernel configuration (used for dependency testing) KCONFIG_PATH (adopted by LTP)
 +
* default name of test program in a target package (run-test.sh?)
 +
** this should be part of the test definition

Revision as of 10:58, 14 September 2020

This page will be used to collect information about test standards.

meta-documents

A survey of existing test systems was conducted in the Fall of 2018. The survey and results are here: Test Stack Survey


Here are some things we'd like to standardize in open source automated testing:

Terminology and Framework

Diagram

Below is a diagram for the high level CI loop:

The boxes represent different processes, hardware, or storage locations. Lines between boxes indicate APIs or control flow, and are labeled with letters. The intent of this is to provide a reference model for the test standards.

high level CI loop

Board management (G)

This standard has a set of APIs or interfaces for managing the devices under test (DUTs) It includes things like:

  • board reservation
  • image instantiation (in the case of VMs or emulators)
  • board provisioning (installation of software under test)
  • power control (or, in the case of VMs - VM start)
  • bus control
  • power measurement
  • attribute discovery
  • console monitoring
  • file transfer to/from the board
  • command execution

See Board Management Layer Notes

Power Control

The power control API is a standard for controlling the power state of a board in a board farm (inside an automated testing farm).

See Test Power Control Notes

Standards

pdudaemon was selected as the standard for controlling power to a board in a lab.

The document containing this standard is at:

or

Board IO connections

This consists of the ability to control or test features of the board that are related to busses or other connections to the device under test. This could include things like:

  • serial ports
  • USB buses
  • i2c
  • CAN

It might also involve any other aspect of board IO, such as audio, video, gpio, leds, etc.

In general, the connection might be between the board farm controller node and the DUT (interface G) or between some special hardware and the DUT (interface H, controlled by interface J).

See Board IO connection Testing

Test Definition

The test definition is the set of attributes, code, and data that are used to perform a test. A test definition standard would specify things like the following:

  • fields - the data elements of a test
  • file format (json, xml, etc.) - how a test is expressed and transported
  • meta-data - data describing the test
  • visualization control - information used for visualization of results
  • instructions - executable code to perform the test

See Test Definition Project for more information about a project to harmonize test definitions across multiple test systems.

Test Definition server

The test definition itself is separate from the API or interface to a test definition server. A test definition server is a place where test definitions are stored.

In 2019, there is not central repository for test definitions that hold open source test definitions for multiple test frameworks.

But there is some movement towards storing auto-generated test (produced by fuzzers) for the linux kernel in a centralized location. See this repository: https://git.kernel.org/pub/scm/linux/kernel/git/shuah/linux-arts.git/ Discussion about the creation of this repository is at: https://lwn.net/Articles/799162/


Test dependencies

  • how to specify test dependencies
    • ex: assert_define ENV_VAR_NAME
    • ex: kernel_config
  • types of dependencies

See Test_Dependencies

Test Execution API (E)

See Test Execution Notes for more details and miscellaneous notes.

  • test API
  • host/target abstraction
  • test retrieval, build, deployment
  • test phases

Build Artifacts

  • test package format
    • meta-data for each test
    • test results
    • baseline expected results for particular tests on particular platforms

Test package format

This is a package intended to be installed on a target (as opposed to the collection of test definition information that may be stored elsewhere in the test system)

Test server

This is a place where tests or test packages can be stored, and downloaded for use in a CI framework.

See Test Server Notes

Run Artifacts

  • logs
  • data files (audio, video)
  • monitor results (power log, trace log)
  • snapshots


Results Format

See Test Results Format Notes for details and miscellaneous notes

The results format is the output from the test and creates is part of the interface between the test program and the test execution layer (or test harness).

The main thing that the format communicates is the list of testcases (or metrics, in the case of benchmarks) and the result of the testcase (pass, fail, etc.)

Server-based results storage

yocto project

All our test results for YP builds are added to a git repository:

http://git.yoctoproject.org/cgit.cgi/yocto-testresults/

(they're stored in a json format). the YP project doesn't have good tools to analyse the data yet but are at least storing them.

Fuego

Uses the fserver project (https://github.com/tbird20d/fserver) to store run results in a common location.

Data is stored using Fuego's run.json format (http://fuegotest.org/wiki/run.json)

Fuego can also save results to a kernelci backend and a Squad backend.

KernelCI

Site: https://kerneci.org/

A test has the results from a test: https://api.kernelci.org/schema-test.html A test group is a collection of test cases: See https://api.kernelci.org/schema-test-group.html and https://api.kernelci.org/schema-test-case.html

SQUAD

The results backend for LKFT is: https://qa-reports.linaro.org/lkft/

Source code for SQUAD: https://github.com/linaro/squad

Documentation: https://squad.readthedocs.io/en/latest/

BigQuery common results server project

The client for this is at: https://github.com/spbnick/kcidb

The server for this is at: ??

Standards

The Linux kernel kselftest uses TAP as the preferred output format.

Pass Criteria

The pass criteria is a set of data that indicate to the test framework how to interpret the results from a test. They can indicate the following:

  • what tests can be skipped (this is more part of test execution and control)
  • what test results can be ignored (xfail)
  • min required pass counts, max allowed failures
  • thresholds for measurement results
    • requires testcase id, number and operator

The pass criteria allows separation of things like expected failure from the test code itself, to allow for situations where different sets of results are interpreted as success or failure depending on factors outside the test (for example, kernel version, kernel configuration, available hardware, etc.)

For things like functional unit tests, a single failing result should result in the overall failure of a test suite. However, for system tests or benchmarks, it is often the case that some results must be interpreted in a context-sensitive manner, or some set of testcases are ignored for expediency's sake.

Miscelaneous (uncategorized)

  • environment variables used to create an SDK build environment for a board
  • environment variables used for controlling execution of a test
  • location of kernel configuration (used for dependency testing) KCONFIG_PATH (adopted by LTP)
  • default name of test program in a target package (run-test.sh?)
    • this should be part of the test definition