dump_devinfo improvements (#657)

* dump_devinfo improvements

* Scrub only the last three bytes for mac addresses
* Add --target to allow creating fixtures based on discovery
* Save fixtures directly to correct location, add --basedir to allow defining the location of repository root
* Add --autosave to disable prompting for saving

* Update fixtures for devices I have

* Add fixture for HS110 hw 4.0 fw 1.0.4

* Improve help strings

* Fix tests

* Update devtools README

* Default to discovery if no host/target given
This commit is contained in:
Teemu R
2024-01-20 14:20:08 +01:00
committed by GitHub
parent 49cfef087c
commit f77e87dc5d
11 changed files with 307 additions and 165 deletions

View File

@@ -3,18 +3,24 @@
This directory contains some simple scripts that can be useful for developers.
## dump_devinfo
* Queries the device and returns a fixture that can be added to the test suite
* Queries the device (if --host is given) or discover devices and creates fixture files that can be added to the test suite.
```shell
Usage: dump_devinfo.py [OPTIONS] HOST
Usage: python -m devtools.dump_devinfo [OPTIONS]
Generate devinfo file for given device.
Generate devinfo files for devices.
Use --host (for a single device) or --target (for a complete network).
Options:
--host TEXT Target host.
--target TEXT Target network for discovery.
--username TEXT Username/email address to authenticate to device.
--password TEXT Password to use to authenticate to device.
--basedir TEXT Base directory for the git repository
--autosave Save without prompting
-d, --debug
--help Show this message and exit.
--username For authenticating devices.
--password
--help Show this message and exit.
```
## create_module_fixtures