Local process Plugin - Assert Macros


# ASSERT {result} IS FAILURE WITH EXIT CODE {exitCode}

What ?

This macro will verify that the result of a failed execution command contains the expected exit code.

Underlying instruction :

ASSERT {result} IS failure WITH $({exitCode})

> Input :

  • {result} : The resource file that contains the result of a shell execution command (result.shell type resource).
  • {exitCode} : The expected return code of the command execution.

Example :

# ASSERT result IS failure WITH exit code 2

SKF script :

../../_images/local-process-macros-assert-1-script.png

Console output :

../../_images/local-process-macros-assert-1-stacktrace.png


# ASSERT {result} STDOUT CONTAINS {regex}

What ?

This macro will verify that the standard outflow resulting of a shell command execution contains a specific character string.

Underlying instruction :

ASSERT {result} DOES contain WITH $({regex}) USING $(out)

> Input :

  • {result} : The resource file that contains the result of a shell execution command (result.shell type resource).
  • {regex} : The searched character string.

Example :

# ASSERT result STDOUT CONTAINS hello world

SKF script :

../../_images/local-process-macros-assert-2-script.png


# ASSERT {result} STDOUT DOES NOT CONTAIN {regex}

What ?

This macro will verify that the standard outflow resulting of a shell command execution does not contain a specific character string.

Underlying instruction :

ASSERT {result} DOES not.contain WITH $({regex}) USING $(out)

> Input :

  • {result} : The resource file that contains the result of a shell execution command (result.shell type resource).
  • {regex} : The searched character string.

Example :

# ASSERT result STDOUT DOES NOT CONTAIN hello world

SKF script :

../../_images/local-process-macros-assert-3-script.png

Console output :

../../_images/local-process-macros-assert-3-stacktrace.png


# ASSERT {result} STDERR CONTAINS {regex}

What ?

This macro will verify that the error outflow resulting of a shell command execution contains a specific character string.

Underlying instruction :

ASSERT {result} DOES contain WITH $({regex}) USING $(err)

> Input :

  • {result} : The resource file that contains the result of a shell execution command (result.shell type resource).
  • {regex} : The searched character string.

Example :

# ASSERT result STDERR CONTAINS Fichier introuvable

SKF script :

../../_images/local-process-macros-assert-4-script.png


# ASSERT {result} STDERR DOES NOT CONTAIN {regex}

What ?

This macro will verify that the error outflow resulting of a shell command execution does not contain a specific character string.

Underlying instruction :

ASSERT {result} DOES not.contain WITH $({regex}) USING $(err)

> Input :

  • {result} : The resource file that contains the result of a shell execution command (result.shell type resource).
  • {regex} : The searched character string.

Example :

# ASSERT result STDERR DOES NOT CONTAIN Fichier introuvable

SKF script :

../../_images/local-process-macros-assert-5-script.png

Console output :

../../_images/local-process-macros-assert-5-stacktrace.png