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

     1  summary: Ensure that XDG_RUNTIME_DIR 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      This test checks that XDG_RUNTIME_DIR is actually created
     6  prepare: |
     7      echo "Having installed the snapd-hacker-toolbelt snap"
     8      snap install snapd-hacker-toolbelt
     9      echo "Having removed the XDG_RUNTIME_DIR directory"
    10      rm -rf "/run/user/`id -u`/snapd-hacker-toolbelt"
    11  execute: |
    12      cd /
    13      echo "FIXME: export XDG_RUNTIME_DIR for now until snapd does it"
    14      export XDG_RUNTIME_DIR="/run/user/`id -u`/snapd-hacker-toolbelt"
    15      echo "We can now run snapd-hacker-toolbelt.busybox true"
    16      /snap/bin/snapd-hacker-toolbelt.busybox true
    17      echo "And see that the XDG_RUNTIME_DIR directory was created"
    18      test -d /run/user/`id -u`/snapd-hacker-toolbelt
    19  restore: |
    20      snap remove --purge snapd-hacker-toolbelt
    21      rm -rf "/run/user/`id -u`/snapd-hacker-toolbelt"