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

[6.11.z] Make old foreman task 32 days older #12399

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions tests/foreman/maintain/test_health.py
Original file line number Diff line number Diff line change
Expand Up @@ -410,12 +410,14 @@ def test_positive_health_check_old_foreman_tasks(sat_maintain):

:expectedresults: check-old-foreman-tasks health check should pass.
"""
rake_command = 'foreman-rake console <<< '
find_task = '\'t = ForemanTasks::Task.where(state: "stopped").first;'
update_task = "t.started_at = t.started_at - 31.day;t.save(:validate => false)'"
error_message = 'paused or stopped task(s) older than 30 days'
delete_message = 'Deleted old tasks:'
sat_maintain.execute(rake_command + find_task + update_task)
rake_command = (
't = ForemanTasks::Task.where(state: "stopped").first;'
't.started_at = t.started_at - 32.day;'
't.save(:validate => false)'
)
sat_maintain.execute(f"foreman-rake console <<< '{rake_command}'")
result = sat_maintain.cli.Health.check(
options={'label': 'check-old-foreman-tasks', 'assumeyes': True}
)
Expand Down