mirror of
https://github.com/linux-apfs/apfstests.git
synced 2026-05-01 15:01:44 -07:00
7e98d41a6e
Refactor every test in the entire test suite to use the new boilerplate functions. This also migrates all the test group information into the test files. This patch has been autogenerated via the command: ./tools/convert-group btrfs ceph cifs ext4 f2fs generic nfs ocfs2 overlay perf shared udf xfs Signed-off-by: Darrick J. Wong <djwong@kernel.org> Reviewed-by: Allison Henderson <allison.henderson@oracle.com> Reviewed-by: Eric Biggers <ebiggers@google.com> Signed-off-by: Eryu Guan <guaneryu@gmail.com>
65 lines
1.8 KiB
Bash
Executable File
65 lines
1.8 KiB
Bash
Executable File
#! /bin/bash
|
|
# SPDX-License-Identifier: GPL-2.0
|
|
# Copyright (C) 2014 SUSE Linux Products GmbH. All Rights Reserved.
|
|
#
|
|
# FS QA Test No. btrfs/059
|
|
#
|
|
# Regression test for btrfs where removing the flag FS_COMPR_FL (chattr -c)
|
|
# from an inode wouldn't clear its compression property.
|
|
# This was fixed in the following linux kernel patch:
|
|
#
|
|
# Btrfs: add missing compression property remove in btrfs_ioctl_setflags
|
|
#
|
|
. ./common/preamble
|
|
_begin_fstest auto quick
|
|
|
|
# Override the default cleanup function.
|
|
_cleanup()
|
|
{
|
|
rm -fr $tmp
|
|
}
|
|
|
|
# Import common functions.
|
|
. ./common/filter
|
|
. ./common/filter.btrfs
|
|
|
|
# real QA test starts here
|
|
_supported_fs btrfs
|
|
_require_test
|
|
_require_scratch
|
|
_require_btrfs_command "property"
|
|
|
|
_scratch_mkfs >> $seqres.full 2>&1
|
|
_scratch_mount
|
|
|
|
mkdir $SCRATCH_MNT/testdir
|
|
echo "Setting compression flag in the directory..."
|
|
$CHATTR_PROG +c $SCRATCH_MNT/testdir
|
|
echo "Directory compression property value:"
|
|
$BTRFS_UTIL_PROG property get $SCRATCH_MNT/testdir compression | \
|
|
_filter_btrfs_compress_property
|
|
|
|
touch $SCRATCH_MNT/testdir/file1
|
|
echo "file1 compression property value:"
|
|
$BTRFS_UTIL_PROG property get $SCRATCH_MNT/testdir/file1 compression | \
|
|
_filter_btrfs_compress_property
|
|
|
|
echo "Clearing compression flag from directory..."
|
|
$CHATTR_PROG -c $SCRATCH_MNT/testdir
|
|
echo "Directory compression property value:"
|
|
$BTRFS_UTIL_PROG property get $SCRATCH_MNT/testdir compression | \
|
|
_filter_btrfs_compress_property
|
|
|
|
touch $SCRATCH_MNT/testdir/file2
|
|
echo "file2 compression property value:"
|
|
$BTRFS_UTIL_PROG property get $SCRATCH_MNT/testdir/file2 compression | \
|
|
_filter_btrfs_compress_property
|
|
|
|
touch $SCRATCH_MNT/testdir/file1
|
|
echo "file1 compression property value:"
|
|
$BTRFS_UTIL_PROG property get $SCRATCH_MNT/testdir/file1 compression | \
|
|
_filter_btrfs_compress_property
|
|
|
|
status=0
|
|
exit
|