From e7ef73770265c923c1c940c0904df45d839b113c Mon Sep 17 00:00:00 2001 From: Vitaliy Mysak Date: Tue, 16 Jul 2019 21:16:59 +0000 Subject: [PATCH] test/spdkcli: test vhost_target show_details method Add a match test for vhost_target show_details method. In spdkcli source the equivalent function is `UIVhostTargetObj.show_details`. This method is one of few that left untested in spdkcli. This patch is related to trello task: https://trello.com/c/CHOOxcGj/151-spdkcli-extend-test-coverage Change-Id: I3747b0bef4a54606765c81a003bbc9e12fe32858 Signed-off-by: Vitaliy Mysak Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/463281 Tested-by: SPDK CI Jenkins Reviewed-by: Paul Luse Reviewed-by: Ben Walker Reviewed-by: Jim Harris --- .../spdkcli_details_vhost_target.test.match | 11 +++++++++++ test/spdkcli/vhost.sh | 4 ++++ 2 files changed, 15 insertions(+) create mode 100644 test/spdkcli/match_files/spdkcli_details_vhost_target.test.match diff --git a/test/spdkcli/match_files/spdkcli_details_vhost_target.test.match b/test/spdkcli/match_files/spdkcli_details_vhost_target.test.match new file mode 100644 index 000000000..8a31e49f0 --- /dev/null +++ b/test/spdkcli/match_files/spdkcli_details_vhost_target.test.match @@ -0,0 +1,11 @@ +{ + "id": 0, + "luns": [ + { + "bdev_name": "Malloc2", + "id": 0 + } + ], + "scsi_dev_num": 0, + "target_name": "Target 0" +} diff --git a/test/spdkcli/vhost.sh b/test/spdkcli/vhost.sh index 1f94acdab..4a9749c37 100755 --- a/test/spdkcli/vhost.sh +++ b/test/spdkcli/vhost.sh @@ -77,6 +77,10 @@ $spdkcli_job "'save_config $testdir/config.json' timing_exit spdkcli_save_config timing_enter spdkcli_check_match_details +$rootdir/scripts/spdkcli.py vhost/scsi/vhost_scsi1/Target_0 show_details | jq -r -S '.' > $testdir/match_files/spdkcli_details_vhost_target.test +$rootdir/test/app/match/match $testdir/match_files/spdkcli_details_vhost_target.test.match +rm -f $testdir/match_files/spdkcli_details_vhost_target.test + $rootdir/scripts/spdkcli.py bdevs/split_disk/Nvme0n1p0 show_details | jq -r -S '.' > $testdir/match_files/spdkcli_details_vhost.test $rootdir/test/app/match/match $testdir/match_files/spdkcli_details_vhost.test.match rm -f $testdir/match_files/spdkcli_details_vhost.test