Whamcloud - gitweb
LU-17744 ldiskfs: mballoc stats fixes
[fs/lustre-release.git] / lustre / tests / run-llog.sh
1 #!/bin/bash
2 # SPDX-License-Identifier: GPL-2.0
3
4 #
5 # This file is part of Lustre, http://www.lustre.org/
6 #
7 # lustre/tests/run-llog.sh
8 #
9 # Script to run the llog_test unit tests
10 #
11
12 LUSTRE=${LUSTRE:-$(dirname "$0")/..}
13 . "$LUSTRE/tests/test-framework.sh"
14 init_test_env "$@"
15
16 TMP=${TMP:-/tmp}
17
18 set -x
19 MGS=$($LCTL dl | awk '/mgs/ { print $4 }')
20 [ -z "$MGS" ] && echo "$0: SKIP: no MGS available, skipping llog test" && exit 0
21
22 load_module kunit/llog_test || exit 1
23 $LCTL modules > "$TMP/ogdb-$(hostname)"
24 echo "NOW reload debugging syms.."
25
26 RC=0
27
28 # Using ignore_errors will allow lctl to cleanup even if the test fails.
29 eval "$LCTL <<-EOF || RC=2
30         attach llog_test llt_name llt_uuid
31         ignore_errors
32         setup $MGS
33         --device llt_name cleanup
34         --device llt_name detach
35 EOF"
36
37 $LCTL dl
38
39 rmmod -v llog_test || RC2=3
40 [ $RC -eq 0 ] && [ "$RC2" ] && RC=$RC2
41
42 exit $RC