test/dd: Add simply copy test between malloc bdevs

Validates basic functionality prior running more complex setup from
bdev_to_bdev.

Signed-off-by: Michal Berger <michalx.berger@intel.com>
Change-Id: I4e10cba6e0284f82e180c4a05288035c61e3fe9f
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9940
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Karol Latecki <karol.latecki@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
This commit is contained in:
Michal Berger 2021-10-20 12:53:56 +02:00 committed by Tomasz Zawadzki
parent 6155dadbf7
commit 0814f8662a
2 changed files with 34 additions and 0 deletions

View File

@ -15,4 +15,5 @@ fi
run_test "spdk_dd_basic_rw" "$testdir/basic_rw.sh" "${nvmes[@]}"
run_test "spdk_dd_posix" "$testdir/posix.sh"
run_test "spdk_dd_malloc" "$testdir/malloc.sh"
run_test "spdk_dd_bdev_to_bdev" "$testdir/bdev_to_bdev.sh" "${nvmes[@]}"

33
test/dd/malloc.sh Executable file
View File

@ -0,0 +1,33 @@
#!/usr/bin/env bash
testdir=$(readlink -f "$(dirname "$0")")
rootdir=$(readlink -f "$testdir/../../")
source "$testdir/common.sh"
malloc_copy() {
local mbdev0=malloc0 mbdev0_b=1048576 mbdev0_bs=512
local mbdev1=malloc1 mbdev1_b=1048576 mbdev1_bs=512
local -A method_bdev_malloc_create_0=(
["name"]=$mbdev0
["num_blocks"]=$mbdev0_b
["block_size"]=$mbdev0_bs
)
local -A method_bdev_malloc_create_1=(
["name"]=$mbdev1
["num_blocks"]=$mbdev1_b
["block_size"]=$mbdev1_bs
)
"${DD_APP[@]}" \
--ib="$mbdev0" \
--ob="$mbdev1" \
--json <(gen_conf)
"${DD_APP[@]}" \
--ib="$mbdev1" \
--ob="$mbdev0" \
--json <(gen_conf)
}
run_test "dd_malloc_copy" malloc_copy