Skip to content

Commit

Permalink
Wait dynamically for Salt master to be active and ready
Browse files Browse the repository at this point in the history
  • Loading branch information
meaksh committed Oct 10, 2024
1 parent f7cbda1 commit 1d2661f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 2 additions & 2 deletions testsuite/features/secondary/srv_salt_git_pillar.feature
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Feature: Salt master integration with Git pillar

Scenario: Preparing Git pillar configuration for Salt master
When I setup a git_pillar environment on the Salt master
And I wait for "30" seconds
And I wait until Salt master is active and ready
Then file "/etc/salt/master.d/zz-testing-gitpillar.conf" should exist on server

Scenario: Check for the expected pillar data after enabling Git pillar
Expand All @@ -19,7 +19,7 @@ Feature: Salt master integration with Git pillar

Scenario: Cleanup: Remove Git pillar configuration for Salt master
When I clean up the git_pillar environment on the Salt master
And I wait for "30" seconds
And I wait until Salt master is active and ready
Then file "/etc/salt/master.d/zz-testing-gitpillar.conf" should not exist on server

Scenario: Cleanup: Check for the expected pillar data after disabling Git pillar
Expand Down
4 changes: 4 additions & 0 deletions testsuite/features/step_definitions/salt_steps.rb
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,10 @@
step %(I wait until "#{salt_minion}" service is inactive on "#{minion}")
end

When(/^I wait until Salt master is active and ready$/) do
get_target('server').run_until_ok('bash -c \'until timeout 5s salt-key; do :; done\'')
end

When(/^I wait until no Salt job is running on "([^"]*)"$/) do |minion|
target = get_target(minion)
salt_call = use_salt_bundle ? 'venv-salt-call' : 'salt-call'
Expand Down

0 comments on commit 1d2661f

Please sign in to comment.