xref: /illumos-gate/usr/src/test/os-tests/tests/execvpe/execvpe-script (revision a89c0811c892ec231725fe10817ef95dda813c06)
1*a89c0811SRobert Mustacchi#
2*a89c0811SRobert Mustacchi# This file and its contents are supplied under the terms of the
3*a89c0811SRobert Mustacchi# Common Development and Distribution License ("CDDL"), version 1.0.
4*a89c0811SRobert Mustacchi# You may only use this file in accordance with the terms of version
5*a89c0811SRobert Mustacchi# 1.0 of the CDDL.
6*a89c0811SRobert Mustacchi#
7*a89c0811SRobert Mustacchi# A full copy of the text of the CDDL should have accompanied this
8*a89c0811SRobert Mustacchi# source.  A copy of the CDDL is also available via the Internet at
9*a89c0811SRobert Mustacchi# http://www.illumos.org/license/CDDL.
10*a89c0811SRobert Mustacchi#
11*a89c0811SRobert Mustacchi
12*a89c0811SRobert Mustacchi#
13*a89c0811SRobert Mustacchi# Copyright 2024 Oxide Computer Company
14*a89c0811SRobert Mustacchi#
15*a89c0811SRobert Mustacchi
16*a89c0811SRobert Mustacchi#
17*a89c0811SRobert Mustacchi# This file does not have a #! and that must be kept that way. The point of this
18*a89c0811SRobert Mustacchi# is for testing execvpe() which falls back to treating a file as the standard
19*a89c0811SRobert Mustacchi# in to a shell when the system call fails with ENOEXEC.
20*a89c0811SRobert Mustacchi#
21*a89c0811SRobert Mustacchi
22*a89c0811SRobert Mustacchiif [[ -z "$PATH" ]]; then
23*a89c0811SRobert Mustacchi	printf "environment missing \$PATH!\n"
24*a89c0811SRobert Mustacchi	exit 1
25*a89c0811SRobert Mustacchifi
26*a89c0811SRobert Mustacchi
27*a89c0811SRobert Mustacchiif [[ -z "$EXECVPE_TEST" ]]; then
28*a89c0811SRobert Mustacchi	printf "environment missing \$EXECVPE_TEST!\n"
29*a89c0811SRobert Mustacchi	exit 1
30*a89c0811SRobert Mustacchifi
31*a89c0811SRobert Mustacchi
32*a89c0811SRobert Mustacchiif [[ "$EXECVPE_TEST" != "Keep it secret, keep it safe!" ]]; then
33*a89c0811SRobert Mustacchi	printf "execvpe wrapper did not set the secret phrase!\n"
34*a89c0811SRobert Mustacchi	exit 1
35*a89c0811SRobert Mustacchifi
36*a89c0811SRobert Mustacchi
37*a89c0811SRobert Mustacchiexit 0
38