Adding or Modifying a Test Case

A test case allows you to emulate an end user running a command through the Command Control system.

  1. On the home page of the console, click Command Control.

  2. In the details pane, click Test Suites.

  3. Select the test suite to add a test case, or modify an existing test case.

  4. In the details pane, click View Test Suite.

  5. Perform either of the following:

    • To add a new test case, click Add Test Case in the task pane.

    • To modify a test case, select the test case, then click Modify Test Case.

  6. Specify the values and the expected results that you want to run through the rule configuration. (To review the rule configuration you want to test with this case, see Modifying a Rule.)

    Enter a single value in each field. The purpose of the test case is emulate the user performing a usrun command from the command line.

    • To create a test case that can be used for general testing and could possible match multiple rules, supply only submit information for the test case.

    • To create a test case that matches only one rule, use the expected fields to specify values that match a single rule.

    Command: (Required) Specify the command the user would run.

    For example, if the user would enter the following on the command line:

    usrun passwd user1

    Specify the following as the command:

    passwd user1

    Submit User: (Required) Specify the name of the user who is entering the privileged command.

    Submit Host: (Required) Specify the name of the host that the submit user is logged in to.

    Run User: (Optional) When the submit user is requesting to run the command as a specific user with the usrun command, specify the username that is being requested. For example, if the user would enter the following on the command line:

    usrun -u root ksh

    Specify the following as the run user:

    root

    Run Host: (Optional) When the submit user is requesting to run the command on a specific host, specify the hostname that is being requested. For example, if the user would enter the following on the command line:

    usrun -h hosta ksh

    Specify the following as the run host:

    hosta

    User Input: (Optional) Use this field to specify the information that a script, associated with the Command Control policy, expects the user to enter.

    Expected command: (Optional) Use this field to confirm that the command being executed is the correct command. If the command specified in this field does not match the results, the test case fails.

    Expected authorized: (Optional) Use this field to confirm that the request was authorised. If value in this field does not match the results, the test case fails.

    Expected capture: (Optional) This field is compared with the result of the authorization request to confirm the capture mode is correct. If this field does not match the results, the test case fails.

    Expected run user: (Optional) Use this field to confirm that the user context used to execute the command is correct. If this field does not match the results, the test case fails.

    Expected run host: (Optional) Use this field to confirm that the host on which the command is being executed is correct. If this field does not match the results, the test case fails.

    Expected risk: (Optional) This field is compared with the result of the authorization request in order to confirm the risk associated with the command being executed is correct. If this field does not match the results, the test case fails.

    Submit Time: (Optional) Specify the time that the request should appear to be made. This is useful for testing access time restrictions in the policy.

    Custom Input: (Optional) Use this field to add attributes within the request object. These XML definitions are inserted into the privileged request. For example, you could use this field to configure the group memberships for a user in order to test policies that perform tests on the user’s group membership:

    <Groups>
      <Group name='grpa'/> 
      <Group name='grpb'/>
    </Groups>
  7. Click Finish. The input values are shown in the Test Cases table.

  8. Repeat Step 5 through Step 7 for any additional test cases you want to include or modify in this test suite.

    You can now run the test suite as explained in Running a Test Suite.