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
34 # SELINUX_MOUNT_OPTIONS will be set in common/config if selinux is enabled
35 if [ "$SELINUX_MOUNT_OPTIONS" == "" ]; then
36 _notrun "Require selinux to be enabled"
40 echo "Silence is golden"
42 # first mount default subvolume with selinux context set
43 _scratch_mkfs >$seqres.full 2>&1
46 # create a new subvolume and mount it with the same selinux context
47 subvol_mnt=$TEST_DIR/$seq.mnt
49 $BTRFS_UTIL_PROG subvolume create $SCRATCH_MNT/subvol >>$seqres.full 2>&1
50 $MOUNT_PROG -o subvol=subvol $SELINUX_MOUNT_OPTIONS $SCRATCH_DEV $subvol_mnt