-PATH=`dirname $0`:`dirname $0`/../utils:$PATH
-insmod ../obdclass/llog_test.o || exit 1
-lctl modules > /r/tmp/ogdb-`hostname`
+# SPDX-License-Identifier: GPL-2.0
+
+#
+# This file is part of Lustre, http://www.lustre.org/
+#
+# lustre/tests/run-llog.sh
+#
+# Script to run the llog_test unit tests
+#
+
+LUSTRE=${LUSTRE:-$(dirname "$0")/..}
+. "$LUSTRE/tests/test-framework.sh"
+init_test_env "$@"
+
+TMP=${TMP:-/tmp}
+
+set -x
+MGS=$($LCTL dl | awk '/mgs/ { print $4 }')
+[ -z "$MGS" ] && echo "$0: SKIP: no MGS available, skipping llog test" && exit 0
+
+load_module obdclass/llog_test || exit 1
+$LCTL modules > "$TMP/ogdb-$(hostname)"