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 _begin_fstest auto quick
12 _register_cleanup "_cleanup" BUS
14 # Import common functions.
16 # real QA test starts here
29 _scratch_mkfs > $seqres.full 2>&1
30 _scratch_xfs_db -c "sb 0" -c "p magicnum" -c "source $tmp.a" -c "p magicnum" | sed -e 's/0x58465342/XFS_MAGIC/g'
32 echo "Test with interactive"
33 (echo "sb 0"; sleep 0.5;
34 echo "p magicnum"; sleep 0.5;
35 echo "source $tmp.a"; sleep 0.5;
36 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 =)'