From 3effc335ebddd15ad18a9277750ba35fa1ac01ae Mon Sep 17 00:00:00 2001 From: Pawel Kaminski Date: Thu, 23 Nov 2017 20:47:17 +0100 Subject: [PATCH] test/lvol: Check if lvol store exists after vhost reboot Change-Id: I65c25842b9e965ea0816f9dfc8ef62b820da001e Signed-off-by: Pawel Kaminski Reviewed-on: https://review.gerrithub.io/388813 Tested-by: SPDK Automated Test System Reviewed-by: Karol Latecki Reviewed-by: Jim Harris --- autotest.sh | 2 +- test/lvol/test_cases.py | 27 +++++++++++++++++++++++++++ test/lvol/test_plan.md | 14 ++++++++++++++ 3 files changed, 42 insertions(+), 1 deletion(-) diff --git a/autotest.sh b/autotest.sh index bafb63ec4..c31cbd0f7 100755 --- a/autotest.sh +++ b/autotest.sh @@ -155,7 +155,7 @@ fi if [ $SPDK_TEST_LVOL -eq 1 ]; then timing_enter lvol test_cases="1,50,51,52,53,100,101,102,250,251,252,253,255," - test_cases+="300,301,450,451,452,550,600,601,650,700" + test_cases+="300,301,450,451,452,550,600,601,650,651,700" run_test ./test/lvol/lvol.sh --test-cases=$test_cases timing_exit lvol fi diff --git a/test/lvol/test_cases.py b/test/lvol/test_cases.py index adb2c8fc0..c184a890c 100644 --- a/test/lvol/test_cases.py +++ b/test/lvol/test_cases.py @@ -52,6 +52,7 @@ def header(num): 600: 'construct_lvol_store_with_cluster_size_max', 601: 'construct_lvol_store_with_cluster_size_min', 650: 'tasting_positive', + 651: 'tasting_lvol_store_positive', 700: 'SIGTERM', } print("========================================================") @@ -770,6 +771,32 @@ class TestCases(object): footer(650) return fail_count + def test_case651(self): + header(651) + base_path = path.dirname(sys.argv[0]) + vhost_path = path.join(self.app_path, 'vhost') + config_path = path.join(base_path, 'vhost.conf') + pid_path = path.join(base_path, 'vhost.pid') + base_name = "Nvme0n1" + uuid_store = self.c.construct_lvol_store(base_name, + self.lvs_name, + self.cluster_size) + fail_count = self.c.check_get_lvol_stores(base_name, uuid_store, + self.cluster_size) + fail_count += self._stop_vhost(pid_path) + remove(pid_path) + if self._start_vhost(vhost_path, config_path, pid_path) != 0: + fail_count += 1 + footer(651) + return fail_count + if self.c.check_get_lvol_stores(base_name, uuid_store, + self.cluster_size) != 0: + fail_count += 1 + if self.c.destroy_lvol_store(uuid_store) != 0: + fail_count += 1 + footer(651) + return fail_count + def test_case700(self): header(700) pid_path = path.join(self.path, 'vhost.pid') diff --git a/test/lvol/test_plan.md b/test/lvol/test_plan.md index 6c0814314..7325bd469 100644 --- a/test/lvol/test_plan.md +++ b/test/lvol/test_plan.md @@ -590,6 +590,20 @@ Expected results: - all RPC configuration calls successful, return code = 0 - no other operation fails +#### TEST CASE 651 - Name: tasting_lvol_store_positive +Positive test for tasting lvol store. +Steps: +- run vhost app with NVMe bdev +- construct lvol store on NVMe bdev +- stop vhost +- start vhost +- check if lvol store still exists in vhost configuration +- destroy lvol store from NVMe bdev + +Expected result: +- calls successful (lvol store should be tasted correctly), return code = 0 +- no other operation fails + ### SIGTERM #### TEST CASE 700 - Name: SIGTERM