Spdk/test/nvme/cuse/nvme_cuse.sh
paul luse eb53c23236 add (c) and SPDX header to bash files as needed
per Intel policy to include file commit date using git cmd
below.  The policy does not apply to non-Intel (C) notices.

git log --follow -C90% --format=%ad --date default <file> | tail -1

and then pull just the year from the result.

Intel copyrights were not added to files where Intel either had
no contribution ot the contribution lacked substance (ie license
header updates, formatting changes, etc)

For intel copyrights added, --follow and -C95% were used.

Signed-off-by: paul luse <paul.e.luse@intel.com>
Change-Id: I2ef86976095b88a9bf5b1003e59f3943cd6bbe4c
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/15209
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Mellanox Build Bot
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Krzysztof Karas <krzysztof.karas@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2022-11-29 08:27:51 +00:00

50 lines
1.2 KiB
Bash
Executable File

#!/usr/bin/env bash
# SPDX-License-Identifier: BSD-3-Clause
# Copyright (C) 2020 Intel Corporation
# All rights reserved.
#
testdir=$(readlink -f $(dirname $0))
rootdir=$(readlink -f $testdir/../../..)
source $rootdir/scripts/common.sh
source $rootdir/test/common/autotest_common.sh
if [[ $(uname) != "Linux" ]]; then
echo "NVMe cuse tests only supported on Linux"
exit 1
fi
modprobe cuse
run_test "nvme_cuse_app" $testdir/cuse
run_test "nvme_cuse_rpc" $testdir/nvme_cuse_rpc.sh
run_test "nvme_cli_cuse" $testdir/spdk_nvme_cli_cuse.sh
run_test "nvme_smartctl_cuse" $testdir/spdk_smartctl_cuse.sh
# Only run Namespace management test case when such device is present
bdfs=$(get_nvme_bdfs)
$rootdir/scripts/setup.sh reset
sleep 1
# Find bdf that supports Namespace management
for bdf in $bdfs; do
nvme_name=$(get_nvme_ctrlr_from_bdf ${bdf})
if [[ -z "$nvme_name" ]]; then
continue
fi
# Check Optional Admin Command Support for Namespace Management
oacs=$(nvme id-ctrl /dev/${nvme_name} | grep oacs | cut -d: -f2)
oacs_ns_manage=$((oacs & 0x8))
if [[ "$oacs_ns_manage" -ne 0 ]]; then
break
fi
done
if [[ "$oacs_ns_manage" -ne 0 ]]; then
run_test "nvme_ns_manage_cuse" $testdir/nvme_ns_manage_cuse.sh
fi
$rootdir/scripts/setup.sh
rmmod cuse