From f0fd8d4b48470de7d81ba8a8b22a01b629f80a03 Mon Sep 17 00:00:00 2001 From: Seth Howell Date: Sun, 7 Jul 2019 21:31:44 -0700 Subject: [PATCH] test/iscsi_tgt: remove drive size dependency As we add more virtual machines for testing, we may want to decrease the average size of emulated NVMe drives to conserve disk space. The current ext4test in iscsi presupposes that the provided NVMe drive is at least 20 GiB. This patch removes this assumption but keeps the cap of 10 GiB per split for the test. Note: the reason for the 10 GiB max is so that large drives don't take an incredibly long time to create the filesystem for very large drives. Change-Id: I4035905de42d07bdcef795f39b0ccf4cb076c31f Signed-off-by: Seth Howell Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/460728 Reviewed-by: Changpeng Liu Reviewed-by: Ben Walker Reviewed-by: Shuhei Matsumoto Reviewed-by: Darek Stojaczyk Tested-by: SPDK CI Jenkins --- test/iscsi_tgt/ext4test/ext4test.sh | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/test/iscsi_tgt/ext4test/ext4test.sh b/test/iscsi_tgt/ext4test/ext4test.sh index 1cc08780c..5a12ccb3e 100755 --- a/test/iscsi_tgt/ext4test/ext4test.sh +++ b/test/iscsi_tgt/ext4test/ext4test.sh @@ -71,7 +71,12 @@ $rpc_py delete_target_node $node_base:Target0 echo "Error injection test done" if [ -z "$NO_NVME" ]; then - $rpc_py construct_split_vbdev Nvme0n1 2 -s 10000 + bdev_size=$(get_bdev_size Nvme0n1) + split_size=$((bdev_size/2)) + if [ $split_size -gt 10000 ]; then + split_size=10000 + fi + $rpc_py construct_split_vbdev Nvme0n1 2 -s $split_size $rpc_py construct_target_node Target1 Target1_alias Nvme0n1p0:0 1:2 64 -d fi