Basic Task Concepts

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.

Tasks perform the work of the job. For example, a simple job could contain three tasks: one task to copy a test program to the client computer, a second task to run the test program, and a third task to copy a log file from the client computer to a server that holds all log files.

Tasks run in three phases: setup, regular, and cleanup. All setup tasks must complete before any regular tasks can run. Cleanup tasks run either when all of the regular tasks have completed, or when a regular task that is marked "FailAndStop" fails. You can take advantage of the way that phases affect the order that tasks run. For example, you can put tasks that configure client computers in the setup phase, and tasks that return the client computers to their previous state in the cleanup phase. Tasks that copy test binaries, modify system settings, or install additional software often go in the setup phase. Tasks that undo these actions often go in the cleanup phase. Tasks that execute the tests themselves generally belong in the regular phase. To build on the previous example, the first task (copy the test program to the client computer) would go in the setup phase; the second task (run the test program) would go in the regular phase; and the third task (copy the log file to a server) could go in either the regular or cleanup phase. By considering the phases, we can see that there could be a missing fourth task: there should be a fourth task to remove the test program and leave the client computer in the state it was in before the job executed.

Within each phase, you can further specify the order that tasks run in. Sequential and parallel execution between the tasks are built in to DTM.

A task's type determines its behavior:

  • An Execute task executes a command line.

  • A Copy File task copies files from a remote location to the client computer.

  • A Copy Result task copies files from the client computer to a remote location.

  • A Run Job task runs another job (a library job*)*.

  • A Manual Prompt task displays a prompt and options to the user and waits for the user to make a selection.

    Tip   Manual Prompt tasks can be useful in debugging a job. You can create a Manual Prompt task that displays the value of a variable in the job, or provides another indication of the job's status.

Continuing the previous example, the first task (copy the test program to the client computer) would be a Copy File task; the second task (run the test program) would be an Execute task; the third task (copy the log file to a server) would be a Copy Result task; and the fourth task (delete the test program) would be an Execute task.

Two additional aspects of a task influence how the task affects the job it belongs to. First, you can specify whether the job should continue executing if the task itself fails. Second, you can indicate whether the pass or fail result of the task should contribute to the pass or fail result of the job. To continue the example, if the first task (copy the test program) fails, the job should stop; there is no point running the test program if it has not been copied to the client computer. If the other tasks fail, the job should probably continue to execute. If the result of the test program is the only important output of the job, then the pass or fail result of the second task (run the test program) should roll up to the job, and the pass or fail results of the other tasks should not roll up to the job.

The following table combines the details from all of the previous examples.

Task Phase Type Failure action Rollup results

Copy test program to client

Setup

Copy file

Fail and stop

No

Run test program

Regular

Execute

Ignore fail and continue

Yes

Copy log to server

Regular or cleanup

Copy result

Ignore fail and continue

No

Delete test program

Cleanup

Execute

Ignore fail and continue

No

 

 

 

Build date: 9/14/2012