From 10d659a74894f7ab736edc61f23688953ac77930 Mon Sep 17 00:00:00 2001 From: Xiaodong Liu Date: Tue, 4 Jun 2019 03:48:22 -0400 Subject: [PATCH] test/json: cover get_notification_types RPC Change-Id: I703febc5999793c7deb6435648b7d857232bff6f Signed-off-by: Xiaodong Liu Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/456775 Reviewed-by: Darek Stojaczyk Reviewed-by: Ben Walker Tested-by: SPDK CI Jenkins --- test/json_config/json_config.sh | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/test/json_config/json_config.sh b/test/json_config/json_config.sh index 362008ead..77d834d5e 100755 --- a/test/json_config/json_config.sh +++ b/test/json_config/json_config.sh @@ -48,6 +48,25 @@ function initiator_rpc() { RE_UUID="[[:alnum:]-]+" last_event_id=0 +function tgt_check_notification_types() { + timing_enter $FUNCNAME + + local ret=0 + local enabled_types=" + bdev_register + bdev_unregister + " + + get_types=$(tgt_rpc get_notification_types | jq -r '.[]') + if [ "$(echo $enabled_types)" != "$(echo $get_types)" ]; then + echo "ERROR: expected types:" $enabled_types ", but got:" $get_types + ret=1 + fi + + timing_exit $FUNCNAME + return $ret +} + function tgt_check_notifications() { local event_line event ev_type ev_ctx local rc="" @@ -340,6 +359,8 @@ function json_config_test_init() echo ']}' ) | tgt_rpc load_config + tgt_check_notification_types + if [[ $SPDK_TEST_BLOCKDEV -eq 1 ]]; then create_bdev_subsystem_config fi