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 2025 Oxide Computer Company 16# 17 18# 19# Run destructive user tests after verification that the device is 20# usable. 21# 22 23# 24# Environment sanitization. 25# 26export LC_ALL=C.UTF-8 27export LD_PRELOAD=libumem.so 28export UMEM_DEBUG=default 29unalias -a 30set -o pipefail 31 32de_arg0=$(basename $0) 33de_root="$(dirname $0)/.." 34de_rundir="$de_root/runfiles" 35de_file="destruct.run" 36de_runfile="$de_rundir/$de_file" 37de_runner="/opt/test-runner/bin/run" 38de_check="$de_root/tests/libnvme/check-destruct.64" 39 40 41if (( $# == 0 )); then 42 fatal "missing required device name" 43fi 44 45export NVME_TEST_DEVICE=$1 46if ! $de_check; then 47 exit 1 48fi 49 50$de_runner -c "$de_runfile" 51