From 793df6adff9545362d1f828e076a3c51ca2d8336 Mon Sep 17 00:00:00 2001 From: Jim Harris Date: Wed, 14 Feb 2018 15:29:58 -0700 Subject: [PATCH] test/lvol: use vbdev_split to reduce size for testing Some of the lvol tests use NVMe namespaces instead of malloc - use vbdev_split to reduce the size of the bdev on the NVMe namespace which will help speed up the tests. Signed-off-by: Jim Harris Change-Id: I1384ec97badf60a0f5e6aac91a8c47fb6dc93cd5 Reviewed-on: https://review.gerrithub.io/399959 Tested-by: SPDK Automated Test System Reviewed-by: Shuhei Matsumoto Reviewed-by: Daniel Verkamp --- test/lvol/lvol.sh | 4 ++++ test/lvol/test_cases.py | 10 +++++----- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/test/lvol/lvol.sh b/test/lvol/lvol.sh index bc4c7c2c8..cca766adf 100755 --- a/test/lvol/lvol.sh +++ b/test/lvol/lvol.sh @@ -93,6 +93,10 @@ function vhost_start() { modprobe nbd touch $BASE_DIR/vhost.conf + # Use Split to make a bdev using just the first 1/4 + # of the NVMe namespace + echo "[Split]" >> $BASE_DIR/vhost.conf + echo " Split Nvme0n1 4" >> $BASE_DIR/vhost.conf $TEST_DIR/scripts/gen_nvme.sh >> $BASE_DIR/vhost.conf $TEST_DIR/app/vhost/vhost -c $BASE_DIR/vhost.conf & vhost_pid=$! diff --git a/test/lvol/test_cases.py b/test/lvol/test_cases.py index 99a2fcdef..328aab580 100644 --- a/test/lvol/test_cases.py +++ b/test/lvol/test_cases.py @@ -554,7 +554,7 @@ class TestCases(object): def test_case255(self): header(255) base_path = path.dirname(sys.argv[0]) - base_name = "Nvme0n1" + base_name = "Nvme0n1p0" uuid_store = self.c.construct_lvol_store(base_name, self.lvs_name, self.cluster_size) @@ -564,7 +564,7 @@ class TestCases(object): fail_count += 1 traddr = self._find_traddress_for_nvme("Nvme0") if traddr != -1: - self.c.delete_bdev(base_name) + self.c.delete_bdev("Nvme0n1") self.c.construct_nvme_bdev("Nvme0", "PCIe", traddr) # wait 1 second to allow time for lvolstore tasting sleep(1) @@ -942,7 +942,7 @@ class TestCases(object): header(700) fail_count = 0 uuid_bdevs = [] - base_name = "Nvme0n1" + base_name = "Nvme0n1p0" base_path = path.dirname(sys.argv[0]) vhost_path = path.join(self.app_path, 'vhost') @@ -1048,7 +1048,7 @@ class TestCases(object): def test_case701(self): header(701) - base_name = "Nvme0n1" + base_name = "Nvme0n1p0" uuid_store = self.c.construct_lvol_store(base_name, self.lvs_name, self.cluster_size) @@ -1056,7 +1056,7 @@ class TestCases(object): self.cluster_size) traddr = self._find_traddress_for_nvme("Nvme0") if traddr != -1: - self.c.delete_bdev(base_name) + self.c.delete_bdev("Nvme0n1") self.c.construct_nvme_bdev("Nvme0", "PCIe", traddr) # wait 1 second to allow time for lvolstore tasting sleep(1)