xref: /illumos-gate/usr/src/test/libproc-tests/cmd/libproctest.ksh (revision 1a2d662a91cee3bf82f41cd47c7ae6f3825d9db2)
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 2024 Oxide Computer Company
16#
17
18#
19# Run the libproc test suite
20#
21
22#
23# Standardize the environment and add debugging features.
24#
25export LC_ALL=C.UTF-8
26export LD_PRELOAD=libumem.so
27export UMEM_DEBUG=default
28unalias -a
29set -o pipefail
30
31proc_arg0=$(basename $0)
32proc_rundir="$(dirname $0)/../runfiles"
33proc_file="default.run"
34proc_runfile="$proc_rundir/$proc_file"
35proc_runner="/opt/test-runner/bin/run"
36
37function fatal
38{
39        typeset msg="$*"
40        [[ -z "$msg" ]] && msg="failed"
41        echo "$proc_arg0: $msg" >&2
42        exit 1
43}
44
45
46[[ -f "$proc_runfile" ]] || fatal "could not find runfile $proc_runfile"
47$proc_runner -c "$proc_runfile"
48