Whamcloud - gitweb
New release 2.15.64
[fs/lustre-release.git] / lustre / tests / llmountcleanup.sh
index aa8f8b1..848177c 100755 (executable)
@@ -1,60 +1,43 @@
-#!/bin/sh
+#!/bin/bash
+# SPDX-License-Identifier: GPL-2.0
+
+#
+# This file is part of Lustre, http://www.lustre.org/
+#
+# lustre/tests/llmountcleanup.sh
+#
+# Destroy the lustre filesystem and client created by
+# llmount.sh
+#
+
+usage() {
+       less -F <<EOF
+Usage: ${0##*/}
+Destroy the lustre filesystem and client created by llmount.sh
+       -h, --help          This help
 
-SRCDIR="`dirname $0`"
-. $SRCDIR/common.sh
-
-umount /mnt/lustre
-
-killall acceptor
-rmmod llite
-rmmod mdc
-
-$OBDCTL <<EOF
-device 5
-cleanup
-detach
-device 4
-cleanup
-detach
-device 3
-cleanup
-detach
-device 2
-cleanup
-detach
-device 1
-cleanup
-detach
-device 0
-cleanup
-detach
-quit
-EOF
-
-rmmod obdecho
-rmmod mds
-rmmod osc
-rmmod ost
-rmmod obdfilter
-rmmod obdext2
-rmmod ldlm
-rmmod ptlrpc
-rmmod obdclass
-
-$PTLCTL <<EOF
-setup tcp
-disconnect
-del_uuid self
-del_uuid mds
-del_uuid ost
-del_uuid ldlm
-quit
 EOF
-
-rmmod kqswnal
-rmmod ksocknal
-rmmod portals
-
-losetup -d ${LOOP}0
-losetup -d ${LOOP}1
-losetup -d ${LOOP}2
+       exit
+}
+
+# Replace long option with corresponding short option
+for arg in "$@"; do
+       shift
+       case "$arg" in
+               --help) set -- "$@" '-h';;
+               *) set -- "$@" "$arg";;
+       esac
+done
+
+while getopts "h" opt
+do
+       case "$opt" in
+               h|\?) usage;;
+       esac
+done
+
+LUSTRE=${LUSTRE:-$(dirname "$0")/..}
+. "$LUSTRE/tests/test-framework.sh"
+init_test_env "$@"
+
+cleanupall -f