test: add bdev_wait_for_examine to static JSON configs

Runtime RPCs such as bdev creation has no chance to wait for
bdev examination to finish. To handle this case commit below
introduced bdev_wait_for_examine RPC, and built it into all newly
saved JSON configurations:
(e57bb1af)lib/bdev: build bdev_wait_for_examine into subsystem

Some tests generate the configuration by hand, rather than
saving it from an existing application.
This patch embeds this RPC into the test configs.

Fixes #1760

Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Change-Id: I79f998d722a2d19aa98b78333c64dbd2c1151444
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/7861
Community-CI: Broadcom CI
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
This commit is contained in:
Tomasz Zawadzki 2021-05-12 07:49:53 -04:00
parent d69b16dac8
commit 1c9125e78e
10 changed files with 49 additions and 5 deletions

View File

@ -142,7 +142,10 @@ jq . <<- JSON > ${conf_file}
"block_size": 512,
"filename": "${tmp_file}"
}
}
},
{
"method": "bdev_wait_for_examine"
}
]
}
]

View File

@ -77,7 +77,10 @@ gen_conf() {
{
"subsystem": "bdev",
"config": [
${config[*]}
${config[*]},
{
"method": "bdev_wait_for_examine"
}
]
}
${extra_subsystems[*]:+,${extra_subsystems[*]}}

View File

@ -143,6 +143,9 @@ function initiator_json_config() {
"url": "iscsi://$TARGET_IP/iqn.2016-06.io.spdk:disk1/0",
"initiator_iqn": "iqn.2016-06.io.spdk:disk1/0"
}
},
{
"method": "bdev_wait_for_examine"
}
]
}

View File

@ -85,7 +85,10 @@ function create_spdk_bdev_conf() {
{
"subsystem": "bdev",
"config": [
${bdev_json_cfg[*]}
${bdev_json_cfg[*]},
{
"method": "bdev_wait_for_examine"
}
]
}
]

View File

@ -573,7 +573,10 @@ function gen_nvmf_target_json() {
$(
IFS=","
printf '%s\n' "${config[*]}"
)
),
{
"method": "bdev_wait_for_examine"
}
]
}
]

View File

@ -68,6 +68,16 @@ for ((d = 0, c = 1; d <= ${#ocf_names[@]} + 2; d += 2, c++)); do
)
done
config+=(
"$(
cat <<- JSON
{
"method": "bdev_wait_for_examine"
}
JSON
)"
)
# First ']}' closes our config and bdev subsystem blocks
cat <<- CONFIG > "$curdir/modes.conf"
{"subsystems":[

View File

@ -50,7 +50,10 @@ gen_malloc_ocf_json () {
{
"subsystem": "bdev",
"config": [
$(IFS=","; printf '%s\n' "${config[*]}")
$(IFS=","; printf '%s\n' "${config[*]}"),
{
"method": "bdev_wait_for_examine"
}
]
}
]

View File

@ -32,6 +32,16 @@ config+=(
)"
)
config+=(
"$(
cat <<- JSON
{
"method": "bdev_wait_for_examine"
}
JSON
)"
)
# First ']}' closes our config and bdev subsystem blocks
jq . <<- CONFIG > "$curdir/config"
{"subsystems":[

View File

@ -31,6 +31,9 @@ jq . <<- JSON > "$curdir/config"
"block_size": 512,
"filename": "./aio1"
}
},
{
"method": "bdev_wait_for_examine"
}
]
}

View File

@ -13,6 +13,9 @@
"name": "VirtioBlk0",
"trtype": "user"
}
},
{
"method": "bdev_wait_for_examine"
}
]
}