common/config: don't hard-code SELinux context
If SELinux is enabled, by default xfstests mounts its filesystems
with "-o context=system_u:object_r:nfs_t:s0" so that no SELinux
xattrs get created and interfere with tests. However, this
particular context is not guaranteed to be available because the
context names are a detail of the SELinux policy. The SELinux
policy on Android systems, for example, does not have a context with
this name.
To fix this without having to manually override
SELINUX_MOUNT_OPTIONS, just grab the SELinux context of the root
directory. This is arbitrary, but it should always provide a valid
context. And if for some reason someone is actually running
xfstests in a specific SELinux context that needs files labeled with
a particular context, then they may still override
SELINUX_MOUNT_OPTIONS.
Signed-off-by: Eric Biggers <ebiggers@google.com>
Reviewed-by: Eryu Guan <eguan@redhat.com>
Signed-off-by: Eryu Guan <eguan@redhat.com>