Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  1. configureSimulator - This command already exists and will be enhanced to create a mock behaviour based on specified criteria.
    1. Inputs
      1. (Required) String cmdName - name of the agent command, e.g. StartCommand, StopCommand
      2. (Optional) Long zoneId - id of the zone
      3. (Optional) Long podId - id of the pod
      4. (Optional) Long clusterId - id of the cluster
      5. (Optional) Long hostId - id of the simulated resource
      6. (Optional) String responseType (Fail/Fault) - based on this will simulate a fixed failure, fixed fault. For simulating success there is no need to define an explicit mock, all agent commands returns success by default
      7. (Optional) String responseJSON - exact response expected by caller, mutually exclusive with responseType input. (This is the agent JSON response that can obtained from MS logs)
      8. (Optional) Long delay - delay in seconds before the response is returned. This can be used to simulate slow response or timeouts
      9. (Optional) Long count - number of times the mock should get executed. Every time a mock is successfully executed the count is decremented, when the count becomes 0 it is same as cleaning up the mock. A null value indicates that the mock will continue to be active unless explicitly cleaned up using the cleanup API below.
    2. Output
      1. Unique id for the mock. This can be used to access the mock later on
  2. queryMock - Query the status of the mock created using the previous API. This will be useful for finding out if the mock actually got executed or not during CS API execution that is being tested. The status of the mock will be updated if it gets executed.
    1. Inputs
      1. (Required) id - mock id returned from mock api call
    2. Output
      1. Mock details - one of the fields (count) will indicate status implying if the mock is actually executed or not. If the same mock is at the end of test, count is 0 means the mock executed the required number of times. For mocks without any specified count it won't be possible to track if the mock executed or not.
  3. cleanupMock - Once done with the mock behaviour, there is a need to reset/cleanup mocks so that subsequent tests can start from a fresh state.
    1. Inputs
      1. (Required) id - mock id returned from mock api call
    2. Output
      1. Success/fail

...