1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
|
summary: Check that the refresh hold works
details: |
Check that we can configure the refresh.hold option to hold refreshes and
the hold is reflected in `snap refresh --time`.
# date had a bug where extended format would not be used for --iso-8601, this
# got fixed in 2015 (released in 8.25), see
# https://git.savannah.gnu.org/cgit/coreutils.git/commit/src/date.c?id=17bbf6ce44eb543a95695fa9d2cbd70fb52c6f42 for details
#
# the manifestation is running `date --iso-8601=seconds -d 'tomorrow 8:05 UTC'`
# would produce:
# - buggy version: 2018-07-27T08:05:00+0000
# - fixed version: 2018-07-27T08:05:00+00:00
# ubuntu-14.04 and amazon are shipped with buggy date
systems: [-ubuntu-14.04-*, -amazon-*, -centos-*]
execute: |
echo "Ensure snap set core refresh.hold works"
when="$(date --iso-8601=seconds -d 'tomorrow 8:05 UTC')"
when_nice="$(date -d "$when" +'tomorrow at %H:%M %Z')"
snap set core refresh.hold="$when"
snap refresh --time | MATCH "^hold: $when_nice"
|