better obfuscation for fetch command output

This commit is contained in:
Petr Klima committed 2024-04-24 14:58:59 +02:00
1 parent bcb1e3094f
commit 6342476312
3 files changed
+22 -1

No files matched your search

+5
View File
@@ -1,3 +1,8 @@
# cfg for getting cmd outputs
test/unit/fetch_command_output.cfg
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
+16
View File
@@ -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
+1 -1
View File
@@ -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