Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Mvrf] test_ntp fixed issue: "Host unreachable" (#4003)
Description of PR Summary: Mvrf test_ntp gets stuck when executing cmd sudo ip vrf exec mgmt ntpd -gq or sudo cgexec -g l3mdev:mgmt ntpd -gq, which eventually lead to test case fail with error: > raise AnsibleConnectionFailure("Host unreachable", dark=cb.unreachable, contacted=cb.contacted) E AnsibleConnectionFailure: Host unreachable This may happen because connection with ntp servers defined in CONFIG_DB are not synchronized: ~$ ntpstat unsynchronised polling server every 8 s So in order to avoid test case getting stuck and failed, test will check ntp connection before enabling mvrf (because after mvrf is enabled ntp connection gets lost) and if it was not synchronized, will setup ntp server on ptf and configure ntp on dut. Fixes # (issue) Approach What is the motivation for this PR? Avoid test_ntp being stuck on executing cmd sudo ip vrf exec mgmt ntpd -gq or sudo cgexec -g l3mdev:mgmt ntpd -gq and make test case pass. How did you do it? Added setup of ntp server on ptf in case ntp is not synchronized. How did you verify/test it? Run mvrf/test_mgmtvrf.py::TestServices::test_ntp on Sonic master and 202012 images: mvrf/test_mgmtvrf.py::TestServices::test_ntp PASSED Signed-off-by: Andrii-Yosafat Lozovyi <andrii-yosafatx.lozovyi@intel.com>
- Loading branch information