Using a Mix in a Job
Note This content applies to the Windows Logo Kit (WLK). For the latest information using the new Windows Hardware Certification Kit (HCK), see Windows HCK User's Guide on the Windows Hardware Dev Center.
If you want your job to run on multiple computers, where each computer meets a different set of criteria, you can use a mix.
A mix is a set of contexts. Each context contains constraints and parameters. Each constraint compares the value of a dimension on the client computer with a value that you specify. You can use parameters to provide different values to the command lines within the tasks for each context.
For example, assume the program MyTest.exe tests different features of a driver on 32-bit and 64-bit versions of the Windows XP operating system. You want to create one job that runs MyTest.exe on both versions of the operating system. However, you have to invoke MyTest.exe with a different flag for each operating system. To do this, you would create a job to run the test and add a mix, with two contexts, to the job. Each context would have a different constraint for the operating system. Both contexts would define the same parameter to represent the flags that are passed to MyTest.exe, but each context would specify a different value for the parameter. The following table summarizes these details.
Context name | Constraint | Parameter |
---|---|---|
32-bit Windows XP |
WTT\OS equals Windows XP |
flags = "/32-bit" |
64-bit Windows XP |
WTT\OS equals Windows XP 64-Bit Edition Version 2003 |
flags="/64-bit" |
The command line within the task that runs MyTest.exe would be:
MyTest.exe [flags]
For more information about mixes and additional ways to restrict the client computers that a job can execute on, see Specifying Which Computers a Job Can Run On. For general information about parameters, see Using Parameters.
To add a mix to a job
Note This content applies to the Windows Logo Kit (WLK). For the latest information using the new Windows Hardware Certification Kit (HCK), see Windows HCK User's Guide on the Windows Hardware Dev Center.
Create or edit a job.
On the Constraints tab in the bottom pane of the New Job window, click Add Mix.
Note You might have to expand the New Job window to see the Add Mix button.
In the Choose Mix Source dialog box, select Local for the Mix Source, select Simple for the Type, and then click OK.
In the New Mix dialog box, type a name for the mix.
In the Contexts tab, click Add.
Type a name for the context in the Add Context dialog box.
You should choose a meaningful name for the context. When you examine the progress of the job by using Job Monitor, the context name for each instance of the job that is executing will be displayed.
On the Constraints tab in the bottom pane of the Add Context dialog box, move the cursor to the Dimension cell in the first empty row, and then select the dimension that you want to compare from the drop-down list.
In the Operator column, select the operator that you want to use to compare the dimension to its value. The list of operators might vary depending on the dimension that you selected:
Equals: The value of the dimension is equal to the value that you specify in the constraint.
Not Equals: The value of the dimension is not equal to the value that you specify in the constraint.
Less Than: The value of the dimension is less than the value that you specify in the constraint.
Greater Than: The value of the dimension is greater than the value that you specify in the constraint.
Less Than or Equal To: The value of the dimension is less than or equal to the value that you specify in the constraint.
Greater Than or Equal To: The value of the dimension is greater than or equal to the value that you specify in the constraint.
Contains: The value of the dimension contains the string that you specify in the constraint.
Not Contains: The value of the dimension does not contain the string that you specify in the constraint.
Within: The value of the dimension is one of the values that you specify in the constraint.
Not Within: The value of the dimension is not one of the values that you specify in the constraint.
Exists: The dimension is defined on the client computer.
Not Exists: The dimension is not defined on the client computer.
In the Value column, enter the value to compare the dimension to.
Note If the operator is Within or Not Within, you must select the value from a list. If the operator is Exists or Not Exists, do not enter a value.
Repeat this procedure beginning at step 7 to add additional constraints to the context.
If you want to add parameters to the context, select the Parameters tab and use the following procedure to add the parameters:
Enter a name for the parameter in the Name column.
In the Type column, select String.
Note Parameters can also have the type FileData. A FileData parameter represents a file whose contents you specify in the job. A separate instance of the file is copied to the client computer each time the job is executed. FileData parameters are used primarily to copy a script to a client computer and to reference the script in the task that runs it. For more information about using FileData parameters, see Using FileData Parameters.
Type a description of what the parameter is used for in the Description column.
If you want the user to be able to override the value of this parameter when the job is scheduled, select the ScheduleDisplay check box.
In the Value column, enter the default value for this parameter. If you do not enter a value, the default will be an empty string.
Tip Parameters can be nested. For example, you could define a parameter named ServerName and give it the value of "MyServer". You could define a second parameter named DataFileLocation and give it the value "\\[ServerName]\test". You could then use DataFIleLocation within a task, for example, by using the command line:
TestProgram.exe /datafile=[ DataFileLocation]
When the task was executed, TestProgram.exe would receive a datafile argument with the value "\\MyServer\test".
When you have added all of the constraints and parameters to the context, click OK.
Repeat this procedure beginning at step 5 to add each additional context.
When you have added all of the contexts, click OK.
Build date: 9/14/2012