xref: /illumos-gate/usr/src/test/os-tests/tests/ddi_ufm/ufm-test-setup.sh (revision c61a1653a4d73dbc950dac7d96350fd6cb517486)
1#!/usr/bin/bash
2
3#
4# This file and its contents are supplied under the terms of the
5# Common Development and Distribution License ("CDDL"), version 1.0.
6# You may only use this file in accordance with the terms of version
7# 1.0 of the CDDL.
8#
9# A full copy of the text of the CDDL should have accompanied this
10# source.  A copy of the CDDL is also available via the Internet at
11# http://www.illumos.org/license/CDDL.
12#
13
14#
15# Copyright 2019 Joyent, Inc.
16#
17
18grep ufmtest /etc/name_to_major &>/dev/null
19if [[ $? -eq 0 ]]; then
20	printf "ufmtest driver is already installed\n"
21	exit 0
22fi
23
24printf "Installing ufmtest driver ... \n"
25/usr/sbin/add_drv -v -f ufmtest
26
27if [[ $? -ne 0 ]]; then
28	printf "%s\n%s\n" "Failed to install the ufmtest driver." \
29	    "Verify that the IPS package system/io/tests is installed." 1>&2
30	exit 1
31else
32	exit 0
33fi
34
35