summaryrefslogtreecommitdiffstats
path: root/tests/ts/libmount/utils
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-14 19:10:49 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-14 19:10:49 +0000
commitcfe5e3905201349e9cf3f95d52ff4bd100bde37d (patch)
treed0baf160cbee3195249d095f85e52d20c21acf02 /tests/ts/libmount/utils
parentInitial commit. (diff)
downloadutil-linux-cfe5e3905201349e9cf3f95d52ff4bd100bde37d.tar.xz
util-linux-cfe5e3905201349e9cf3f95d52ff4bd100bde37d.zip
Adding upstream version 2.39.3.upstream/2.39.3
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'tests/ts/libmount/utils')
-rwxr-xr-xtests/ts/libmount/utils84
1 files changed, 84 insertions, 0 deletions
diff --git a/tests/ts/libmount/utils b/tests/ts/libmount/utils
new file mode 100755
index 0000000..1fed2a7
--- /dev/null
+++ b/tests/ts/libmount/utils
@@ -0,0 +1,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>> $TS_ERRLOG
+ts_run $TESTPROG --kernel-cmdline selinux >> $TS_OUTPUT 2>> $TS_ERRLOG
+ts_run $TESTPROG --kernel-cmdline ro >> $TS_OUTPUT 2>> $TS_ERRLOG
+ts_run $TESTPROG --kernel-cmdline ro= >> $TS_OUTPUT 2>> $TS_ERRLOG
+ts_run $TESTPROG --kernel-cmdline root= >> $TS_OUTPUT 2>> $TS_ERRLOG
+ts_finalize_subtest
+
+ts_finalize