Understanding Passwordless SSH Dependency in SONiC Management Pytest Execution Environment #195491
Replies: 4 comments 1 reply
-
|
Yeah, what you ran into makes total sense once you understand how the SONiC mgmt framework works under the hood.
|
Beta Was this translation helpful? Give feedback.
-
|
Hi @Shubh-csk , thanks for posting in GitHub Discussions! The |
Beta Was this translation helpful? Give feedback.
-
|
Yes, passwordless SSH is generally expected. Many SONiC-mgmt pytest workflows rely on Ansible executing commands non-interactively across DUTs, PTF hosts, fanouts, and localhost. Password prompts cannot be handled during automated fixture initialization. Based on your findings, the behavior you observed is consistent with how SONiC-mgmt and Ansible are typically deployed in CI, lab, and production validation environments, where passwordless SSH is effectively a requirement for reliable test execution. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
🏷️ Discussion Type
Question
Body
While working on SONiC FDB testcase execution inside the docker-sonic-mgmt environment, I encountered an interesting issue during pytest initialization and wanted to understand the expected behavior and recommended best practices from the community.
Initially, all FDB related testcases were failing during duthosts fixture initialization with the following error:
Host unreachable in the inventory
During troubleshooting, I verified the following successfully:
Inventory parsing and host mapping
DUT/PTF ansible connectivity
Manual SSH accessibility
Pytest execution and testcase discovery
Testbed configuration loading
Even though manual ansible connectivity and SSH verification were working correctly, the SONiC pytest framework was still failing internally during testcase setup.
Later, the issue was resolved after configuring passwordless SSH using:
ssh-copy-id
between:
docker-sonic-mgmt
DUT
PTF server
After enabling passwordless SSH, the pytest execution progressed successfully beyond the earlier Host unreachable stage.
I wanted to understand the following from experienced SONiC users and contributors:
Does the SONiC pytest/ansible framework internally require passwordless SSH for fixture initialization and background ansible operations?
Are there specific pytest fixtures or SONiC management utilities that depend on non-interactive SSH authentication?
What are the recommended pre-validation steps before running SONiC pytest suites in custom or new lab environments?
Is there any documented best practice for validating SSH trust relationships between docker-sonic-mgmt, DUT, and PTF before testcase execution?
Would appreciate any guidance, recommendations, or documentation references from the community regarding this workflow and environment setup behavior.
Beta Was this translation helpful? Give feedback.
All reactions