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 (33 lines) | stat: -rw-r--r-- 1,300 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
summary: ensure snap fails to install if one of user or group doesn't exist

details: |
    When a snap package declares that it needs the snap_daemon user to exist,
    and the host system has only the group but not the user itself, then such
    snap cannot be installed.

# List of expected snap install failures due to libseccomp/golang-seccomp being
# too old. Since the illegal name check happens after verifying system support,
# we can ignore these. Ignore ubuntu-core since groupdel doesn't support
# --extrausers
systems: [-amazon-linux-2-*, -ubuntu-14.04-*, -ubuntu-core-*]

prepare: |
    groupadd --system snap_daemon

restore: |
    # Make sure the snap is removed if the test failed and the snap was
    # installed
    snap remove --purge test-snapd-daemon-user || true

    # snapd will create this for us, but we'll remove it for consistency in
    # test runs
    groupdel snap_daemon || true
    not getent group snap_daemon

execute: |
    echo "When the snap_daemon group exists but not the user"
    getent passwd snap_daemon && exit 1
    getent group snap_daemon || exit 1

    echo "Then the snap cannot be installed"
    snap install --edge test-snapd-daemon-user 2>&1 | tr '\n' ' ' | tr -s ' ' | MATCH 'cannot add user/group "snap_daemon": group exists and user does not'