From b2caa1f0eb7d0df29e3a538e4af2fb007d38f066 Mon Sep 17 00:00:00 2001 From: Vitaliy Mysak Date: Tue, 16 Jul 2019 20:32:05 +0000 Subject: [PATCH] test/spdkcli: test vhost_ctrl show_details method Add a match test for vhost_ctrl show_details method. In spdkcli source the equivalent function is `UIVhostCtrl.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: I4f13f863bdc815430c5fb2b67b12056f01201f8c Signed-off-by: Vitaliy Mysak Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/462860 Tested-by: SPDK CI Jenkins Reviewed-by: Pawel Kaminski Reviewed-by: Jim Harris Reviewed-by: Ben Walker --- .../spdkcli_details_vhost_ctrl.test.match | 22 +++++++++++++++++++ test/spdkcli/vhost.sh | 4 ++++ 2 files changed, 26 insertions(+) create mode 100644 test/spdkcli/match_files/spdkcli_details_vhost_ctrl.test.match diff --git a/test/spdkcli/match_files/spdkcli_details_vhost_ctrl.test.match b/test/spdkcli/match_files/spdkcli_details_vhost_ctrl.test.match new file mode 100644 index 000000000..7e045fb7d --- /dev/null +++ b/test/spdkcli/match_files/spdkcli_details_vhost_ctrl.test.match @@ -0,0 +1,22 @@ +{ + "backend_specific": { + "scsi": [ + { + "id": 0, + "luns": [ + { + "bdev_name": "Malloc2", + "id": 0 + } + ], + "scsi_dev_num": 0, + "target_name": "Target 0" + } + ] + }, + "cpumask": "0x3", + "ctrlr": "vhost_scsi1", + "delay_base_us": 20, + "iops_threshold": 1000000, + "socket": "$(S)/vhost_scsi1" +} diff --git a/test/spdkcli/vhost.sh b/test/spdkcli/vhost.sh index b4884bdcc..1f94acdab 100755 --- a/test/spdkcli/vhost.sh +++ b/test/spdkcli/vhost.sh @@ -80,6 +80,10 @@ timing_enter spdkcli_check_match_details $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 + +$rootdir/scripts/spdkcli.py vhost/scsi/vhost_scsi1 show_details | jq -r -S '.' > $testdir/match_files/spdkcli_details_vhost_ctrl.test +$rootdir/test/app/match/match $testdir/match_files/spdkcli_details_vhost_ctrl.test.match +rm -f $testdir/match_files/spdkcli_details_vhost_ctrl.test timing_exit spdkcli_check_match_details timing_enter spdkcli_clear_config