b2e5668c415bfe3663361009e0a415e400afc889
[xfstests-dev.git] / tests / xfs / 303
1 #! /bin/bash
2 # SPDX-License-Identifier: GPL-2.0
3 # Copyright (c) 2013 Oracle Inc.  All Rights Reserved.
4 #
5 # FS QA Test No. 303
6 #
7 # Test to verify xfs_quota(8) administrator commands can deal with invalid
8 # storage mount point without NULL pointer dereference problem.
9 #
10 . ./common/preamble
11 _begin_fstest auto quick quota
12
13 # Import common functions.
14 . ./common/filter
15
16 # real QA test starts here
17 _supported_fs xfs
18
19 echo "Silence is golden"
20
21 # To run this sanity check we don't need to enable quota function
22 # nor need a scratch device as quota tool will get the mount path
23 # at first.
24 # An non-existent xfs mount point
25 INVALID_PATH="/INVALID_XFS_MOUNT_POINT"
26
27 xfs_quota -x -c 'report -a' $INVALID_PATH       2>/dev/null
28 xfs_quota -x -c 'state -a' $INVALID_PATH        2>/dev/null
29 xfs_quota -x -c 'free -h' $INVALID_PATH         2>/dev/null
30 xfs_quota -x -c 'quot -v' $INVALID_PATH         2>/dev/null
31 xfs_quota -x -c 'remove' $INALID_PATH           2>/dev/null
32 xfs_quota -x -c 'disable' $INVALID_PATH         2>/dev/null
33 xfs_quota -x -c 'enable' $INVALID_PATH          2>/dev/null
34
35 # success, all done
36 status=0
37 exit