Difference between revisions of "Test Dependencies"

From eLinux.org
Jump to: navigation, search
(Examples)
Line 42: Line 42:
 
* NEED_KCONFIG="CONFIG_PRINTK=y"
 
* NEED_KCONFIG="CONFIG_PRINTK=y"
 
* NEED_KCONFIG="CONFIG_LOCKDEP_SUPPORT=n"
 
* NEED_KCONFIG="CONFIG_LOCKDEP_SUPPORT=n"
 +
 +
* NEED_PROGRAM=expect
 
* assert_has_program expect
 
* assert_has_program expect
 +
 
* assert_define "LINK_NETMASK"
 
* assert_define "LINK_NETMASK"
 
* assert_define BENCHMARK_WHETSTONE_LOOPS
 
* assert_define BENCHMARK_WHETSTONE_LOOPS
 +
 
* is_on_target liblwip.so LIB_LWIP /lib:/usr/lib:/usr/local/lib
 
* is_on_target liblwip.so LIB_LWIP /lib:/usr/lib:/usr/local/lib
 
* is_on_target_path time PROGRAM_TIME
 
* is_on_target_path time PROGRAM_TIME
 
* is_on_sdk libjpeg.so LIBJPEG /lib:/usr/lib/:/usr/local/lib:/usr/lib/$ARCH-linux-*/:/usr/lib/$TOOLCHAIN-linux-*/
 
* is_on_sdk libjpeg.so LIBJPEG /lib:/usr/lib/:/usr/local/lib:/usr/lib/$ARCH-linux-*/:/usr/lib/$TOOLCHAIN-linux-*/
 +
 +
=== notes ===
 +
Yes, Fuego has both declarative (NEED_*) and imperative (is_on_target) dependency statements.
  
 
== LTP ==
 
== LTP ==
Line 56: Line 63:
 
* needs_tmpdir = 1
 
* needs_tmpdir = 1
 
* needs_checkpoints = 1
 
* needs_checkpoints = 1
 +
 +
== 0-day ==
 +
 +
=== examples ===
 +
avoid_nfs: 1
 +
 +
need_kconfig:
 +
- CONFIG_SUSPEND=y
 +
- CONFIG_FTRACE=y
 +
- CONFIG_FUNCTION_TRACER=y
 +
 +
need_kconfig:
 +
- CONFIG_BLK_DEV_LOOP
 +
- CONFIG_CAN=m
 +
- CONFIG_CAN_RAW=m
 +
- CONFIG_CAN_VCAN=m
 +
- CONFIG_IPV6_VTI=m
 +
- CONFIG_MINIX_FS=m
 +
 +
 +
=== NOTES ===
 +
There seems to be some kind of calculated need_kconfig:
 +
This is from lkp-test/include/fs1/OTHERS
 +
<%=
 +
    case ___
 +
    when /cifs|cramfs|logfs|squashfs/
 +
        "need_kconfig: CONFIG_#{___.upcase}"
 +
    else
 +
        "need_kconfig: CONFIG_#{___.upcase}_FS"
 +
    end
 +
%>

Revision as of 13:04, 15 November 2018

This page is for organizing information about test dependencies, which are part of a test's Test Definition

Description

A test dependency is an expression of a requirement or constraint for a test.

A test dependency can serve multiple purposes:

  • to filter the list of tests that apply to a target
  • to prevent a test from being associated with (or run on) a particular target or set of targets
  • to indicate that some action needs to occur before the test is run (part of test setup)
    • to indicate that some resources needs to be claimed before test start and released on test exit
    • to indicate tests or steps that must be performed before this test
  • to document what the test is related to (the services it needs, or the bug it checks for)

Examples

  • needs root permissions in order to run
  • needs a particular kconfig option configuration
  • needs a package installed on the target
  • needs a program on the target
  • needs a library in the SDK for the target (for the build phase)

Expressions in different systems

Fuego

See [1]

Some Fuego dependency statements are declarative, and some are imperative.

Fuego has a test_pre_check phase, in which dependencies are checked, and in which arbitrary code can be executed to check that required pre-requisites for the test are met.

Fuego stores dependencies in the fuego_test.sh file.

Declarative dependencies can be placed anywhere in the file. Imperative dependencies (pre_check code) is placed in the function test_pre_check() in fuego_test.sh.

examples

  • NEED_ROOT=1
  • NEED_MEMORY=50M
  • NEED_FREE_STORAGE=100M
  • NEED_FREE_STORAGE="100M $BOARD_TESTDIR"
  • NEED_KCONFIG="CONFIG_PRINTK=y"
  • NEED_KCONFIG="CONFIG_LOCKDEP_SUPPORT=n"
  • NEED_PROGRAM=expect
  • assert_has_program expect
  • assert_define "LINK_NETMASK"
  • assert_define BENCHMARK_WHETSTONE_LOOPS
  • is_on_target liblwip.so LIB_LWIP /lib:/usr/lib:/usr/local/lib
  • is_on_target_path time PROGRAM_TIME
  • is_on_sdk libjpeg.so LIBJPEG /lib:/usr/lib/:/usr/local/lib:/usr/lib/$ARCH-linux-*/:/usr/lib/$TOOLCHAIN-linux-*/

notes

Yes, Fuego has both declarative (NEED_*) and imperative (is_on_target) dependency statements.

LTP

Declared as fields in a test program's tst_test structure.

examples

  • needs_root = 1
  • needs_tmpdir = 1
  • needs_checkpoints = 1

0-day

examples

avoid_nfs: 1
need_kconfig:
- CONFIG_SUSPEND=y
- CONFIG_FTRACE=y
- CONFIG_FUNCTION_TRACER=y
need_kconfig:
- CONFIG_BLK_DEV_LOOP
- CONFIG_CAN=m
- CONFIG_CAN_RAW=m
- CONFIG_CAN_VCAN=m
- CONFIG_IPV6_VTI=m
- CONFIG_MINIX_FS=m


NOTES

There seems to be some kind of calculated need_kconfig: This is from lkp-test/include/fs1/OTHERS <%=

   case ___
   when /cifs|cramfs|logfs|squashfs/
       "need_kconfig: CONFIG_#{___.upcase}"
   else
       "need_kconfig: CONFIG_#{___.upcase}_FS"
   end

%>