Running tests with the command-line adapter by reserving specific resources

With the command-line adapter, you can use a target test machine for running command-line jobs. After the adapter is registered, you can run scripts by using the command-line execution adapter on the target test machine. Use a command-line adapter if an adapter for your target tests is not available.

Before you begin

  1. Ensure that the Engineering Test Management project properties are configured to enforce reservations. For more information, see Enforcing machine reservations for lab resources in Engineering Test Management.
  2. Start the command-line adapter on the test target machine and have at least one test machine application on the target test machine.
  3. Make sure that the Quality Management application is running on the server.

About this task

On the tester machine, a test case with a command-line test script is created and run. The test produces a Test Execution Result, which contains the standard out and standard error of the executed command.

Tip: You can consolidate the log information for out and error files into a single output file by using the -redirectError true option. You can view the output file in the Result Details section of a test case.

You can run multiple command-line adapters on the same machine by providing different values for the optional parameter [[-adapter <adapter>]. However, all the adapters that run on the same machine are mapped to a single lab resource. If all adapters are mapped to a single lab resource, and you reserve that lab resource, all the adapters are reserved and no one else can use any of the adapters. Similarly, if you add that lab resource to a test cell, all adapters become part of that test cell. You cannot individually reserve the adapters and associate them with different test cells.

You can specify an optional parameter for adapters: [-hostName <host name>] . When you provide a value for the -hostName parameter, a lab resource is created with that name and the adapter is mapped to that lab resource. If you run multiple adapters from the same machine with different values for the -adapter parameter and different values for the -hostName parameter, each adapter is mapped to a different lab resource. Then, you can reserve lab resources separately and also add them to different test cells.

In addition to the -hostName parameter, you can optionally provide parameters for the fully qualified domain name, IP address, and MAC address:
  • [-fullyQualifiedDomainName <fully qualified domain name>]
  • [ipAddress <IP address>]
  • [macAddress <MAC address>]
If you do not provide these parameters, the -fullyQualifiedDomainName parameter is the same as the host name. The -ipAddress and -macAddress parameters are the IP address and MAC address of the real machine on which the adapter is running.

Command-Line Execution use

Note: You can write a shell script to be your test on the adapter. More information can be found in Creating a job that uses the command-line adapter to test an application-under-test.

Procedure

  1. In the main menu, click Construction > Create > Test Script.
    1. Enter a name for this script.
    2. Select the Command Line script type.
    3. Select Use test resources from a shared location.
    4. Next to Command, click Browse, select the executable file or script from the list, then click OK.
    5. Click Import.
    6. Optional: Specify any arguments.
    7. Click Save to save the test script.
  2. In the main menu, click Construction > Create > Test Case.
    1. Enter a name for this test case.
    2. Click the Test Scripts section of the test case.
    3. Click the Add existing test scripts icon.
    4. Select the application-under-test job to run on the adapter, and click OK.
    5. Click Save to save the test case.
  3. Reserve the test machine for the test execution.
    1. In the main menu, click Lab Management > Browse > Lab Resources.
    2. Select a machine and click the machine name to open it.
    3. Under the Reservations section, specify a Reserve From and Reserve To time.
    4. Click Save.
  4. Run the test case by clicking Execution > Browse > Test Cases.
    1. Select the test case, click the Action Menu icon, and then click Run Test Case > Run icon.
    2. To select a different machine, next to Machine, click the Change Machine icon.
    3. Click Finish.
  5. Check execution status.
    1. Click Execution > Execution Console.
      If the target test machine is reserved for another user, the test execution status indicates "Awaiting reservation." When the machine is reserved for you, the test execution begins automatically.
    2. After the test is executed, click Show result and review the execution results.