Spdk/test/nvme/cmb/cmb_copy.sh
Michal Berger 0b55bf715e test/nvme: Add basic test covering cmb_copy functionality
Change-Id: I083ce9560c37b0f0bd39c9dce3cf97e4038b5e31
Signed-off-by: Michal Berger <michalx.berger@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/2006
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
2021-07-20 07:59:43 +00:00

22 lines
585 B
Bash
Executable File

#!/usr/bin/env bash
testdir=$(readlink -f "$(dirname "$0")")
rootdir=$(readlink -f "$testdir/../../../")
source "$rootdir/test/common/autotest_common.sh"
nvmes=("$@") all_nvmes=${#nvmes[@]}
# We need 2 ctrls at minimum
((all_nvmes >= 2))
# Let each ctrl to have its CMB copied to the other device.
while ((--all_nvmes >= 0)); do
read_nvme=${nvmes[all_nvmes]}
for nvme_idx in "${!nvmes[@]}"; do
[[ ${nvmes[nvme_idx]} == "$read_nvme" ]] && continue
"$rootdir/build/examples/cmb_copy" \
-r "$read_nvme-1-0-1" \
-w "${nvmes[nvme_idx]}-1-0-1" \
-c "$read_nvme"
done
done