Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions tests/ntp/test_ntp.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,11 @@
]

@pytest.fixture(scope="module")
def setup_ntp(ptfhost, duthost):
def setup_ntp(ptfhost, duthost, creds):
"""setup ntp client and server"""
if creds.get('proxy_env'):
# If testbed is behaind proxy then force ntpd inside ptf use local time
ptfhost.lineinfile(path="/etc/ntp.conf", line="server 127.127.1.0 prefer")

# enable ntp server
ptfhost.service(name="ntp", state="started")
Expand All @@ -31,7 +34,6 @@ def setup_ntp(ptfhost, duthost):

# stop ntp server
ptfhost.service(name="ntp", state="stopped")

# reset ntp client configuration
duthost.command("sudo config ntp del %s" % ptfip)
for ntp_server in ntp_servers:
Expand Down