2 # SPDX-License-Identifier: GPL-2.0
3 # Copyright (C) 2020 SUSE Linux Products GmbH. All Rights Reserved.
7 # Test that a new snapshot created with qgroup inherit passed should mark
8 # qgroup numbers inconsistent.
11 seqres=$RESULT_DIR/$seq
12 echo "QA output created by $seq"
16 status=1 # failure is the default!
17 trap "_cleanup; exit \$status" 0 1 2 3 15
25 # get standard environment, filters and checks
29 # remove previous $seqres.full before test
32 # real QA test starts here
34 # Modify as appropriate.
38 _scratch_mkfs >/dev/null
41 $BTRFS_UTIL_PROG subvolume create "$SCRATCH_MNT/src" > /dev/null
42 _pwrite_byte 0xcd 0 16M "$SCRATCH_MNT/src/file" > /dev/null
44 # Sync the fs to ensure data written to disk so that they can be accounted
47 $BTRFS_UTIL_PROG quota enable "$SCRATCH_MNT"
48 $BTRFS_UTIL_PROG quota rescan -w "$SCRATCH_MNT" > /dev/null
49 $BTRFS_UTIL_PROG qgroup create 1/0 "$SCRATCH_MNT"
51 # Create a snapshot with qgroup inherit
52 $BTRFS_UTIL_PROG subvolume snapshot -i 1/0 "$SCRATCH_MNT/src" \
53 "$SCRATCH_MNT/snapshot" > /dev/null
55 echo "Silence is golden"
56 # If qgroup is not marked inconsistent automatically, btrfs check would