xref: /illumos-gate/usr/src/test/os-tests/tests/ddi_ufm/ufm-test-cleanup.sh (revision 508a0e8cf1600b06c1f7361ad76e736710d3fdf8)
1*508a0e8cSRob Johnston#!/usr/bin/bash
2*508a0e8cSRob Johnston
3*508a0e8cSRob Johnston#
4*508a0e8cSRob Johnston# This file and its contents are supplied under the terms of the
5*508a0e8cSRob Johnston# Common Development and Distribution License ("CDDL"), version 1.0.
6*508a0e8cSRob Johnston# You may only use this file in accordance with the terms of version
7*508a0e8cSRob Johnston# 1.0 of the CDDL.
8*508a0e8cSRob Johnston#
9*508a0e8cSRob Johnston# A full copy of the text of the CDDL should have accompanied this
10*508a0e8cSRob Johnston# source.  A copy of the CDDL is also available via the Internet at
11*508a0e8cSRob Johnston# http://www.illumos.org/license/CDDL.
12*508a0e8cSRob Johnston#
13*508a0e8cSRob Johnston
14*508a0e8cSRob Johnston#
15*508a0e8cSRob Johnston# Copyright 2019 Joyent, Inc.
16*508a0e8cSRob Johnston#
17*508a0e8cSRob Johnston
18*508a0e8cSRob Johnstongrep ufmtest /etc/name_to_major &> /dev/null
19*508a0e8cSRob Johnstonif [[ $? -eq 1 ]]; then
20*508a0e8cSRob Johnston	printf "ufmtest driver is not currently installed\n"
21*508a0e8cSRob Johnston	exit 0
22*508a0e8cSRob Johnstonfi
23*508a0e8cSRob Johnston
24*508a0e8cSRob Johnstonprintf "Removing ufmtest driver ...\n"
25*508a0e8cSRob Johnston/usr/sbin/rem_drv ufmtest
26*508a0e8cSRob Johnstonif [[ $? -ne 0 ]]; then
27*508a0e8cSRob Johnston	printf "Failed to remove the ufmtest driver.\n" 1>&2
28*508a0e8cSRob Johnston	exit 1
29*508a0e8cSRob Johnstonelse
30*508a0e8cSRob Johnston	exit 0
31*508a0e8cSRob Johnstonfi
32*508a0e8cSRob Johnston
33