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:
- The response map applicability needs to include "Command Prompt"
- Before issuing a command, the test case needs to be in the correct directory for the command simulator
- 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.