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 (38 lines) | stat: -rw-r--r-- 1,520 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
25
26
27
28
29
30
31
32
33
34
35
36
37
38
summary: Ensure snapd notify feature is working

details: |
    This test checks that snapd is using the notify feature of systemd to signal
    when it is ready.

# this test requires SNAPD_DEBUG to be set, we can't make that assumption for the
# external backend
backends: [-external]

execute: |
    echo "Check that snapd uses notifications"
    systemctl show -p Type snapd.service | MATCH Type=notify

    for _ in $(seq 5); do
        if systemctl is-active snapd.service; then
            # ExecMainStartTimestampMonotonic=35275661308
            mainstart="$(systemctl show -p ExecMainStartTimestampMonotonic snapd.service | cut -f2 -d=)"
            # ActiveEnterTimestampMonotonic=35275819212
            activeenter="$(systemctl show -p ActiveEnterTimestampMonotonic snapd.service | cut -f2 -d=)"
            # WatchdogTimestampMonotonic=35275819210
            # NOTE: always 0 with systemd 204 on Ubuntu 14.04
            watchdog="$(systemctl show -p WatchdogTimestampMonotonic snapd.service | cut -f2 -d=)"
            # service became active after it was started
            test "$activeenter" -gt "$mainstart"
            if not os.query is-trusty; then
                # service pinged systemd after start
                test "$watchdog" -gt "$mainstart"
                # and became active after having pinged the daemon
                test "$activeenter" -ge "$watchdog"
            fi
            exit 0
        fi
        sleep 1
    done

    echo "Snapd service status not active"
    exit 1