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:
parent
d69b16dac8
commit
1c9125e78e
@ -142,7 +142,10 @@ jq . <<- JSON > ${conf_file}
|
|||||||
"block_size": 512,
|
"block_size": 512,
|
||||||
"filename": "${tmp_file}"
|
"filename": "${tmp_file}"
|
||||||
}
|
}
|
||||||
}
|
},
|
||||||
|
{
|
||||||
|
"method": "bdev_wait_for_examine"
|
||||||
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
@ -77,7 +77,10 @@ gen_conf() {
|
|||||||
{
|
{
|
||||||
"subsystem": "bdev",
|
"subsystem": "bdev",
|
||||||
"config": [
|
"config": [
|
||||||
${config[*]}
|
${config[*]},
|
||||||
|
{
|
||||||
|
"method": "bdev_wait_for_examine"
|
||||||
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
${extra_subsystems[*]:+,${extra_subsystems[*]}}
|
${extra_subsystems[*]:+,${extra_subsystems[*]}}
|
||||||
|
@ -143,6 +143,9 @@ function initiator_json_config() {
|
|||||||
"url": "iscsi://$TARGET_IP/iqn.2016-06.io.spdk:disk1/0",
|
"url": "iscsi://$TARGET_IP/iqn.2016-06.io.spdk:disk1/0",
|
||||||
"initiator_iqn": "iqn.2016-06.io.spdk:disk1/0"
|
"initiator_iqn": "iqn.2016-06.io.spdk:disk1/0"
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"method": "bdev_wait_for_examine"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
@ -85,7 +85,10 @@ function create_spdk_bdev_conf() {
|
|||||||
{
|
{
|
||||||
"subsystem": "bdev",
|
"subsystem": "bdev",
|
||||||
"config": [
|
"config": [
|
||||||
${bdev_json_cfg[*]}
|
${bdev_json_cfg[*]},
|
||||||
|
{
|
||||||
|
"method": "bdev_wait_for_examine"
|
||||||
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
@ -573,7 +573,10 @@ function gen_nvmf_target_json() {
|
|||||||
$(
|
$(
|
||||||
IFS=","
|
IFS=","
|
||||||
printf '%s\n' "${config[*]}"
|
printf '%s\n' "${config[*]}"
|
||||||
)
|
),
|
||||||
|
{
|
||||||
|
"method": "bdev_wait_for_examine"
|
||||||
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
@ -68,6 +68,16 @@ for ((d = 0, c = 1; d <= ${#ocf_names[@]} + 2; d += 2, c++)); do
|
|||||||
)
|
)
|
||||||
done
|
done
|
||||||
|
|
||||||
|
config+=(
|
||||||
|
"$(
|
||||||
|
cat <<- JSON
|
||||||
|
{
|
||||||
|
"method": "bdev_wait_for_examine"
|
||||||
|
}
|
||||||
|
JSON
|
||||||
|
)"
|
||||||
|
)
|
||||||
|
|
||||||
# First ']}' closes our config and bdev subsystem blocks
|
# First ']}' closes our config and bdev subsystem blocks
|
||||||
cat <<- CONFIG > "$curdir/modes.conf"
|
cat <<- CONFIG > "$curdir/modes.conf"
|
||||||
{"subsystems":[
|
{"subsystems":[
|
||||||
|
@ -50,7 +50,10 @@ gen_malloc_ocf_json () {
|
|||||||
{
|
{
|
||||||
"subsystem": "bdev",
|
"subsystem": "bdev",
|
||||||
"config": [
|
"config": [
|
||||||
$(IFS=","; printf '%s\n' "${config[*]}")
|
$(IFS=","; printf '%s\n' "${config[*]}"),
|
||||||
|
{
|
||||||
|
"method": "bdev_wait_for_examine"
|
||||||
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
@ -32,6 +32,16 @@ config+=(
|
|||||||
)"
|
)"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
config+=(
|
||||||
|
"$(
|
||||||
|
cat <<- JSON
|
||||||
|
{
|
||||||
|
"method": "bdev_wait_for_examine"
|
||||||
|
}
|
||||||
|
JSON
|
||||||
|
)"
|
||||||
|
)
|
||||||
|
|
||||||
# First ']}' closes our config and bdev subsystem blocks
|
# First ']}' closes our config and bdev subsystem blocks
|
||||||
jq . <<- CONFIG > "$curdir/config"
|
jq . <<- CONFIG > "$curdir/config"
|
||||||
{"subsystems":[
|
{"subsystems":[
|
||||||
|
@ -31,6 +31,9 @@ jq . <<- JSON > "$curdir/config"
|
|||||||
"block_size": 512,
|
"block_size": 512,
|
||||||
"filename": "./aio1"
|
"filename": "./aio1"
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"method": "bdev_wait_for_examine"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
@ -13,6 +13,9 @@
|
|||||||
"name": "VirtioBlk0",
|
"name": "VirtioBlk0",
|
||||||
"trtype": "user"
|
"trtype": "user"
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"method": "bdev_wait_for_examine"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user