function_fail_check_cases 

Fuego wiki

Login or create account

function fail check cases

NAME [edit section]

fail_check_cases

SYNOPSIS [edit section]

fail_check_cases

DESCRIPTION [edit section]

Search the test log for a given number of failure patterns, and abort with a message if the patterns are found.

The test name ($JOBNAME) is used in the construction of a set of environment variables that are used to detect failures in the logs from data specified by test specs.

If the testname was "Functional.hello", fail_check_cases would check for:

  • $FUNCTIONAL_HELLO_FAIL_CASE_COUNT

if this were '2', then fail_check_cases would check for:

  • $FUNCTIONAL_HELLO_FAIL_PATTERN_0
  • $FUNCTIONAL_HELLO_FAIL_0_SYSLOG
  • $FUNCTIONAL_HELLO_FAIL_MESSAGE_0
  • $FUNCTIONAL_HELLO_FAIL_PATTERN_1
  • $FUNCTIONAL_HELLO_FAIL_1_SYSLOG
  • $FUNCTIONAL_HELLO_FAIL_MESSAGE_1

The FAIL_PATTERN is a grep regular expression to check for in a log file.

The FAIL_{$n}_SYSLOG variable is non-empty if the pattern should also be checked for in the system log captured during the test. If this is not defined, then the pattern will only be checked for in the test log.

If one of the patterns is found, then the related message is printed and the test is aborted with the abort_job function.

If the 'CASE_COUNT' variable is not defined, then this routine does nothing.

The fail cases are defined in the test spec file for the test.

EXAMPLES [edit section]

Here are some sample invocations:
    fail_check_cases

ENVIRONMENT and ARGUMENTS [edit section]

This function uses the following variables:
  • $FUEGO_LOGS_PATH
  • $JOB_NAME
  • $NODE_NAME
  • $BUILD_ID
  • $BUILD_NUMBER

RETURN [edit section]

Returns non-zero on error.

SOURCE [edit section]

Located in scripts/functions.sh

SEE ALSO [edit section]

TBWiki engine 1.8.3 by Tim Bird