summary: Ensure that namespaces do not leak through homedirs

details: |
    Ensure that layouts on /var/lib/subdir coupled with homedirs=/var/lib
    do not cause hostfs to leak to the initial mount namespace.

systems:
    - -ubuntu-core-*

prepare: |
    snap set system homedirs=/var/lib
    # This snap has a layout for /var/lib/demo, which is relevant here.
    "$TESTSTOOLS"/snaps-state install-local test-snapd-layout

restore: |
    snap unset system homedirs

execute: |
    NOMATCH hostfs </proc/self/mountinfo
    test-snapd-layout.sh -c "true"
    NOMATCH hostfs </proc/self/mountinfo
