How do test templates work?
Template parameters
A test template includes all the parameters for a test. The template creator can set the parameters or leave them blank and can choose whether the parameter is visible or editable when the template is used.
When a test is created from the template, the parameters are applied as follows.
-
If the template creator sets the parameter value in the template and does not set the parameter instance as editable, the test runs with the value set in the template.
-
If the template creator sets the parameter instance as editable, the test runs with the value set by the user who creates the test. The template creator can also set the parameter value, creating a template default.
-
If the template creator does not set the parameter value and does not set the parameter instance as editable, the test runs with the default value in the YANG model, if applicable.
Test templates can use variable substitution to autopopulate some values, based on entity mapping in the YANG model. The definition of a variable has the following syntax:
${variable-name}
For example, "service:${service-name}" is resolved from the current test object after any source/destination entities are resolved.
For more information about variable substitution, see the OAM Tests tutorial on the Network Developer Portal.