]> git.ipfire.org Git - thirdparty/util-linux.git/blame - tests/ts/minix/fsck
tests: split stdout and stderr
[thirdparty/util-linux.git] / tests / ts / minix / fsck
CommitLineData
108cfeca
KZ
1#!/bin/bash
2#
3# Copyright (C) 2009 Karel Zak <kzak@redhat.com>
4#
601d12fb 5# This file is part of util-linux.
108cfeca
KZ
6#
7# This file is free software; you can redistribute it and/or modify
8# it under the terms of the GNU General Public License as published by
9# the Free Software Foundation; either version 2 of the License, or
10# (at your option) any later version.
11#
12# This file is distributed in the hope that it will be useful,
13# but WITHOUT ANY WARRANTY; without even the implied warranty of
14# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15# GNU General Public License for more details.
16#
e130ce53 17TS_TOPDIR="${0%/*}/../.."
716133fc 18TS_DESC="mkfs fsck"
108cfeca 19
86aa0ee7 20. $TS_TOPDIR/functions.sh
108cfeca 21ts_init "$*"
2f791546
SK
22
23ts_check_test_command "$TS_CMD_MKMINIX"
716133fc
RM
24ts_check_test_command "$TS_CMD_FSCKMINIX"
25
26mkfs_and_fsck_minix() {
27 local ret
28 ts_log "#####################################"
cbf858aa
KZ
29 ts_log_both "$ mkfs.minix $1 image"
30 $TS_CMD_MKMINIX $1 $img >> $TS_OUTPUT 2>> $TS_ERRLOG
716133fc
RM
31 ret=$?
32 echo "return mkfs: $ret" >> $TS_OUTPUT
33 test $ret = 0 || return $ret
34
cbf858aa
KZ
35 ts_log_both "$ fsck.minix -lavsf image"
36 $TS_CMD_FSCKMINIX -lavsf $img >> $TS_OUTPUT 2>> $TS_ERRLOG
716133fc
RM
37 ret=$?
38 echo "return fsck: $ret" >> $TS_OUTPUT
39 return $ret
40}
41
42img=$(ts_image_init)
43
44# TODO looping over arbitrary badblock files (-l bad) gives a lot segfaults
45for ver in "" "-1" "-2" "-3"; do
46for n in "" "-n 14" "-n 30" "-n 60"; do
47 mkfs_and_fsck_minix "$ver $n"
48done
49done
50
51rm -f $img
52
53sed -i "s@$img@image@g" $TS_OUTPUT
108cfeca 54
108cfeca
KZ
55ts_finalize
56