Make test vendor-agnostic with YAML profiles#3147
Make test vendor-agnostic with YAML profiles#3147vaishnavibhat wants to merge 1 commit intoavocado-framework-tests:masterfrom
Conversation
6ca4378 to
0c662d1
Compare
|
Tested with Juniper switch : avocado run switch_test.py -m switch_test.py.data/switch_test.yaml |
| Login method for remote fc switch | ||
| Login method for remote switch | ||
| ''' | ||
| self.tnc = paramiko.SSHClient() |
There was a problem hiding this comment.
Not a problem added by this patch, but can you also add code in cleanup() to close the ssh connection. This will avoid any stale connections once the test exists
There was a problem hiding this comment.
Not a problem added by this patch, but can you also add code in cleanup() to close the ssh connection. This will avoid any stale connections once the test exists
Add code to "Close SSH connection to switch" in the teardown()
| self.cancel("user should specify port id") | ||
|
|
||
| # Load switch profile configuration | ||
| profile_name = self.params.get("switch_profile", |
There was a problem hiding this comment.
Is brocade_switch option valid? should it be cisco_switch?
There was a problem hiding this comment.
Is brocade_switch option valid? should it be cisco_switch?
Changed this to juniper_switch to match the switch.yaml
Refactored switch_test.py to support multiple switch vendors through
YAML-based configuration profiles instead of hardcoded commands.
Changes:
- switch_test.py: Generic command execution via profiles
- switch_test.yaml: Added switch_profile parameter
- Load switch commands from vendor-specific YAML profiles
- Support dynamic command templates with {port_id} placeholder
- Add profiles for Cisco, Juniper switches
Signed-off-by: Vaishnavi Bhat <vaishnavi@linux.vnet.ibm.com>
Refactored switch_test.py to support multiple switch vendors through YAML-based configuration profiles instead of hardcoded commands.
Changes: