Validator

Add Variable Indirection

Variable indirection allow another level of abstraction in using variables to modularize tests.

 

A simple example is to have a group of similarly name variables and the use of another variable to control the actual test values used. Example:

 

$StudentCN1="jstudent"

$StudentCX1="ou=students,o=school"

$StaffCN1="rstaff"

$StaffCX1="ou=staff,o=school"

 

You could define the test user, for one test pass by setting $Utype equal to "Student" and a second test pass by changing that variable to "Staff" if the variable $UserDN was used to define the full user DN with:

 

$UserDN = "CN=${${Utype}CN1},${$Utype}CX1}"

 

A second test run could use the same tests by simply changing the $Utype value.

 

More complexity can be added with the ending digit represented in another variable used as an index into a set of values.

 

"CN=${${Utype}CN${Idx}},${$Utype}CX${Idx}}"

Tags

Voting

3 votes
Idea No. 9