Skip to content
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

Merged
merged 1 commit into from Jan 26, 2018

Conversation

jknphy
Copy link
Contributor

@jknphy jknphy commented Jan 24, 2018

Fix connection salt master-minion checking state.event

@jknphy jknphy changed the title Fix connection salt master-minion checking state.event [WIP] Fix connection salt master-minion checking state.event Jan 24, 2018
@@ -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)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

wait until the minion

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");
Copy link
Member

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';

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");
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

as above, single ticks

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/ };
Copy link
Member

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";

@okurz
Copy link
Member

okurz commented Jan 24, 2018

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.

@jknphy
Copy link
Contributor Author

jknphy commented Jan 24, 2018

VR with changes: http://dhcp227/tests/303#step/salt/31
Yes, we need to give it a try in prod, never was reproducible in local.

@jknphy jknphy changed the title [WIP] Fix connection salt master-minion checking state.event Fix connection salt master-minion checking state.event Jan 24, 2018
@okurz okurz merged commit dc27d36 into os-autoinst:master Jan 26, 2018
@jknphy jknphy deleted the fix_salt branch March 7, 2018 07:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants