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 2019 Joyent, Inc. 16# Copyright 2024 RackTop Systems, Inc. 17# 18 19export LIBSEC_TESTS="/opt/libsec-tests" 20runner="/opt/test-runner/bin/run" 21 22function fail 23{ 24 echo $1 >&2 25 exit ${2:-1} 26} 27 28function find_runfile 29{ 30 typeset distro= 31 if [[ -f $LIBSEC_TESTS/runfiles/default.run ]]; then 32 distro=default 33 fi 34 35 [[ -n $distro ]] && echo $LIBSEC_TESTS/runfiles/$distro.run 36} 37 38while getopts c: c; do 39 case $c in 40 'c') 41 runfile=$OPTARG 42 [[ -f $runfile ]] || fail "Cannot read file: $runfile" 43 ;; 44 esac 45done 46shift $((OPTIND - 1)) 47 48[[ -z $runfile ]] && runfile=$(find_runfile) 49[[ -z $runfile ]] && fail "Couldn't determine distro" 50 51$runner -c $runfile 52 53exit $? 54