2 # SPDX-License-Identifier: GPL-2.0
3 # Copyright (c) 2017 Oracle, Inc. All Rights Reserved.
7 # Test nesting the 'source' command in xfs_db via -c and interactive.
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
27 # real QA test starts here
40 _scratch_mkfs > $seqres.full 2>&1
41 _scratch_xfs_db -c "sb 0" -c "p magicnum" -c "source $tmp.a" -c "p magicnum" | sed -e 's/0x58465342/XFS_MAGIC/g'
43 echo "Test with interactive"
44 (echo "sb 0"; sleep 0.5;
45 echo "p magicnum"; sleep 0.5;
46 echo "source $tmp.a"; sleep 0.5;
47 echo "p magicnum"; sleep 0.5) | _scratch_xfs_db 2>&1 | sed -e 's/xfs_db> //g' -e 's/0x58465342/XFS_MAGIC/g' | egrep '(This is file|magicnum =)'