File: task.yaml

package info (click to toggle)
snapd 2.72-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 80,412 kB
  • sloc: sh: 16,506; ansic: 16,211; python: 11,213; makefile: 1,919; exp: 190; awk: 58; xml: 22
file content (24 lines) | stat: -rw-r--r-- 998 bytes parent folder | download | duplicates (3)
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"