summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorZhilong Liu <zlliu@suse.com>2018-02-02 14:10:47 +0800
committerJes Sorensen <jsorensen@fb.com>2018-03-08 14:29:50 -0500
commit064bd3f5ca15c58945a2c0e6fcb33eda06bc0f7a (patch)
treecab66136e7c2ed8a6d3ce7bd2613a8418fe66ad4 /tests
parent7d81135e8a2c6e5d52cbeee3535fa5bfe449bdb6 (diff)
downloadmdadm-064bd3f5ca15c58945a2c0e6fcb33eda06bc0f7a.tar.gz
mdadm/test: add do_clean to ensure each case only catch its own testlog
Signed-off-by: Zhilong Liu <zlliu@suse.com> Signed-off-by: Jes Sorensen <jsorensen@fb.com>
Diffstat (limited to 'tests')
-rw-r--r--tests/func.sh8
1 files changed, 7 insertions, 1 deletions
diff --git a/tests/func.sh b/tests/func.sh
index 3958090..a6995f1 100644
--- a/tests/func.sh
+++ b/tests/func.sh
@@ -88,6 +88,13 @@ cleanup() {
esac
}
+do_clean()
+{
+ mdadm -Ss > /dev/null
+ mdadm --zero $devlist 2> /dev/null
+ dmesg -c > /dev/null
+}
+
check_env() {
user=$(id -un)
[ "X$user" != "Xroot" ] && {
@@ -141,7 +148,6 @@ do_setup() {
check_env
[ -d $logdir ] || mkdir -p $logdir
- dmesg -c > /dev/null
devlist=
if [ "$DEVTYPE" == "loop" ]