2007-02-27 19:34:51 +01:00
|
|
|
#!/bin/sh
|
|
|
|
|
# Ensure that df -P is not affected by BLOCK_SIZE settings
|
|
|
|
|
|
2023-01-01 14:50:15 +00:00
|
|
|
# Copyright (C) 2007-2023 Free Software Foundation, Inc.
|
2007-02-27 19:34:51 +01:00
|
|
|
|
2007-07-23 14:35:58 +02:00
|
|
|
# This program is free software: you can redistribute it and/or modify
|
2007-02-27 19:34:51 +01:00
|
|
|
# it under the terms of the GNU General Public License as published by
|
2007-07-23 14:35:58 +02:00
|
|
|
# the Free Software Foundation, either version 3 of the License, or
|
2007-02-27 19:34:51 +01:00
|
|
|
# (at your option) any later version.
|
|
|
|
|
|
|
|
|
|
# This program is distributed in the hope that it will be useful,
|
|
|
|
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
|
# GNU General Public License for more details.
|
|
|
|
|
|
|
|
|
|
# You should have received a copy of the GNU General Public License
|
2017-09-19 01:13:23 -07:00
|
|
|
# along with this program. If not, see <https://www.gnu.org/licenses/>.
|
2007-02-27 19:34:51 +01:00
|
|
|
|
2012-09-02 21:55:12 +02:00
|
|
|
. "${srcdir=.}/tests/init.sh"; path_prepend_ ./src
|
2010-11-17 21:35:31 +01:00
|
|
|
print_ver_ df
|
2007-02-27 19:34:51 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
df -P . > t1 || fail=1
|
|
|
|
|
BLOCK_SIZE=1M df -P . > t2 || fail=1
|
|
|
|
|
|
2021-07-28 12:22:11 -07:00
|
|
|
# Since file system utilization may be changing, compare only df's header line.
|
2007-02-27 19:34:51 +01:00
|
|
|
# That records the block size. E.g., for "1M", it would be:
|
|
|
|
|
# Filesystem 1048576-blocks Used Available Capacity Mounted on
|
|
|
|
|
# while for 1K, it would be
|
|
|
|
|
# Filesystem 1024-blocks Used Available Capacity Mounted on
|
|
|
|
|
|
|
|
|
|
head -n1 t1 > exp || fail=1
|
|
|
|
|
head -n1 t2 > out || fail=1
|
|
|
|
|
|
2011-11-22 10:08:04 +01:00
|
|
|
compare exp out || fail=1
|
2007-02-27 19:34:51 +01:00
|
|
|
|
2008-09-07 10:31:27 +02:00
|
|
|
Exit $fail
|