Skip to content

[action] [PR:19793] [vm_topology] Fix pid=0 issue if ptf docker is not running#19905

Merged
mssonicbld merged 1 commit intosonic-net:202505from
mssonicbld:cherry/202505/19793
Jul 30, 2025
Merged

[action] [PR:19793] [vm_topology] Fix pid=0 issue if ptf docker is not running#19905
mssonicbld merged 1 commit intosonic-net:202505from
mssonicbld:cherry/202505/19793

Conversation

@mssonicbld
Copy link
Copy Markdown
Collaborator

Description of PR

Summary:
Fixes # (issue)

Type of change

  • Bug fix
  • Testbed and Framework(new/improvement)
  • New Test case
  • Skipped for non-supported platforms
  • Test case improvement

Back port request

  • 202205
  • 202305
  • 202311
  • 202405
  • 202411
  • 202505

Approach

What is the motivation for this PR?

In vm_topology.py code, lots of the code check if the PTF container pid is 'None'. For example:

 if self.pid is None

In case PTF container is stopped, the current code would store PTF container pid "0" in self.pid.

Consequently, some of the logic is incorrect. For example, remove-topo while PTF container is stopped, the unbind topology step would fail if the host device happens to have a "eth0" interface.

How did you do it?

The fix is to check the Running states of PTF container. If the container is not running, explicitly set self.pid to None.

How did you verify/test it?

Run 'add-topo' and 'remove-topo'.

Any platform specific information?

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

Documentation

…#19793)

In vm_topology.py code, lots of the code check if the PTF container pid is 'None'. For example:

```
    if self.pid is None
```

In case PTF container is stopped, the current code would store PTF container pid "0" in `self.pid`.

Consequently, some of the logic is incorrect. For example, remove-topo while PTF container is stopped, the unbind topology step would fail if the host device happens to have a "eth0" interface.

The fix is to check the Running states of PTF container. If the container is not running, explicitly set `self.pid` to `None`.

Signed-off-by: Xin Wang <xiwang5@microsoft.com>
@mssonicbld
Copy link
Copy Markdown
Collaborator Author

Original PR: #19793

@mssonicbld
Copy link
Copy Markdown
Collaborator Author

/azp run

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 1 pipeline(s).

@mssonicbld mssonicbld merged commit 2720dd2 into sonic-net:202505 Jul 30, 2025
17 checks passed
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