1#!/usr/bin/env bash 2# SPDX-License-Identifier: BSD-3-Clause 3# Copyright (C) 2020 Intel Corporation 4# All rights reserved. 5# 6testdir=$(readlink -f $(dirname $0)) 7rootdir=$(readlink -f $testdir/../../..) 8source $rootdir/test/common/autotest_common.sh 9source $rootdir/test/nvmf/common.sh 10 11MALLOC_BDEV_SIZE=64 12MALLOC_BLOCK_SIZE=4096 13 14nvmftestinit 15nvmfappstart -m 0xE 16 17$rpc_py nvmf_create_transport $NVMF_TRANSPORT_OPTS -u 8192 -a 256 18 19# Construct a delay bdev on a malloc bdev which has constant 10ms delay for all read or write I/Os 20$rpc_py bdev_malloc_create $MALLOC_BDEV_SIZE $MALLOC_BLOCK_SIZE -b Malloc0 21$rpc_py bdev_delay_create -b Malloc0 -d Delay0 -r 1000000 -t 1000000 -w 1000000 -n 1000000 22 23# Create an NVMe-oF subsystem and add the delay bdev as a namespace 24$rpc_py nvmf_create_subsystem nqn.2016-06.io.spdk:cnode0 -a -s SPDK0 25$rpc_py nvmf_subsystem_add_ns nqn.2016-06.io.spdk:cnode0 Delay0 26$rpc_py nvmf_subsystem_add_listener nqn.2016-06.io.spdk:cnode0 -t $TEST_TRANSPORT -a $NVMF_FIRST_TARGET_IP -s $NVMF_PORT 27$rpc_py nvmf_subsystem_add_listener discovery -t $TEST_TRANSPORT -a $NVMF_FIRST_TARGET_IP -s $NVMF_PORT 28 29# Run abort application 30$SPDK_EXAMPLE_DIR/abort -r "trtype:$TEST_TRANSPORT adrfam:IPv4 traddr:$NVMF_FIRST_TARGET_IP trsvcid:$NVMF_PORT" \ 31 -c 0x1 -t 1 -l warning -q 128 "${NO_HUGE[@]}" 32 33# Clean up 34$rpc_py nvmf_delete_subsystem nqn.2016-06.io.spdk:cnode0 35 36trap - SIGINT SIGTERM EXIT 37 38nvmftestfini 39