Skip to content

Commit

Permalink
tests: Add issuegen test for bursts of issue snippets
Browse files Browse the repository at this point in the history
Tests to ensure that #87
does not happen.
  • Loading branch information
kelvinfan001 committed Nov 18, 2020
1 parent 30fe521 commit ba46ea3
Showing 1 changed file with 20 additions and 2 deletions.
22 changes: 20 additions & 2 deletions tests/kola/basic/test-issue.sh
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ ok "symlink"
# If SSH keys are present, check that SSH keys snippets were generated by
# `gensnippet_ssh_keys` and shown by `agetty`.
if test -n "$(find /etc/ssh -name 'ssh_host_*_key' -print -quit)"; then
sleep 2
faketty agetty_output.txt agetty --show-issue
assert_file_has_content agetty_output.txt 'SSH host key:*'
ok "gensnippet_ssh_keys"
Expand All @@ -44,9 +45,26 @@ fi
# Check that a new issue snippet is generated when a .issue file is dropped into
# the issue run directory.
echo 'foo' > ${ISSUE_RUN_SNIPPETS_PATH}/10_foo.issue
sleep 1
sleep 2
faketty agetty_output.txt agetty --show-issue
assert_file_has_content agetty_output.txt 'foo'
ok "display new issue snippet"
ok "display new single issue snippet"

# Check that a large burst of .issue files dropped into the issue run directory
# will all get displayed, and that we don't hit any systemd 'start-limit-hit'
# failures
for i in {1..150};
do
echo "Issue snippet: $i" > ${ISSUE_RUN_SNIPPETS_PATH}/${i}_spam.issue
done
sleep 2
faketty agetty_output.txt agetty --show-issue
for i in {1..150};
do
assert_file_has_content agetty_output.txt "Issue snippet: $i"
done
systemctl status ${PKG_NAME}-issuegen.path > issuegen_status.txt
assert_not_file_has_content issuegen_status.txt "unit-start-limit-hit"
ok "display burst of new issue snippets"

tap_finish

0 comments on commit ba46ea3

Please sign in to comment.