Skip to content

[ptf]: Stop ptf portchannel to fix the remove-topo issue#4248

Merged
ganglyu merged 5 commits intosonic-net:masterfrom
ganglyu:ptf_portchannel
Sep 14, 2021
Merged

[ptf]: Stop ptf portchannel to fix the remove-topo issue#4248
ganglyu merged 5 commits intosonic-net:masterfrom
ganglyu:ptf_portchannel

Conversation

@ganglyu
Copy link
Copy Markdown
Contributor

@ganglyu ganglyu commented Sep 14, 2021

Signed-off-by: Gang Lv ganglv@microsoft.com

Description of PR

Summary:
Fixes # (issue)

Type of change

  • Bug fix
  • Testbed and Framework(new/improvement)
  • Test case(new/improvement)

Back port request

  • 201911

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

Stop ptf portchannel during 'testbed-cli.sh remove-topo'.

Signed-off-by: Gang Lv <ganglv@microsoft.com>
@ganglyu ganglyu requested a review from a team as a code owner September 14, 2021 01:05
@ganglyu ganglyu requested a review from qiluo-msft September 14, 2021 01:10
@@ -0,0 +1,30 @@
---
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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?

Copy link
Copy Markdown
Collaborator

@wangxin wangxin Sep 14, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated.

Signed-off-by: Gang Lv <ganglv@microsoft.com>
- name: Control PTF portchannel
ptf_portchannel:
cmd: "start"
cmd: "{{ptf_portchannel_action}}"
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The common practice is to have a whitespace between the variable name for better readability, like {{ ptf_portchannel_action }}.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Got it.

Copy link
Copy Markdown
Collaborator

@wangxin wangxin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM with minor issue.

@ganglyu ganglyu merged commit 47305d6 into sonic-net:master Sep 14, 2021
wangxin added a commit to wangxin/sonic-mgmt that referenced this pull request Sep 16, 2021
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>
Blueve pushed a commit that referenced this pull request Sep 16, 2021
…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>
vmittal-msft pushed a commit to vmittal-msft/sonic-mgmt that referenced this pull request Sep 28, 2021
…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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants