summaryrefslogtreecommitdiffstats
path: root/tests/ts/libmount/utils
blob: bc89d4600b4afe73725679140c239df6884b92ab (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
#!/bin/bash

# Copyright (C) 2010 Karel Zak <kzak@redhat.com>

TS_TOPDIR="${0%/*}/../.."
TS_DESC="utils"

. $TS_TOPDIR/functions.sh
ts_init "$*"

TESTPROG="$TS_HELPER_LIBMOUNT_UTILS"

[ -x $TESTPROG ] || ts_skip "test not compiled"

ts_init_subtest "match-fstype"
ts_run $TESTPROG --match-fstype ext3 "ext2,ext3,cifs" &> $TS_OUTPUT
ts_finalize_subtest

ts_init_subtest "match-fstype-neg"
ts_run $TESTPROG --match-fstype cifs "ext2,ext3,nocifs" &> $TS_OUTPUT
ts_finalize_subtest

ts_init_subtest "match-fstype-neg2"
ts_run $TESTPROG --match-fstype cifs "noext2,ext3,cifs" &> $TS_OUTPUT
ts_finalize_subtest

ts_init_subtest "match-options"
ts_run $TESTPROG --match-options "aaa,bbb=BBB,ccc,ddd" "ccc" &> $TS_OUTPUT
ts_finalize_subtest

ts_init_subtest "match-options-list"
ts_run $TESTPROG --match-options "aaa,bbb=BBB,ccc,ddd" "ccc,aaa,ddd" &> $TS_OUTPUT
ts_finalize_subtest

ts_init_subtest "match-options-neg"
ts_run $TESTPROG --match-options "aaa,bbb=BBB,ccc,ddd" "noxxx" &> $TS_OUTPUT
ts_finalize_subtest

ts_init_subtest "match-options-neg-list"
ts_run $TESTPROG --match-options "aaa,bbb=BBB,ccc,ddd" "ddd,noaaa" &> $TS_OUTPUT
ts_finalize_subtest

ts_init_subtest "match-options-neg-list2"
ts_run $TESTPROG --match-options "aaa,bbb=BBB,ccc,ddd" "noxxx,ccc,aaa" &> $TS_OUTPUT
ts_finalize_subtest

ts_init_subtest "starts-with"
ts_run $TESTPROG --starts-with "AAAbbbCCC" "AAA" &> $TS_OUTPUT
ts_finalize_subtest

ts_init_subtest "ends-with"
ts_run $TESTPROG --ends-with "AAAbbbCCC" "CCC" &> $TS_OUTPUT
ts_finalize_subtest

ts_init_subtest "mountpoint"
if [ -d /proc ]; then
	ts_run $TESTPROG --mountpoint /proc &> $TS_OUTPUT
	ts_finalize_subtest
else
	ts_skip_subtest "no /proc"
fi

ts_init_subtest "mountpoint-subdir"
if [ -d /proc/sys/kernel ]; then
	ts_run $TESTPROG --mountpoint /proc/sys/kernel &> $TS_OUTPUT
	ts_finalize_subtest
else
	ts_skip_subtest "no /proc"
fi

ts_init_subtest "mountpoint-root"
ts_run $TESTPROG --mountpoint / &> $TS_OUTPUT
ts_finalize_subtest

ts_init_subtest "kernel-cmdline"
export LIBMOUNT_KERNEL_CMDLINE="$TS_SELF/files/kernel_cmdline"
ts_run $TESTPROG --kernel-cmdline selinux= >> $TS_OUTPUT 2>&1
ts_run $TESTPROG --kernel-cmdline selinux >> $TS_OUTPUT 2>&1
ts_run $TESTPROG --kernel-cmdline ro >> $TS_OUTPUT 2>&1
ts_run $TESTPROG --kernel-cmdline ro= >> $TS_OUTPUT 2>&1
ts_run $TESTPROG --kernel-cmdline root= >> $TS_OUTPUT 2>&1
ts_finalize_subtest

ts_finalize