[Automated-testing] Test Stack Survey - ktest

Steven Rostedt rostedt at goodmis.org
Mon Oct 8 18:29:36 PDT 2018


== Diagrams ==
Attached 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 facilitate discussion at the summit.

[[File:<see attachment>|high level CI loop]]
--------

If you have an element that is not featured in this diagram, please let us know.

== Cover text ==
Hello Test Framework developer or user,

The purpose of this survey is to try to understand how different Test Frameworks and Automated Test components
in the Linux Test ecosystem work - what features they have, what terminology they use, and so forth.
The reason to characterize these different pieces of software (and hardware) is to try to come up
with definitions for a Test Stack, and possibly API definitions, that will allow different
elements to communicate and interact.  We are interested in seeing the commonalities and differences
between stack elements.

This information will be used, to start, to prepare for discussions about test stack standards
at the Automated Testing Summit 2018.

Please see the Glossary below for the meaning of words used in this survey.  If you use different
words in your framework for the same concept, please let us know.  If you think there are other
words that should be in the Glossary, please let us know.

== Survey Questions ==
* What is the name of your test framework?

ktest

Which of the aspects below of the CI loop does your test framework perform?

The answers can be: "yes", "no", or "provided by the user".
Where the answer is not simply yes or no, an explanation is appreciated.

For example, in Fuego, Jenkins is used for trigger detection (that is, to
detect new SUT versions), but the user must install the Jenkins module and
configure this themselves.  So Fuego supports triggers, but does not provide
them pre-configured for the user.

If the feature is provided by a named component in your system (or by an
external module), please provide the name of that module.

Does your test framework:
==== source code access ====
* access source code repositories for the software under test?

yes

* access source code repositories for the test software?

yes

* include the source for the test software?

no

* provide interfaces for developers to perform code reviews?

no

* detect that the software under test has a new version?

no

** if so, how? (e.g. polling a repository, a git hook, scanning a mail list, etc.)

n/a

* detect that the test software has a new version?

no

==== test definitions ====
Does your test system:
* have a test definition repository?

no

** if so, what data format or language is used (e.g. yaml, json, shell script)

Does your test definition include:
* source code (or source code location)?

yes

* dependency information?

no

* execution instructions?

yes

* command line variants?

yes

* environment variants?

yes

* setup instructions?

yes

* cleanup instructions?

no

** if anything else, please describe:

Does your test system:
* provide a set of existing tests?

yes

** if so, how many?

4

==== build management ====
Does your test system:
* build the software under test (e.g. the kernel)?

yes

* build the test software?

yes, but only if a script provided does so

* build other software (such as the distro, libraries, firmware)?

yes, but only if a script provided does so

* support cross-compilation?

yes

* require a toolchain or build system for the SUT?

yes

* require a toolchain or build system for the test software?

no

* come with pre-built toolchains?

no

* store the build artifacts for generated software?

no

** in what format is the build metadata stored (e.g. json)?

shell scripts

** are the build artifacts stored as raw files or in a database?

raw

*** if a database, what database?

==== Test scheduling/management ====
Does your test system:
* check that dependencies are met before a test is run?

no

* schedule the test for the DUT?

no

** select an appropriate individual DUT based on SUT or test attributes?

no

** reserve the DUT?

no

** release the DUT?

no

* install the software under test to the DUT?

yes

* install required packages before a test is run?

yes, only if script is provided

* require particular bootloader on the DUT? (e.g. grub, uboot, etc.)

Works with grub, sys/extlinux, tftboot (anything that a script can provide)

* deploy the test program to the DUT?

yes

* prepare the test environment on the DUT?

no

* start a monitor (another process to collect data) on the DUT?

yes

* start a monitor on external equipment?

yes

* initiate the test on the DUT?

yes

* clean up the test environment on the DUT?

yes


==== DUT control ====
Does your test system:
* store board configuration data?

no

** in what format?
* store external equipment configuration data?

no

** in what format?
* power cycle the DUT?

yes

* monitor the power usage during a run?

no

* gather a kernel trace during a run?

yes

* claim other hardware resources or machines (other than the DUT) for use during a test?

no

* reserve a board for interactive use (ie remove it from automated testing)?

no

* provide a web-based control interface for the lab?

no

* provide a CLI control interface for the lab?

no

==== Run artifact handling ====
Does your test system:
* store run artifacts

yes

** in what format?

raw format

* put the run meta-data in a database?

yes

** if so, which database?

file system

* parse the test logs for results?

yes

* convert data from test logs into a unified format?

no

** if so, what is the format?

n/a

* evaluate pass criteria for a test (e.g. ignored results, counts or thresholds)?

yes

* do you have a common set of result names: (e.g. pass, fail, skip, etc.)

yes

** if so, what are they?

PASS, FAIL

* How is run data collected from the DUT?
** e.g. by pushing from the DUT, or pulling from a server?

monitoring consoles

* How is run data collected from external equipment?
* Is external equipment data parsed?

monitoring consoles

==== User interface ====
Does your test system:
* have a visualization system?

no

* show build artifacts to users?

no

* show run artifacts to users?

no

* do you have a common set of result colors?

no

** if so, what are they?

n/a

* generate reports for test runs?

yes

* notify users of test results by e-mail?

yes (recently added feature)

* can you query (aggregate and filter) the build meta-data?

yes, with grep

* can you query (aggregate and filter) the run meta-data?

yes, with grep

* what language or data format is used for online results presentation? (e.g. HTML, Javascript, xml, etc.)

plain text

* what language or data format is used for reports? (e.g. PDF, excel, etc.)

plain text


* does your test system have a CLI control tool?

no

** what is it called?

n/a

==== Languages: ====
Examples: json, python, yaml, C, javascript, etc.
* what is the base language of your test framework core?

