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
|
summary: The media directory propagates events outwards
details: |
The /media directory is special in that mount events propagate outward from
the mount namespace used by snap applications into the main mount namespace.
Fedora and other systems that build udisks without --enable-fhs-media flag
use /run/media path instead.
prepare: |
"$TESTSTOOLS"/snaps-state install-local test-snapd-tools --devmode
MEDIA_DIR="$(os.paths media-dir)"
mkdir -p "${MEDIA_DIR}/src"
mkdir -p "${MEDIA_DIR}/dst"
touch "${MEDIA_DIR}/src/canary"
restore: |
# If this doesn't work maybe it is because the test didn't execute correctly
MEDIA_DIR="$(os.paths media-dir)"
umount "${MEDIA_DIR}/dst" || true
rm -f "${MEDIA_DIR}/src/canary"
rmdir "${MEDIA_DIR}/src"
rmdir "${MEDIA_DIR}/dst"
execute: |
MEDIA_DIR="$(os.paths media-dir)"
test ! -e "${MEDIA_DIR}/dst/canary"
test-snapd-tools.cmd mount --bind "${MEDIA_DIR}/src" "${MEDIA_DIR}/dst"
test -e "${MEDIA_DIR}/dst/canary"
|