xref: /spdk/test/external_code/nvme/identify.sh (revision c680e3a05b1a903c18bf3f75b732765607126f45)
1#!/usr/bin/env bash
2#  SPDX-License-Identifier: BSD-3-Clause
3#  Copyright (C) 2021 Intel Corporation
4#  All rights reserved.
5#
6
7testdir=$(readlink -f $(dirname $0))
8rootdir=$testdir/../../..
9
10source $rootdir/test/common/autotest_common.sh
11
12export SPDK_LIB_DIR=$rootdir/build/lib
13export DPDK_LIB_DIR=${SPDK_RUN_EXTERNAL_DPDK:-$rootdir/dpdk/build}/lib
14export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$SPDK_LIB_DIR:$DPDK_LIB_DIR:$testdir
15
16# Make sure all NVMe devices are reported if no address is specified
17identify_data=$($testdir/identify)
18for bdf in $(get_nvme_bdfs); do
19	grep $bdf <<< $identify_data
20done
21
22# Verify that each device can be queried individually too
23for bdf in $(get_nvme_bdfs); do
24	$testdir/identify $bdf
25done
26