2 # SPDX-License-Identifier: GPL-2.0
3 # Copyright (C) 2014 Red Hat Inc. All rights reserved.
5 # FSQA Test No. btrfs/075
7 # If one subvolume was mounted with selinux context, other subvolumes
8 # should be able to be mounted with the same selinux context too.
11 seqres=$RESULT_DIR/$seq
12 echo "QA output created by $seq"
17 trap "_cleanup; exit \$status" 0 1 2 3 15
23 $UMOUNT_PROG $subvol_mnt >/dev/null 2>&1
26 # get standard environment, filters and checks
30 # real QA test starts here
35 # SELINUX_MOUNT_OPTIONS will be set in common/config if selinux is enabled
36 if [ "$SELINUX_MOUNT_OPTIONS" == "" ]; then
37 _notrun "Require selinux to be enabled"
41 echo "Silence is golden"
43 # first mount default subvolume with selinux context set
44 _scratch_mkfs >$seqres.full 2>&1
47 # create a new subvolume and mount it with the same selinux context
48 subvol_mnt=$TEST_DIR/$seq.mnt
50 $BTRFS_UTIL_PROG subvolume create $SCRATCH_MNT/subvol >>$seqres.full 2>&1
51 $MOUNT_PROG -o subvol=subvol $SELINUX_MOUNT_OPTIONS $SCRATCH_DEV $subvol_mnt