xref: /spdk/test/spdkcli/raid.sh (revision 6f3127adb16b8e7da31046b4f5e720b96d542b9a)
1#!/usr/bin/env bash
2#  SPDX-License-Identifier: BSD-3-Clause
3#  Copyright (C) 2019 Intel Corporation
4#  All rights reserved.
5#
6testdir=$(readlink -f $(dirname $0))
7rootdir=$(readlink -f $testdir/../..)
8source $rootdir/test/common/autotest_common.sh
9source $rootdir/test/spdkcli/common.sh
10source $rootdir/test/iscsi_tgt/common.sh
11
12MATCH_FILE="spdkcli_raid.test"
13SPDKCLI_BRANCH="/bdevs"
14testdir=$(readlink -f $(dirname $0))
15. $testdir/common.sh
16
17trap 'cleanup' EXIT
18
19timing_enter run_spdk_tgt
20run_spdk_tgt
21timing_exit run_spdk_tgt
22
23timing_enter spdkcli_create_malloc
24$spdkcli_job "'/bdevs/malloc create 8 512 Malloc1' 'Malloc1' True
25'/bdevs/malloc create 8 512 Malloc2' 'Malloc2' True
26"
27timing_exit spdkcli_create_malloc
28
29timing_enter spdkcli_create_raid
30$spdkcli_job "'/bdevs/raid_volume create testraid 0 \"Malloc1 Malloc2\" 4' 'testraid' True
31"
32timing_exit spdkcli_create_raid
33
34timing_enter spdkcli_check_match
35check_match
36timing_exit spdkcli_check_match
37
38timing_enter spdkcli_delete_raid
39$spdkcli_job "'/bdevs/raid_volume delete testraid' '' True
40"
41timing_exit spdkcli_delete_raid
42
43timing_enter spdkcli_delete_malloc
44$spdkcli_job "'/bdevs/malloc delete Malloc1' '' True
45'/bdevs/malloc delete Malloc2' '' True
46"
47timing_exit spdkcli_delete_malloc
48
49killprocess $spdk_tgt_pid
50