apply_template_tests
Applies the variables and test definitions from the file(s) into a repository target.
Format
emcli apply_template_tests -targetName=target_name -targetType=target_type -input_file=template:template_filename [-input_file=variables:<variable_filename>] [-input_file=atsBundleZip:<ats_bundle_zip_filename>] [-useBundleDatabankFile] [-useFirstRowValues] [-overwriteExisting=all | none | <test1>:<type1>;<test2>:<type2>;...] [-encryption_key=key] [-swlibURN=<URN_for_swlib_entity>] [-swlibPath=<Path_for_swlib_entity>] [ ] indicates that the parameter is optional
Options
-
targetName
Target name.
-
targetType
Target type.
-
input_file=template
Name of the input file containing the test definitions.
For more information about the input_file option, see -input_file Syntax Guidelines.
-
input_file=variables
Name of the input file containing the variable definitions. If this attribute is not specified, the variables are extracted from the same file containing the test definitions.
The variables file format is as follows:
<variables xmlns="template"> <variable name="<name1>" value="<value1>"/> <variable name="<name2>" value="<value2>"/> ... </variables>
For more information about the input_file option, see -input_file Syntax Guidelines.
-
input_file=atsBundleZip
Name of the ATS bundle zip defined in the template.
For more information about the input_file option, see -input_file Syntax Guidelines.
-
useBundleDatabankFile
If you specify this option, the bundle databank files are used.
-
useFirstRowValues
If you specify this option, the first row values are used.
-
overwriteExisting
Specifies which tests should be overwritten in case they already exist on the target. The possible values are:
-
'none' (default): None of the existing tests on the target will be overwritten.
-
'all': If a test with the same name exists on the target, it will be overwritten with the test definition specified in the template file.
-
<test1>:<type1>;<test2>:<type2>;...: If any of the tests with names <test1>, <test2>, and so forth exist on the target, they are overwritten with the definition in the template file.
-
-
encryption_key
Optional key to decrypt the file contents. This key should be the same as the one used to encrypt the file.
-
swlibURN
Loads the software library entity through an URN. The respective entity data such as OATZ zip file and Zip File Name will be associated to the new service test. Either this option or the -swlibPath option are required to associate the OATS zip file to the service test.
-
swlibPath
Loads the software library entity through an entity path. The respective entity data such as OATZ zip file and Zip File Name will be associated to the new service test. Either this option or the -swlibURN option are required to associate the OATS zip file to the service test.
Examples
You must have the following privileges to perform these examples:
-
Operator privilege on the target.
-
Operator privilege on all beacons currently monitoring the target. Alternatively, you must have the "use any beacon" privilege.
Example 1
This example applies the test definitions contained in the file my_template.xml
into the Generic Service target my_target
, using the key my_password
to decrypt the file contents. If tests with names my_website
or my_script
exist on the target, they are overwritten by the test definitions in the file.
emcli apply_template_tests -targetName='my_target' -targetType='generic_service' -input_file=template:'my_template.xml' -encryption_key='my_password' -overwriteExisting='my_website:HTTP;my_script:OS'
Example 2
This example applies the test definitions contained in file my_template.xml into the Web Application target my_target using the variable values specified in file my_variables.xml. If any tests in the target have the same name as tests specified in the template file, they are overwritten.
emcli apply_template_tests -targetName='my_target' -targetType='website' -input_file=template:'my_template.xml' -input_file=variables: 'my_variables.xml' -overwriteExisting='all'