diff --git a/.gitignore b/.gitignore index 5c76993..7ffa4a2 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,8 @@ + +# cfg for getting cmd outputs +test/unit/fetch_command_output.cfg + + # Byte-compiled / optimized / DLL files __pycache__/ *.py[cod] diff --git a/README.md b/README.md index 446614b..d18e636 100644 --- a/README.md +++ b/README.md @@ -106,6 +106,22 @@ NS - not supported - devices do not have support for that feature To be sure we can support new device we use test files. +### Fetch command output tool +There is tool for getting necessary infromatin form running switch +``` +cd test/unit + +# DEVICE_TYPE as PID: in "show inventory" output +# INTERFACE an inteface +# LLDP_INTERFACE inteface for getting LLDP inforation +./fetch_command_output.sh -u USER -p PASSWORD -t DEVICE_TYPE -v s350 \ + -d SWITCH_IP_or_FQDN -i INTERFACE -l LLDP_INTERFACE +``` + +Output files from that tool are in "test/unit/command_output/$DEVICE_TYPE" + +### By hand + We need text output of those commands, to add new device: ``` show arp diff --git a/test/unit/fetch_command_output.sh b/test/unit/fetch_command_output.sh index 18dd292..ee48a62 100755 --- a/test/unit/fetch_command_output.sh +++ b/test/unit/fetch_command_output.sh @@ -146,7 +146,7 @@ do # skip already fetched command outputs if [ -f "$CMDFILE" -a "$FORCE" = "n" ]; then - echo "###### Skiping '$CMD'. File '$CMDFILE' exists" + echo "###### Skiping '$CMD'. File '$CMDFILE' exists (force run by -f)" continue fi