Functions library - sonata-nfv/tng-tests GitHub Wiki
Functions Library
We have developed a full library of functions that can be easily imported and used for creating new tests or modify the existing ones.
Importing the library
The .lib file is located here (https://github.com/sonata-nfv/tng-tests/blob/master/lib/functions.lib) To import it just need to add this line to your bash scripts:
. ./lib/functions.lib
After that, you will have all the functions available in your bash scripts. For usage and additional info about the functions (needed params, return values, etc), you can check the functions details below.
We have a script example here (https://github.com/sonata-nfv/tng-tests/blob/master/lib/test.sh)
Set Environment Function
Description
This is a special function included in the library that will configure the env correctly for the operations in the rests of the tests:
Input
- The environment name
Output
- $env contain the environment need for the rest of the functions
Usage
Example: setEnvironment "$environment Name"