1#!/usr/bin/env bash 2# SPDX-License-Identifier: BSD-3-Clause 3# Copyright (C) 2020 Intel Corporation 4# All rights reserved. 5# 6 7testdir=$(readlink -f "$(dirname "$0")") 8rootdir=$(readlink -f "$testdir/../../../") 9source "$rootdir/test/common/autotest_common.sh" 10 11nvmes=("$@") all_nvmes=${#nvmes[@]} 12 13# We need 2 ctrls at minimum 14((all_nvmes >= 2)) 15 16# Let each ctrl to have its CMB copied to the other device. 17while ((--all_nvmes >= 0)); do 18 read_nvme=${nvmes[all_nvmes]} 19 for nvme_idx in "${!nvmes[@]}"; do 20 [[ ${nvmes[nvme_idx]} == "$read_nvme" ]] && continue 21 "$rootdir/build/examples/cmb_copy" \ 22 -r "$read_nvme-1-0-1" \ 23 -w "${nvmes[nvme_idx]}-1-0-1" \ 24 -c "$read_nvme" 25 done 26done 27