Perl


What languages or data formats is the user required to learn?
(as opposed to those used internally)

bash

==== Can a user do the following with your test framework: ====
* manually request that a test be executed (independent of a CI trigger)?

yes

* see the results of recent tests?

yes (if they save the log)

* set the pass criteria for a test?

yes

** set the threshold value for a benchmark test?

yes

** set the list of testcase results to ignore?

sorta

* provide a rating for a test? (e.g. give it 4 stars out of 5)

no

* customize a test?

yes

** alter the command line for the test program?

yes

** alter the environment of the test program?

set

** specify to skip a testcase?

yes

** set a new expected value for a test?

yes

** edit the test program source?

yes

* customize the notification criteria?

yes

** customize the notification mechanism (eg. e-mail, text)

yes

* generate a custom report for a set of runs?

no

* save the report parameters to generate the same report in the future?

yes


==== Requirements ====
Does your test framework:
* require minimum software on the DUT?

yes

* require minimum hardware on the DUT (e.g. memory)

yes

** If so, what? (e.g. POSIX shell or some other interpreter, specific libraries, command line tools, etc.)

Usually sshd (to load kernels on the target, and install for reboot)

* require agent software on the DUT? (e.g. extra software besides production software)

yes

** If so, what agent?

sshd (but if a target boots from an external source, the externals source can have the code to load)

* is there optional agent software or libraries for the DUT?

no

* require external hardware in your labs?

no idea what that means


==== APIS ====
Does your test framework:
* use existing APIs or data formats to interact within itself, or with 3rd-party modules?

no

* have a published API for any of its sub-module interactions (any of the lines in the diagram)?

no

** Please provide a link or links to the APIs?

Sorry - this is kind of open-ended...
* What is the nature of the APIs you currently use?
Are they:
** RPCs?
** Unix-style? (command line invocation, while grabbing sub-tool output)
** compiled libraries?
** interpreter modules or libraries?
** web-based APIs?
** something else?

Mostly a config file where you can define pretty much all commands with a shell script.

==== Relationship to other software: ====
* what major components does your test framework use (e.g. Jenkins, Mondo DB, Squad, Lava, etc.)

make, gcc, build tools. ssh, scp, grub, install tools, etc.


* does your test framework interoperate with other test frameworks or software?

no (but it can, via shell scripts)

** which ones?

== Overview ==
Please list the major components of your test system.

{{{Just as an example, Fuego can probably be divided into 3 main parts, with somewhat overlapping roles:
* Jenkins - job triggers, test scheduling, visualization, notification
* Core - test management (test build, test deploy, test execution, log retrieval)
* Parser - log conversion to unified format, artifact storage, results analysis
There are lots details omitted, but you get the idea.
}}}

Please list your major components here:
*

Build - builds a kernel (can check for warnings)
Install - installs the kernel
Boot - boots the kernel (checking for errors)
Test - runs test described by shell scripts

== Glossary ==
Here is a glossary of terms.  Please indicate if your system uses different terms for these concepts.
Also, please suggest any terms or concepts that are missing.

* Bisection - automatic testing of SUT variations to find the source of a problem
* Boot - to start the DUT from an off state
* Build artifact - item created during build of the software under test
* Build manager (build server) - a machine that performs builds of the software under test
* Dependency - indicates a pre-requisite that must be filled in order for a test to run (e.g. must have root access, must have 100 meg of memory, some program must be installed, etc.)
* Device under test (DUT) - the hardware or product being tested (consists of hardware under test and software under test) (also 'board', 'target')
* Deploy - put the test program or SUT on the DUT
** this one is ambiguous - some people use this to refer to SUT installation, and others to test installation
* Device under Test (DUT) - a product, board or device that is being tested
* DUT controller - program and hardware for controlling a DUT (reboot, provision, etc.)
* DUT scheduler - program for managing access to a DUT (take online/offline, make available for interactive use)
** This is not shown in the CI Loop diagram - it could be the same as the Test Scheduler
* Lab - a collection of resources for testing one or more DUTs (also 'board farm')
* Log - one of the run artifacts - output from the test program or test framework
* Log Parsing - extracting information from a log into a machine-processable format (possibly into a common format)
* Monitor - a program or process to watch some attribute (e.g. power) while the test is running
** This can be on or off the DUT.
* Notification - communication based on results of test (triggered by results and including results)
* Pass criteria - set of constraints indicating pass/fail conditions for a test
* Provision (verb) - arrange the DUT and the lab environment (including other external hardware) for a test
** This may include installing the SUT to the device under test and booting the DUT.
* Report generation - generation of run data into a formatted output
* Request (noun) - a request to execute a test
* Result - the status indicated by a test - pass/fail (or something else) for a Run
* Results query - Selection and filtering of data from runs, to find patterns
* Run (noun) - an execution instance of a test (in Jenkins, a build)
* Run artifact - item created during a run of the test program
* Serial console - the Linux console connected over a serial connection
* Software under test (SUT) - the software being tested
* Test agent - software running on the DUT that assists in test operations (e.g. test deployment, execution, log gathering, debugging
** One example would be 'adb', for Android-based systems)
* Test definition - meta-data and software that comprise a particular test
* Test program - a script or binary on the DUT that performs the test
* Test scheduler - program for scheduling tests (selecting a DUT for a test, reserving it, releasing it)
* Test software - source and/or binary that implements the test
* Transport (noun) - the method of communicating and transferring data between the test system and the DUT
* Trigger (noun) - an event that causes the CI loop to start
* Variant - arguments or data that affect the execution and output of a test (e.g. test program command line; Fuego calls this a 'spec')
* Visualization - allowing the viewing of test artifacts, in aggregated form (e.g. multiple runs plotted in a single diagram)


More information about the automated-testing mailing list