summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-07-25 06:14:19 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-07-25 06:14:19 +0000
commit50f2ad8e92ef06e4dee6d7070049a96231d3a8ee (patch)
treeb7cda9c5caad5948899bf7d6551262d9d7d86d09 /test
parentAdding upstream version 4.3+20240412. (diff)
downloadmdadm-50f2ad8e92ef06e4dee6d7070049a96231d3a8ee.tar.xz
mdadm-50f2ad8e92ef06e4dee6d7070049a96231d3a8ee.zip
Adding upstream version 4.3+20240723.upstream/4.3+20240723
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'test')
-rwxr-xr-xtest36
1 files changed, 25 insertions, 11 deletions
diff --git a/test b/test
index 338c2db..3a05bc9 100755
--- a/test
+++ b/test
@@ -6,8 +6,21 @@ targetdir="/var/tmp"
logdir="$targetdir"
config=/tmp/mdadm.conf
testdir=$PWD/tests
-system_speed_limit=`cat /proc/sys/dev/raid/speed_limit_max`
+system_speed_limit_max=0
+system_speed_limit_min=0
+test_speed_limit_min=100
+test_speed_limit_max=500
devlist=
+# If super1 metadata name doesn't have the same hostname with machine,
+# it's treated as foreign.
+# For example, /dev/md0 is created, stops it, then assemble it, the
+# device node will be /dev/md127 (127 is choosed by mdadm autumatically)
+is_foreign="no"
+#disable selinux
+sys_selinux="Permissive"
+
+skipping_linear="no"
+skipping_multipath="no"
savelogs=0
exitonerror=1
@@ -25,6 +38,11 @@ LVM_VOLGROUP=mdtest
md0=/dev/md0
md1=/dev/md1
md2=/dev/md2
+# if user doesn't specify minor number, mdadm chooses minor number
+# automatically from 127.
+md127=/dev/md127
+md126=/dev/md126
+md125=/dev/md125
mdp0=/dev/md_d0
mdp1=/dev/md_d1
@@ -39,10 +57,6 @@ ctrl_c() {
ctrl_c_error=1
}
-restore_system_speed_limit() {
- echo $system_speed_limit > /proc/sys/dev/raid/speed_limit_max
-}
-
mdadm() {
rm -f $targetdir/stderr
case $* in
@@ -103,16 +117,17 @@ do_test() {
do_clean
# source script in a subshell, so it has access to our
# namespace, but cannot change it.
+ control_system_speed_limit
echo -ne "$_script... "
if ( set -ex ; . $_script ) &> $targetdir/log
then
if [ -f "${_script}.inject_error" ]; then
echo "dmesg checking is skipped because test inject error"
else
- dmesg | grep -iq "error\|call trace\|segfault" &&
+ dmesg | grep -iq "error\|call trace\|segfault" | grep -v "systemd" &&
die "dmesg prints errors when testing $_basename!"
fi
- echo "succeeded"
+ succeed "succeeded\n"
_fail=0
else
save_log fail
@@ -300,10 +315,8 @@ parse_args() {
}
print_warning() {
- cat <<-EOF
- Warning! Tests are performed on system level mdadm!
- If you want to test local build, you need to install it first!
- EOF
+ warn "Warning! Tests are performed on system level mdadm!\n"
+ echo "If you want to test local build, you need to install it first!"
}
main() {
@@ -338,6 +351,7 @@ main() {
fi
done
+ restore_selinux
exit 0
}