[ptf]: Stop ptf portchannel to fix the remove-topo issue#4248
[ptf]: Stop ptf portchannel to fix the remove-topo issue#4248ganglyu merged 5 commits intosonic-net:masterfrom ganglyu:ptf_portchannel
Conversation
Stop ptf portchannel during 'testbed-cli.sh remove-topo'. Signed-off-by: Gang Lv <ganglv@microsoft.com>
| @@ -0,0 +1,30 @@ | |||
| --- | |||
There was a problem hiding this comment.
This file is almost same as ptf_portchannel.yml, except the bottom task. Could you parameterize ptf_portchannel.yml to support both start (default) and stop cmd?
There was a problem hiding this comment.
You can refer to https://github.com/Azure/sonic-mgmt/blob/master/ansible/roles/vm_set/tasks/remove_topo.yml#L20
The idea is to pass in a variable with name like ptf_portchannel_action while calling playbook ptf_portchannel.yml.
Value of the variable can be start during add-topo and stop during remove-topo. Then update the ptf_portchannel.yml playbook to act differently according to value of the variable.
Signed-off-by: Gang Lv <ganglv@microsoft.com>
| - name: Control PTF portchannel | ||
| ptf_portchannel: | ||
| cmd: "start" | ||
| cmd: "{{ptf_portchannel_action}}" |
There was a problem hiding this comment.
The common practice is to have a whitespace between the variable name for better readability, like {{ ptf_portchannel_action }}.
Signed-off-by: Gang Lv <ganglv@microsoft.com>
… into ptf_portchannel
PR sonic-net#4248 updated the playbook ptf_portchannel.yml to accept variable "ptf_portchannel_action". Another playbook renumber_topo.yml calling the ptf_portchannel.yml was not updated to pass down the variable. This cause issue variable "ptf_portchannel_action" undefined while run "testbed-cli.sh restart-ptf". The change is to update the renumber_topo.yml to include the ptf_portchannel.yml with variable. Also added a stop to stop portchannel in PTF before removing PTF docker. Signed-off-by: Xin Wang <xiwang5@microsoft.com>
…4286) PR #4248 updated the playbook ptf_portchannel.yml to accept variable "ptf_portchannel_action". Another playbook renumber_topo.yml calling the ptf_portchannel.yml was not updated to pass down the variable. This cause issue variable "ptf_portchannel_action" undefined while run "testbed-cli.sh restart-ptf". The change is to update the renumber_topo.yml to include the ptf_portchannel.yml with variable. Also added a stop to stop portchannel in PTF before removing PTF docker. Signed-off-by: Xin Wang <xiwang5@microsoft.com>
…onic-net#4286) PR sonic-net#4248 updated the playbook ptf_portchannel.yml to accept variable "ptf_portchannel_action". Another playbook renumber_topo.yml calling the ptf_portchannel.yml was not updated to pass down the variable. This cause issue variable "ptf_portchannel_action" undefined while run "testbed-cli.sh restart-ptf". The change is to update the renumber_topo.yml to include the ptf_portchannel.yml with variable. Also added a stop to stop portchannel in PTF before removing PTF docker. Signed-off-by: Xin Wang <xiwang5@microsoft.com>
Signed-off-by: Gang Lv ganglv@microsoft.com
Description of PR
Summary:
Fixes # (issue)
Type of change
Back port request
Approach
What is the motivation for this PR?
If add-topo process started ptf portchannel, remove-topo process would be blocked while removing vlan port.
The solution is to stop ptf portchannel before removing vlan port.
How did you do it?
Add stop_ptf_portchannel.yml to stop portchannel interface.
How did you verify/test it?
Test run remove-topo and add-topo on both VS setup and physical setup.
Any platform specific information?
Supported testbed topology if it's a new test case?
Documentation