2 # FSQA Test No. btrfs/075
4 # If one subvolume was mounted with selinux context, other subvolumes
5 # should be able to be mounted with the same selinux context too.
7 #-----------------------------------------------------------------------
8 # Copyright (C) 2014 Red Hat Inc. All rights reserved.
10 # This program is free software; you can redistribute it and/or
11 # modify it under the terms of the GNU General Public License as
12 # published by the Free Software Foundation.
14 # This program is distributed in the hope that it would be useful,
15 # but WITHOUT ANY WARRANTY; without even the implied warranty of
16 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 # GNU General Public License for more details.
19 # You should have received a copy of the GNU General Public License
20 # along with this program; if not, write the Free Software Foundation,
21 # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
23 #-----------------------------------------------------------------------
27 seqres=$RESULT_DIR/$seq
28 echo "QA output created by $seq"
33 trap "_cleanup; exit \$status" 0 1 2 3 15
39 $UMOUNT_PROG $subvol_mnt >/dev/null 2>&1
42 # get standard environment, filters and checks
46 # real QA test starts here
51 # SELINUX_MOUNT_OPTIONS will be set in common/config if selinux is enabled
52 if [ "$SELINUX_MOUNT_OPTIONS" == "" ]; then
53 _notrun "Require selinux to be enabled"
57 echo "Silence is golden"
59 # first mount default subvolume with selinux context set
60 _scratch_mkfs >$seqres.full 2>&1
63 # create a new subvolume and mount it with the same selinux context
64 subvol_mnt=$TEST_DIR/$seq.mnt
66 $BTRFS_UTIL_PROG subvolume create $SCRATCH_MNT/subvol >>$seqres.full 2>&1
67 $MOUNT_PROG -o subvol=subvol $SELINUX_MOUNT_OPTIONS $SCRATCH_DEV $subvol_mnt