2 # SPDX-License-Identifier: GPL-2.0
3 # Copyright (c) 2017 Oracle, Inc. All Rights Reserved.
7 # Check that we can't swapon a realtime file.
10 seqres=$RESULT_DIR/$seq
11 echo "QA output created by $seq"
15 status=1 # failure is the default!
16 trap "_cleanup; exit \$status" 0 1 2 3 7 15
24 # get standard environment, filters and checks
28 # real QA test starts here
31 _require_scratch_swapfile
33 echo "Format and mount"
34 _scratch_mkfs > $seqres.full 2>&1
35 _scratch_mount >> $seqres.full 2>&1
37 testdir=$SCRATCH_MNT/test-$seq
43 echo "Initialize file"
45 $XFS_IO_PROG -c "open -f -R $testdir/dummy" $testdir >> $seqres.full
46 echo moo >> $testdir/dummy
47 $XFS_IO_PROG -c "open -f -R $testdir/file1" $testdir >> $seqres.full
48 _pwrite_byte 0x61 0 $((blocks * blksz)) $testdir/file1 >> $seqres.full
49 $MKSWAP_PROG -U 27376b42-ff65-42ca-919f-6c9b62292a5c $testdir/file1 >> $seqres.full
52 swapon $testdir/file1 2>&1 | _filter_scratch
54 swapoff $testdir/file1 >> $seqres.full 2>&1