Skip to content

Commit

Permalink
Add a delay for 'test_ro_user' case 'test_ro_user_banned_command' to …
Browse files Browse the repository at this point in the history
…allow 'hostcfgd' to start and configure tacas authorization. (#3741)

- What is the motivation for this PR?
After recent change introduced on this PR's: sonic-net/sonic-buildimage#7965 and sonic-net/sonic-buildimage#8117 'hostcfgd' will be delayed in 90 seconds.
If the test will run before the daemon has started, it will fail the test. This is to align with the new change and make sure the test will pass.

- How did you do it?
Add a delay of 100 seconds before executing authorized commands.

- How did you verify/test it?
Run the test.

Signed-off-by: Shlomi Bitton <shlomibi@nvidia.com>
  • Loading branch information
shlomibitton authored Jul 8, 2021
1 parent e96abc9 commit 2090d39
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions tests/tacacs/test_ro_user.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import pytest
import time
from tests.common.helpers.assertions import pytest_assert

pytestmark = [
Expand Down Expand Up @@ -151,6 +152,8 @@ def test_ro_user_banned_command(localhost, duthosts, enum_rand_one_per_hwsku_hos
'sudo config'
]

# Wait until hostcfgd started and configured tacas authorization
time.sleep(100)
for command in commands:
banned = ssh_remote_ban_run(localhost, dutip, creds_all_duts[duthost]['tacacs_ro_user'],
creds_all_duts[duthost]['tacacs_ro_user_passwd'], command)
Expand Down

0 comments on commit 2090d39

Please sign in to comment.