Debian Codegraph @

tests/ts/findmnt/listmount

raw symbols SCIP
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="listmount & statmount"
17
18 . "$TS_TOPDIR"/functions.sh
19 ts_init "$*"
20
21 ts_check_test_command "$TS_CMD_FINDMNT"
22
23 [ "$("$TS_HELPER_SYSINFO" statmount-ok)" = "1" ] || ts_skip "no statmount"
24 [ "$("$TS_HELPER_SYSINFO" listmount-ok)" = "1" ] || ts_skip "no listmount"
25
26 function check_field {
27 local name="$1"
28
29 data=$( $TS_CMD_FINDMNT --noheadings --kernel=listmount --output "$name" --target /proc )
30 [ -n "$data" ] || echo "$name empty"
31 }
32
33
34 ts_init_subtest "target"
35 check_field "TARGET" >> $TS_OUTPUT 2>> $TS_ERRLOG
36 ts_finalize_subtest
37
38 ts_init_subtest "vfs-options"
39 check_field "VFS-OPTIONS" >> $TS_OUTPUT 2>> $TS_ERRLOG
40 ts_finalize_subtest
41
42 ts_init_subtest "fs-options"
43 check_field "FS-OPTIONS" >> $TS_OUTPUT 2>> $TS_ERRLOG
44 ts_finalize_subtest
45
46 ts_init_subtest "options"
47 check_field "OPTIONS" >> $TS_OUTPUT 2>> $TS_ERRLOG
48 ts_finalize_subtest
49
50 ts_init_subtest "fstype"
51 check_field "FSTYPE" >> $TS_OUTPUT 2>> $TS_ERRLOG
52 ts_finalize_subtest
53
54 ts_init_subtest "propagation"
55 check_field "PROPAGATION" >> $TS_OUTPUT 2>> $TS_ERRLOG
56 ts_finalize_subtest
57
58 ts_init_subtest "fsroot"
59 check_field "FSROOT" >> $TS_OUTPUT 2>> $TS_ERRLOG
60 ts_finalize_subtest
61
62 ts_init_subtest "parent"
63 check_field "PARENT" >> $TS_OUTPUT 2>> $TS_ERRLOG
64 ts_finalize_subtest
65
66 ts_init_subtest "id"
67 check_field "ID" >> $TS_OUTPUT 2>> $TS_ERRLOG
68 ts_finalize_subtest
69
70 ts_finalize