| 1 | #!/bin/bash |
| 2 | |
| 3 | # This file is part of util-linux. |
| 4 | # |
| 5 | # This file is free software; you can redistribute it and/or modify |
| 6 | # it under the terms of the GNU General Public License as published by |
| 7 | # the Free Software Foundation; either version 2 of the License, or |
| 8 | # (at your option) any later version. |
| 9 | # |
| 10 | # This file is distributed in the hope that it will be useful, |
| 11 | # but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 12 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 13 | # GNU General Public License for more details. |
| 14 | |
| 15 | TS_TOPDIR="${0%/*}/../.." |
| 16 | TS_DESC="the columns enabled with -D and -I options" |
| 17 | |
| 18 | . "$TS_TOPDIR"/functions.sh |
| 19 | ts_init "$*" |
| 20 | |
| 21 | ts_check_test_command "$TS_CMD_FINDMNT" |
| 22 | ts_check_prog "head" |
| 23 | |
| 24 | ts_cd "$TS_OUTDIR" |
| 25 | |
| 26 | D_expectation="SOURCE FSTYPE SIZE USED AVAIL USE% TARGET" |
| 27 | I_expectation="SOURCE FSTYPE INO.TOTAL INO.USED INO.AVAIL INO.USE% TARGET" |
| 28 | { |
| 29 | if [[ $($TS_CMD_FINDMNT --raw --df | head -1) == "$D_expectation" ]]; then |
| 30 | echo "-D: OK" |
| 31 | else |
| 32 | echo "-D: ERROR" |
| 33 | $TS_CMD_FINDMNT --raw -D |
| 34 | echo $? |
| 35 | fi |
| 36 | |
| 37 | if [[ $($TS_CMD_FINDMNT --raw --dfi | head -1) == "$I_expectation" ]]; then |
| 38 | echo "-I: OK" |
| 39 | else |
| 40 | echo "-I: ERROR" |
| 41 | $TS_CMD_FINDMNT --raw -I |
| 42 | echo $? |
| 43 | fi |
| 44 | |
| 45 | if [[ $($TS_CMD_FINDMNT --raw --df | head -1) == "$D_expectation" ]]; then |
| 46 | echo "--df: OK" |
| 47 | else |
| 48 | echo "--df: ERROR" |
| 49 | $TS_CMD_FINDMNT --raw --df |
| 50 | echo $? |
| 51 | fi |
| 52 | |
| 53 | if [[ $($TS_CMD_FINDMNT --raw --dfi | head -1) == "$I_expectation" ]]; then |
| 54 | echo "--dfi: OK" |
| 55 | else |
| 56 | echo "--dfi: ERROR" |
| 57 | $TS_CMD_FINDMNT --raw --dfi |
| 58 | echo $? |
| 59 | fi |
| 60 | } >> "$TS_OUTPUT" 2>> "$TS_ERRLOG" |
| 61 | |
| 62 | ts_finalize |