question

GregM avatar image
GregM asked GregM posted

Hint: An easy way to simulate a devices' command/response behavior for response map creation

The attached project can be used for creating a device simulator based on command-response information using the Microsoft Windows Command Shell.

 

This project includes

  • Examples of two imaginary root commands (get and show) and a few subcommands to these
    • The execution batch file for each command which contains, type "%*"
    • Response files for each subcommand
  • Test case that runs all the known commands
  • Response maps for all the commands

 

A few accommodations are needed to use the simulator:

  1. The response map applicability needs to include "Command Prompt"
  2. Before issuing a command, the test case needs to be in the correct directory for the command simulator
  3. Command arguments that are not filename friendly don't work, for example "show ip MAC 00:00:01:0a:12:11:bb:90" because ":" are not allowed in Windows filenames

Much of the credit for this approach belongs to Brad D.

iTestresponse map
DUT_simulator.zip (9.7 KiB)
10 |950

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

1 Answer

·
PaulD avatar image
PaulD answered PaulD posted

FYI, another way to accomplish this goal is to use a tclsh session inside iTest.  It is quite easy to use "puts" statements that add the entire multiline response body inside braces as an argument to puts.  This will echo that into the response body -- and you can then perform response mapping from there.  If you want the resulting response maps to be applicable for a specific command from a DUT, you can manually edit the applicability data.

 

Anyway, this is good stuff, and I like this approach, too.  I just wanted to let you know of an approach that I've been using.

10 |950

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.