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 (23 lines) | stat: -rw-r--r-- 929 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
summary: Check that a service installed by a snap is reported as active by systemd

details: |
    Snap packages may contain applications that are marked as services. The test
    installs one such package and observes that the application is started as a
    systemd service.

environment:
    SERVICE_NAME: snap.test-snapd-service.test-snapd-service.service

restore: |
    snap remove --purge test-snapd-service || true

execute: |
    echo "Given a service snap is installed"
    "$TESTSTOOLS"/snaps-state install-local test-snapd-service

    echo "When the service state is reported as active"
    while ! systemctl show -p ActiveState "$SERVICE_NAME" | grep -Pq "ActiveState=active"; do sleep 0.5; done

    echo "Then systemctl reports the status of the service as loaded, active and running"
    expected='(?s).*?Loaded: loaded .*?Active: active \(running\)'
    systemctl status "$SERVICE_NAME" | grep -Pqz "$expected"