xref: /illumos-gate/usr/src/test/bhyve-tests/cmd/bhyvetest.ksh (revision 71815ce76261aa773c97600750fdce92334d1990)
1#!/usr/bin/ksh
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 2022 Oxide Computer Company
16#
17
18TEST_DIR="/opt/bhyve-tests"
19RUNNER="/opt/test-runner/bin/run"
20
21while getopts c: c; do
22	case $c in
23	'c')
24		RUN_FILE=$OPTARG
25		if [[ ! -f $RUN_FILE ]]; then
26			echo "Cannot read file: $RUN_FILE"
27			exit 1
28		fi
29		;;
30	esac
31done
32shift $((OPTIND - 1))
33
34if [[ -z $RUN_FILE ]]; then
35	RUN_FILE="$TEST_DIR/runfiles/default.run"
36fi
37
38exec $RUNNER -c $RUN_FILE
39