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
26 _scratch_mkfs >/dev/null 2>&1
28 _require_batched_discard $SCRATCH_MNT
30 echo "[+] Length is zero (should fail)"
31 out=$("$FSTRIM_PROG" -v -o0 -l0 $SCRATCH_MNT 2>&1)
32 [ $? -eq 0 ] && status=1
33 echo $out | _filter_scratch
35 echo "[+] Length is smaller than block size (should fail)"
36 out=$("$FSTRIM_PROG" -v -o0 -l100 $SCRATCH_MNT 2>&1)
37 [ $? -eq 0 ] && status=1
38 echo $out | _filter_scratch