Skip to content

Commit

Permalink
Adjust timing of daily apt tasks
Browse files Browse the repository at this point in the history
(cherry picked from commit a98e91c)
  • Loading branch information
rmol authored and emkll committed Mar 9, 2021
1 parent 9d43ac3 commit 2d1960a
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
[Timer]
OnCalendar=
OnCalendar=04:00
RandomizedDelaySec=1h
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
[Timer]
OnCalendar=
OnCalendar=*-*-* 00/3:00
RandomizedDelaySec=1h
Persistent=true
14 changes: 14 additions & 0 deletions molecule/testinfra/common/test_automatic_updates.py
Original file line number Diff line number Diff line change
Expand Up @@ -277,6 +277,20 @@ def test_apt_daily_services_and_timers_enabled(host, service):
assert s.is_enabled


def test_apt_daily_timer_schedule(host):
if host.system_info.codename != "xenial":
c = host.run("systemctl show apt-daily.timer")
assert "TimersCalendar={ OnCalendar=*-*-* 00/3:00:00 ;" in c.stdout
assert "RandomizedDelayUSec=1h" in c.stdout


def test_apt_daily_upgrade_timer_schedule(host):
if host.system_info.codename != "xenial":
c = host.run("systemctl show apt-daily-upgrade.timer")
assert "TimersCalendar={ OnCalendar=*-*-* 04:00:00 ;" in c.stdout
assert "RandomizedDelayUSec=1h" in c.stdout


def test_reboot_required_cron(host):
"""
Unatteded-upgrades does not reboot the system if the updates don't require it.
Expand Down

0 comments on commit 2d1960a

Please sign in to comment.