Skip to content

[action] [PR:10286] Avoid running command in exited ptf docker container#10524

Merged
mssonicbld merged 1 commit intosonic-net:202305from
mssonicbld:cherry/202305/10286
Oct 30, 2023
Merged

[action] [PR:10286] Avoid running command in exited ptf docker container#10524
mssonicbld merged 1 commit intosonic-net:202305from
mssonicbld:cherry/202305/10286

Conversation

@mssonicbld
Copy link
Copy Markdown
Collaborator

Description of PR

Summary:
Fixes # (issue)

Type of change

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

Back port request

  • 201911
  • 202012
  • 202205

Approach

What is the motivation for this PR?

While stopping PTF container, "ptf_control" module is executed to kill all processes in the PTF container.
The original code checks if the PTF container's Pid exists before running command in the PTF container. Unfortunately, this check is not enough. PTF docker container in exited status still has Pid.

How did you do it?

This change improved the code for getting PTF container's Pid. When PTF container is not in "running" status, always return None for PTF container's Pid.

How did you verify/test it?

Any platform specific information?

Supported testbed topology if it's a new test case?

Documentation

@mssonicbld
Copy link
Copy Markdown
Collaborator Author

Original PR: #10286

While stopping PTF container, "ptf_control" module is executed to
kill all processes in the PTF container.
The original code checks if the PTF container's Pid exists before
running command in the PTF container. Unfortunately, this check
is not enough. PTF docker container in exited status still has Pid.

This change improved the code for getting PTF container's Pid.
When PTF container is not in "running" status, always return None
for PTF container's Pid.

Signed-off-by: Xin Wang <xiwang5@microsoft.com>
@mssonicbld mssonicbld merged commit a9334f3 into sonic-net:202305 Oct 30, 2023
@mssonicbld mssonicbld deleted the cherry/202305/10286 branch February 4, 2024 09:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants