2 # SPDX-License-Identifier: GPL-2.0
3 # Copyright 2012 (C) Red Hat, Inc., Lukas Czerner <lczerner@redhat.com>
7 # This check the FITRIM argument handling in the corner case where length is
8 # smaller than block size or zero.
11 seqres=$RESULT_DIR/$seq
12 echo "QA output created by $seq"
15 trap "exit \$status" 0 1 2 3 15
17 # get standard environment, filters and checks
21 # real QA test starts here
27 _scratch_mkfs >/dev/null 2>&1
29 _require_batched_discard $SCRATCH_MNT
31 echo "[+] Length is zero (should fail)"
32 out=$("$FSTRIM_PROG" -v -o0 -l0 $SCRATCH_MNT 2>&1)
33 [ $? -eq 0 ] && status=1
34 echo $out | _filter_scratch
36 echo "[+] Length is smaller than block size (should fail)"
37 out=$("$FSTRIM_PROG" -v -o0 -l100 $SCRATCH_MNT 2>&1)
38 [ $? -eq 0 ] && status=1
39 echo $out | _filter_scratch