Debian Codegraph @

tests/ts/minix/mkfs

raw symbols SCIP
1 #!/bin/bash
2 #
3 # Copyright (C) 2009 Karel Zak <[email protected]>
4 #
5 # This file is part of util-linux.
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 #
17 TS_TOPDIR="${0%/*}/../.."
18 TS_DESC="mkfs mount"
19
20 . "$TS_TOPDIR"/functions.sh
21 ts_init "$*"
22
23 ts_check_test_command "$TS_CMD_MKMINIX"
24 ts_check_test_command "$TS_CMD_MOUNT"
25 ts_check_test_command "$TS_CMD_UMOUNT"
26 ts_skip_nonroot
27
28 ts_scsi_debug_init dev_size_mb=10 num_parts=1
29 dev=${TS_DEVICE}1
30
31 # hotfix, wait for partition to appear (slow on Debian 7/linux-3.2)
32 test -b $dev || sleep 1
33
34 mkfs_and_mount_minix() {
35 ts_init_subtest $1
36 ts_log "create minix fs $2"
37 $TS_CMD_MKMINIX $2 $dev >> $TS_OUTPUT 2>> $TS_ERRLOG
38 echo "mkfs return value: $?" >> $TS_OUTPUT
39 udevadm settle
40 [ -d "$TS_MOUNTPOINT" ] || mkdir -p $TS_MOUNTPOINT
41 ts_mount "minix" $dev $TS_MOUNTPOINT
42 ts_is_mounted $dev || ts_die "Cannot find $dev in /proc/mounts"
43 ts_log "umount the image"
44 udevadm settle
45 $TS_CMD_UMOUNT $dev
46 ts_finalize_subtest
47 }
48
49 mkfs_and_mount_minix 'v1c14' '-1 -n 14'
50 mkfs_and_mount_minix 'v1c30' '-1 -n 30'
51 mkfs_and_mount_minix 'v2c14' '-2 -n 14'
52 mkfs_and_mount_minix 'v2c30' '-2 -n 30'
53 mkfs_and_mount_minix 'v2i65535' '-2 -i 65535'
54 mkfs_and_mount_minix 'v3c60' '-3 -n 60'
55
56 ts_finalize
57