2020-04-23 18:05:39 +00:00
|
|
|
#!/usr/bin/env bash
|
2022-11-02 15:49:40 +00:00
|
|
|
# SPDX-License-Identifier: BSD-3-Clause
|
|
|
|
# Copyright (C) 2020 Intel Corporation
|
|
|
|
# All rights reserved.
|
|
|
|
#
|
|
|
|
|
2020-04-23 18:05:39 +00:00
|
|
|
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
|