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 (66 lines) | stat: -rw-r--r-- 3,314 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
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
summary: Ensure that the system-packages-doc interface works.

details: |
    Check the system-packages-doc interface allows accessing the desired
    files and that it works well after discarding the namespace to verify
    that snap-update-ns rules are correct. Check the interface doesn't allow
    accessing the files when it is disconnected.

systems: [-ubuntu-core-*]

prepare: |
    snap pack test-snapd-app
    snap install --dangerous ./test-snapd-app_1_all.snap
    mkdir -p /usr/share/doc/system-packages-doc-iface
    echo text >/usr/share/doc/system-packages-doc-iface/content
    mkdir -p /usr/share/libreoffice/help
    echo text >/usr/share/libreoffice/help/content
    mkdir -p /usr/share/xubuntu-docs
    echo text >/usr/share/xubuntu-docs/content
    mkdir -p /usr/local/share/doc
    echo text >/usr/local/share/doc/content
    mkdir -p /usr/share/gtk-doc
    echo text >/usr/share/gtk-doc/content
    mkdir -p /usr/share/cups/doc-root
    echo text >/usr/share/cups/doc-root/content
    mkdir -p /usr/share/gimp/2.0/help
    echo text >/usr/share/gimp/2.0/help/content

restore: |
    snap remove --purge test-snapd-app
    rm -f test-snapd-app_1_all.snap
    rm -rf /usr/share/doc/system-packages-doc-iface

execute: |
    # The interface is not auto-connected
    not test-snapd-app.sh -c 'test -e /usr/share/doc/system-packages-doc-iface/content'

    # The interface works as expected
    snap connect test-snapd-app:system-packages-doc
    test-snapd-app.sh -c 'cat /usr/share/doc/system-packages-doc-iface/content' | MATCH text
    test-snapd-app.sh -c 'cat /usr/share/libreoffice/help/content' | MATCH text
    test-snapd-app.sh -c 'cat /usr/share/xubuntu-docs/content' | MATCH text
    test-snapd-app.sh -c 'cat /usr/local/share/doc/content' | MATCH text
    test-snapd-app.sh -c 'cat /usr/share/gtk-doc/content' | MATCH text
    test-snapd-app.sh -c 'cat /usr/share/cups/doc-root/content' | MATCH text
    test-snapd-app.sh -c 'cat /usr/share/gimp/2.0/help/content' | MATCH text

    # Do the same, after discarding the namespace to verify that snap-update-ns rules are correct
    snapd.tool exec snap-discard-ns test-snapd-app
    test-snapd-app.sh -c 'cat /usr/share/doc/system-packages-doc-iface/content' | MATCH text
    test-snapd-app.sh -c 'cat /usr/share/libreoffice/help/content' | MATCH text
    test-snapd-app.sh -c 'cat /usr/share/xubuntu-docs/content' | MATCH text
    test-snapd-app.sh -c 'cat /usr/local/share/doc/content' | MATCH text
    test-snapd-app.sh -c 'cat /usr/share/gtk-doc/content' | MATCH text
    test-snapd-app.sh -c 'cat /usr/share/cups/doc-root/content' | MATCH text
    test-snapd-app.sh -c 'cat /usr/share/gimp/2.0/help/content' | MATCH text

    # The interface can be disconnected
    snap disconnect test-snapd-app:system-packages-doc
    not test-snapd-app.sh -c 'test -e /usr/share/doc/system-packages-doc-iface/content'
    not test-snapd-app.sh -c 'test -e /usr/share/libreoffice/help/content'
    not test-snapd-app.sh -c 'test -e /usr/share/xubuntu-docs/content'
    not test-snapd-app.sh -c 'test -e /usr/local/share/doc/content'
    not test-snapd-app.sh -c 'test -e /usr/share/gtk-doc/content'
    not test-snapd-app.sh -c 'test -e /usr/share/cups/doc-root/content'
    not test-snapd-app.sh -c 'test -e /usr/share/gimp/2.0/help/content'