| 1 |
#!/bin/bash |
| 2 |
|
| 3 |
# Copyright (C) 2010 Karel Zak <[email protected]> |
| 4 |
|
| 5 |
TS_TOPDIR="${0%/*}/../.." |
| 6 |
TS_DESC="utils" |
| 7 |
|
| 8 |
. "$TS_TOPDIR"/functions.sh |
| 9 |
ts_init "$*" |
| 10 |
|
| 11 |
TESTPROG="$TS_HELPER_LIBMOUNT_UTILS" |
| 12 |
|
| 13 |
[ -x $TESTPROG ] || ts_skip "test not compiled" |
| 14 |
|
| 15 |
ts_init_subtest "match-fstype" |
| 16 |
ts_run $TESTPROG --match-fstype ext3 "ext2,ext3,cifs" &> $TS_OUTPUT |
| 17 |
ts_finalize_subtest |
| 18 |
|
| 19 |
ts_init_subtest "match-fstype-neg" |
| 20 |
ts_run $TESTPROG --match-fstype cifs "ext2,ext3,nocifs" &> $TS_OUTPUT |
| 21 |
ts_finalize_subtest |
| 22 |
|
| 23 |
ts_init_subtest "match-fstype-neg2" |
| 24 |
ts_run $TESTPROG --match-fstype cifs "noext2,ext3,cifs" &> $TS_OUTPUT |
| 25 |
ts_finalize_subtest |
| 26 |
|
| 27 |
ts_init_subtest "match-options" |
| 28 |
ts_run $TESTPROG --match-options "aaa,bbb=BBB,ccc,ddd" "ccc" &> $TS_OUTPUT |
| 29 |
ts_finalize_subtest |
| 30 |
|
| 31 |
ts_init_subtest "match-options-list" |
| 32 |
ts_run $TESTPROG --match-options "aaa,bbb=BBB,ccc,ddd" "ccc,aaa,ddd" &> $TS_OUTPUT |
| 33 |
ts_finalize_subtest |
| 34 |
|
| 35 |
ts_init_subtest "match-options-neg" |
| 36 |
ts_run $TESTPROG --match-options "aaa,bbb=BBB,ccc,ddd" "noxxx" &> $TS_OUTPUT |
| 37 |
ts_finalize_subtest |
| 38 |
|
| 39 |
ts_init_subtest "match-options-neg-list" |
| 40 |
ts_run $TESTPROG --match-options "aaa,bbb=BBB,ccc,ddd" "ddd,noaaa" &> $TS_OUTPUT |
| 41 |
ts_finalize_subtest |
| 42 |
|
| 43 |
ts_init_subtest "match-options-neg-list2" |
| 44 |
ts_run $TESTPROG --match-options "aaa,bbb=BBB,ccc,ddd" "noxxx,ccc,aaa" &> $TS_OUTPUT |
| 45 |
ts_finalize_subtest |
| 46 |
|
| 47 |
ts_init_subtest "starts-with" |
| 48 |
ts_run $TESTPROG --starts-with "AAAbbbCCC" "AAA" &> $TS_OUTPUT |
| 49 |
ts_finalize_subtest |
| 50 |
|
| 51 |
ts_init_subtest "ends-with" |
| 52 |
ts_run $TESTPROG --ends-with "AAAbbbCCC" "CCC" &> $TS_OUTPUT |
| 53 |
ts_finalize_subtest |
| 54 |
|
| 55 |
ts_init_subtest "mountpoint" |
| 56 |
if [ -d /proc ]; then |
| 57 |
ts_run $TESTPROG --mountpoint /proc &> $TS_OUTPUT |
| 58 |
ts_finalize_subtest |
| 59 |
else |
| 60 |
ts_skip_subtest "no /proc" |
| 61 |
fi |
| 62 |
|
| 63 |
ts_init_subtest "mountpoint-subdir" |
| 64 |
if [ -d /proc/sys/kernel ]; then |
| 65 |
ts_run $TESTPROG --mountpoint /proc/sys/kernel &> $TS_OUTPUT |
| 66 |
ts_finalize_subtest |
| 67 |
else |
| 68 |
ts_skip_subtest "no /proc" |
| 69 |
fi |
| 70 |
|
| 71 |
ts_init_subtest "mountpoint-root" |
| 72 |
ts_run $TESTPROG --mountpoint / &> $TS_OUTPUT |
| 73 |
ts_finalize_subtest |
| 74 |
|
| 75 |
ts_init_subtest "kernel-cmdline" |
| 76 |
export LIBMOUNT_KERNEL_CMDLINE="$TS_SELF/files/kernel_cmdline" |
| 77 |
ts_run $TESTPROG --kernel-cmdline selinux= >> $TS_OUTPUT 2>> $TS_ERRLOG |
| 78 |
ts_run $TESTPROG --kernel-cmdline selinux >> $TS_OUTPUT 2>> $TS_ERRLOG |
| 79 |
ts_run $TESTPROG --kernel-cmdline ro >> $TS_OUTPUT 2>> $TS_ERRLOG |
| 80 |
ts_run $TESTPROG --kernel-cmdline ro= >> $TS_OUTPUT 2>> $TS_ERRLOG |
| 81 |
ts_run $TESTPROG --kernel-cmdline root= >> $TS_OUTPUT 2>> $TS_ERRLOG |
| 82 |
ts_finalize_subtest |
| 83 |
|
| 84 |
ts_finalize |