github.com/kubiko/snapd@v0.0.0-20201013125620-d4f3094d9ddf/cmd/snap-confine/spread-tests/main/user-data-dir-created/task.yaml (about)

     1  summary: Ensure that SNAP_USER_DATA directory is created by snap-confine
     2  # This is blacklisted on debian because debian doesn't use apparmor yet
     3  systems: [-debian-8]
     4  details: |
     5      A regression was found in snap-confine where the new code path in snapd was
     6      not active yet but the corresponding code path in snap-confine was already
     7      removed. This resulted in the $SNAP_USER_DATA directory not being created
     8      at runtime.
     9      This test checks that it is actually created
    10  prepare: |
    11      echo "Having installed the snapd-hacker-toolbelt snap"
    12      snap install snapd-hacker-toolbelt
    13      echo "Having removed the SNAP_USER_DATA directory"
    14      rm -rf "$HOME/snap/snapd-hacker-toolbelt/"
    15  execute: |
    16      cd /
    17      echo "We can now run snapd-hacker-toolbelt.busybox true"
    18      /snap/bin/snapd-hacker-toolbelt.busybox true
    19      echo "And see that the SNAP_USER_DATA directory was created"
    20      test -d $HOME/snap/snapd-hacker-toolbelt
    21  restore: |
    22      snap remove --purge snapd-hacker-toolbelt
    23      rm -rf "$HOME/snap/snapd-hacker-toolbelt/"