Permalink
Cannot retrieve contributors at this time
Fetching contributors…
| summary: Ensure that snapd works on systems with a non rshared root | |
| # no need to run on ubuntu-core-16, we always have / shared here | |
| systems: [-ubuntu-core-*] | |
| prepare: | | |
| . $TESTSLIB/dirs.sh | |
| # simulate a system with a non-shared / | |
| mount --make-private / | |
| mount --make-private $(readlink -f $SNAP_MOUNT_DIR/core/current) | |
| restore: | | |
| . $TESTSLIB/dirs.sh | |
| mount --make-rshared / | |
| mount --make-rshared $(readlink -f $SNAP_MOUNT_DIR/core/current) | |
| execute: | | |
| . $TESTSLIB/dirs.sh | |
| echo "Install fresh test-snapd-tools" | |
| snap install test-snapd-tools | |
| test-snapd-tools.echo hello | |
| echo "Refresh, subsequent runs after refresh will fail if / is not rshared" | |
| snap refresh --edge test-snapd-tools | |
| test-snapd-tools.echo hello | |
| echo "Ensure we have a shared mount of $SNAP_MOUNT_DIR" | |
| cat /proc/self/mountinfo |MATCH "$SNAP_MOUNT_DIR $SNAP_MOUNT_DIR.*shared:[0-9]" | |
| echo "Run it again for good measure" | |
| test-snapd-tools.echo hello | |
| echo "... and ensure we do not mount $SNAP_MOUNT_DIR again" | |
| n=$(cat /proc/self/mountinfo |grep "$SNAP_MOUNT_DIR $SNAP_MOUNT_DIR.*shared:[0-9]"|wc -l) | |
| if [ "$n" -ne 1 ]; then | |
| echo "Incorrect extra $SNAP_MOUNT_DIR bind mounts created" | |
| exit 1 | |
| fi |