New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix connection salt master-minion checking state.event #4261
Conversation
tests/console/salt.pm
Outdated
@@ -29,11 +29,12 @@ systemctl start salt-minion | |||
systemctl status --no-pager salt-minion | |||
EOF | |||
assert_script_run($_) foreach (split /\n/, $cmd); | |||
record_soft_failure 'bsc#1069711'; # Added 30s wait for public key from minion present in master | |||
sleep(30); | |||
# before accepting the key, wait the minion is fully started (systemd might be not reliable) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
wait until the minion
tests/console/salt.pm
Outdated
record_soft_failure 'bsc#1069711'; # Added 30s wait for public key from minion present in master | ||
sleep(30); | ||
# before accepting the key, wait the minion is fully started (systemd might be not reliable) | ||
assert_script_run("salt-run state.event tagmatch=\"salt/auth\" quiet=True count=1"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess single ticks should help here:
assert_script_run 'salt-run state.event tagmatch="salt/auth" quiet=True count=1';
tests/console/salt.pm
Outdated
record_soft_failure 'bsc#1069711'; # Added 180s to ping minion | ||
validate_script_output "salt '*' test.ping -t 180 | grep -woh True > /dev/$serialdev", sub { m/True/ }, 190; | ||
# before pinging the minions, check the start event is a signal that the minion is now ready | ||
assert_script_run("salt-run state.event tagmatch=\"salt/minion/*/start\" quiet=True count=1"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
as above, single ticks
tests/console/salt.pm
Outdated
validate_script_output "salt '*' test.ping -t 180 | grep -woh True > /dev/$serialdev", sub { m/True/ }, 190; | ||
# before pinging the minions, check the start event is a signal that the minion is now ready | ||
assert_script_run("salt-run state.event tagmatch=\"salt/minion/*/start\" quiet=True count=1"); | ||
validate_script_output "salt '*' test.ping | grep -woh True > /dev/$serialdev", sub { m/True/ }; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wonder why we use validate_script_output
here. If grep does not find "True" it will return false anyway so what should suffice:
assert_script_run "salt '*' test.ping | grep -wo True";
The test just passed the salt module successfully in http://dhcp227/tests/301#step/salt/26 so your code did not break it. If it fixes the problem we should see by running the failing scenarios at least 10 times. At best you do it in local verification but we can also do it in production. Please consider my comments first though. |
VR with changes: http://dhcp227/tests/303#step/salt/31 |
Fix connection salt master-minion checking state.event