Skip to content

Fix verify_orchagent_running_or_assert() for multi-ASIC#18463

Merged
abdosi merged 1 commit intosonic-net:masterfrom
ysmanman:fix-dut-util
May 21, 2025
Merged

Fix verify_orchagent_running_or_assert() for multi-ASIC#18463
abdosi merged 1 commit intosonic-net:masterfrom
ysmanman:fix-dut-util

Conversation

@ysmanman
Copy link
Contributor

Description of PR

Current implementation of verify_orchagent_running_or_assert does not verify orchagent state on all ASIC's. This is the code in question:

        if duthost.is_multi_asic:
            num_asic = duthost.facts.get('num_asic')
            for asic_index in range(num_asic):
                cmd = 'docker exec swss{} supervisorctl status orchagent'.format(asic_index)
                output = duthost.shell(cmd, module_ignore_errors=True)
                pytest_assert(not output['rc'], "Unable to check orchagent status output for asic_id {}"
                              .format(asic_index))
        else:
            cmds = 'docker exec swss supervisorctl status orchagent'
            output = duthost.shell(cmds, module_ignore_errors=True)
            pytest_assert(not output['rc'], "Unable to check orchagent status output")
        return 'RUNNING' in output['stdout']

On multi-ASIC, the validation of orchagent running state return 'RUNNING' in output['stdout'] is outside of the for loop. This means only the orchagent state of the ASIC with largest Id is checked.

Fix this by checking the orchagent state in for loop for every ASIC.

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

  • 202012
  • 202205
  • 202305
  • 202311
  • 202405
  • 202411

Approach

What is the motivation for this PR?

How did you do it?

How did you verify/test it?

Any platform specific information?

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

Documentation

@mssonicbld
Copy link
Collaborator

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@ysmanman
Copy link
Contributor Author

@arlakshm
Copy link
Contributor

/Azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

arlakshm pushed a commit to Azure/sonic-mgmt.msft that referenced this pull request May 17, 2025
…292)

Cherry-pick the fix of `verify_orchagent_running_or_assert` in following
PRs to msft-202503:

- sonic-net/sonic-mgmt#16065
- sonic-net/sonic-mgmt#18463
@abdosi abdosi merged commit 2c9b307 into sonic-net:master May 21, 2025
17 checks passed
opcoder0 pushed a commit to opcoder0/sonic-mgmt that referenced this pull request Dec 8, 2025
…all ASIC's. (sonic-net#18463)

Fix this by checking the orchagent state in for loop for every ASIC.

Signed-off-by: opcoder0 <[email protected]>
AharonMalkin pushed a commit to AharonMalkin/sonic-mgmt that referenced this pull request Dec 16, 2025
…all ASIC's. (sonic-net#18463)

Fix this by checking the orchagent state in for loop for every ASIC.

Signed-off-by: Aharon Malkin <[email protected]>
gshemesh2 pushed a commit to gshemesh2/sonic-mgmt that referenced this pull request Dec 21, 2025
…all ASIC's. (sonic-net#18463)

Fix this by checking the orchagent state in for loop for every ASIC.

Signed-off-by: Guy Shemesh <[email protected]>
gshemesh2 pushed a commit to gshemesh2/sonic-mgmt that referenced this pull request Jan 26, 2026
…all ASIC's. (sonic-net#18463)

Fix this by checking the orchagent state in for loop for every ASIC.

Signed-off-by: Guy Shemesh <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

4 participants