blob: e302f30dbe226aee5afe977073d2654c767d252e [file]
#!/usr/bin/env bash
# This file is part of util-linux.
# SPDX-License-Identifier: GPL-2.0-or-later
TS_TOPDIR="${0%/*}/../.."
TS_DESC="length limit in sparse files"
. "$TS_TOPDIR"/functions.sh
ts_init "$*"
ts_check_test_command "$TS_CMD_HEXDUMP"
ts_check_prog "truncate"
ts_cd "$TS_OUTDIR"
truncate -s 1M sparse.bin || ts_failed "cannot create sparse file"
for length in 64 65; do
for skip in 0 1 17 4096; do
ts_init_subtest "length-$length-skip-$skip"
$TS_CMD_HEXDUMP -C -s "$skip" -n "$length" sparse.bin >> "$TS_OUTPUT" 2>> "$TS_ERRLOG"
ts_finalize_subtest
done
done
ts_finalize