~snappy-dev/snapd/master

« back to all changes in this revision

Viewing changes to cmd/snap-confine/spread-tests/main/mount-profiles-rw-mount/task.yaml

  • Committer: GitHub
  • Author(s): Zygmunt Krynicki
  • Date: 2016-12-06 13:54:07 UTC
  • mfrom: (2661.2.15)
  • Revision ID: git-v1:0ac9c21d5bf0d4d7db987cbe985a49f755295d0b
Merge pull request #2268 from zyga/merged-snap-confine

many: merge snap-confine into snapd

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
summary: Check that read-write bind mounts can be created
 
2
# This is blacklisted on debian because we first have to get the dpkg-vendor patches
 
3
systems: [-debian-8]
 
4
prepare: |
 
5
    echo "Having installed the snapd-hacker-toolbelt snap"
 
6
    snap install snapd-hacker-toolbelt
 
7
    echo "We can connect it to the mount-observe slot from the core"
 
8
    snap connect snapd-hacker-toolbelt:mount-observe ubuntu-core:mount-observe
 
9
    echo "We can change its mount profile externally to create a read-only bind-mount"
 
10
    echo "/snap/snapd-hacker-toolbelt/current/src -> /snap/snapd-hacker-toolbelt/current/dst"
 
11
    mkdir -p /var/lib/snapd/mount
 
12
    echo "/snap/snapd-hacker-toolbelt/current/src /snap/snapd-hacker-toolbelt/current/dst none bind,rw 0 0" > /var/lib/snapd/mount/snap.snapd-hacker-toolbelt.busybox.fstab
 
13
execute: |
 
14
    cd /
 
15
    echo "We can now look at the .id file in the destination directory"
 
16
    [ "$(/snap/bin/snapd-hacker-toolbelt.busybox cat /snap/snapd-hacker-toolbelt/current/dst/.id)" = "source" ]
 
17
    echo "As well as the current mount points"
 
18
    # FIXME: this doesn't show 'rw', bind mounts confuse most tools and it
 
19
    # seems that busybox is not any different here.
 
20
    /snap/bin/snapd-hacker-toolbelt.busybox mount | grep snapd-hacker-toolbelt
 
21
restore: |
 
22
    snap remove snapd-hacker-toolbelt
 
23
    rm -rf /var/snap/snapd-hacker-toolbelt
 
24
    rm -f /var/lib/snapd/mount/snap.snapd-hacker-toolbelt.busybox.fstab