xref: /illumos-gate/usr/src/test/libproc-tests/tests/syscall/pr_inject.ksh (revision 7655c6d53c36750b508636f48c73a2de57754e5a)
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# This runs the specific tests around the pr_inject tests.
20#
21
22unalias -a
23set -o pipefail
24
25pr_arg0=$(basename $0)
26pr_dir=$(dirname $0)
27pr_inj32="$pr_dir/pr_inject.32"
28pr_inj64="$pr_dir/pr_inject.64"
29pr_targ32="$pr_dir/pr_target.32"
30pr_targ64="$pr_dir/pr_target.64"
31pr_exit=0
32
33printf "Running 32-bit controller against 32-bit target\n"
34if ! $pr_inj32 $pr_targ32; then
35	pr_exit=1
36fi
37
38printf "\nRunning 64-bit controller against 32-bit target\n"
39if ! $pr_inj64 $pr_targ32; then
40	pr_exit=1
41fi
42
43printf "\nRunning 64-bit controller against 64-bit target\n"
44if ! $pr_inj64 $pr_targ64; then
45	pr_exit=1
46fi
47
48
49if (( pr_exit == 0 )); then
50	printf "All variants passed successfully\n"
51fi
52
53exit $pr_exit
54