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 (42 lines) | stat: -rw-r--r-- 1,852 bytes parent folder | download | duplicates (5)
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
39
40
41
42
summary: smoke tests for user mounts

details: |
    When a confined snap has a user-fstab file, additional bind mounts will
    be performed prior to running the application.  These mounts are private
    to the invocation of the application, so can be used to manipulate how
    per-user data is presented.

# This test makes use of the user mount provided by the desktop
# interface.  When we have an interface providing user mounts that is
# available on core, we can switch to that.
# TODO: expand coverage to 14.04 with improved tests.session.
systems:
    - -ubuntu-core-*   # see above
    - -ubuntu-14.04-*  # no tests.session

prepare: |
    "$TESTSTOOLS"/snaps-state install-local test-snapd-desktop
    snap disconnect test-snapd-desktop:desktop

    tests.session -u test prepare
restore: |
    tests.session -u test restore

execute: |
    echo "Without desktop interface connected, there is no user-fstab file"
    test ! -e /var/lib/snapd/mount/snap.test-snapd-desktop.user-fstab

    echo "With desktop interface connected, it is created"
    snap connect test-snapd-desktop:desktop
    test -f /var/lib/snapd/mount/snap.test-snapd-desktop.user-fstab
    diff -u /var/lib/snapd/mount/snap.test-snapd-desktop.user-fstab - << \EOF
    $XDG_RUNTIME_DIR/doc/by-app/snap.test-snapd-desktop $XDG_RUNTIME_DIR/doc none bind,rw,x-snapd.ignore-missing 0 0
    EOF

    snapd.tool exec snap-discard-ns test-snapd-sh

    echo "The user-fstab file is used to prepare the confinement sandbox"
    tests.session -u test exec mkdir -p /run/user/12345/doc/by-app/snap.test-snapd-desktop
    tests.session -u test exec touch /run/user/12345/doc/by-app/snap.test-snapd-desktop/in-source
    tests.session -u test exec touch /run/user/12345/doc/in-target
    tests.session -u test exec test-snapd-desktop.check-dirs /run/user/12345/doc | MATCH in-source