diff mbox series

[RFC,2/2] tests/throtl: add a new test 008

Message ID 20250307080318.3860858-3-yukuai1@huaweicloud.com (mailing list archive)
State New
Headers show
Series tests/throtl: add two regression tests | expand

Commit Message

Yu Kuai March 7, 2025, 8:03 a.m. UTC
From: Yu Kuai <yukuai3@huawei.com>

Test that a high iops limit won't affect bps limit.

Noted this test will fail for now, kernel solution is in development.

Signed-off-by: Yu Kuai <yukuai3@huawei.com>
---
 tests/throtl/008     | 39 +++++++++++++++++++++++++++++++++++++++
 tests/throtl/008.out |  6 ++++++
 2 files changed, 45 insertions(+)
 create mode 100755 tests/throtl/008
 create mode 100644 tests/throtl/008.out
diff mbox series

Patch

diff --git a/tests/throtl/008 b/tests/throtl/008
new file mode 100755
index 0000000..c64f427
--- /dev/null
+++ b/tests/throtl/008
@@ -0,0 +1,39 @@ 
+#!/bin/bash
+# SPDX-License-Identifier: GPL-3.0+
+# Copyright (C) 2024 Yu Kuai
+#
+# Test bps limit with iops limit over io split
+
+. tests/throtl/rc
+
+DESCRIPTION="bps limit with iops limit over io split"
+QUICK=1
+
+test() {
+	echo "Running ${TEST_NAME}"
+
+	if ! _set_up_throtl max_sectors=8; then
+		return 1;
+	fi
+
+	local bps_limit=$((1024 * 1024))
+	local iops_limit=1000000
+
+	# just set bps limit first
+	_throtl_set_limits wbps=$bps_limit
+	_throtl_test_io write 1M 1 &
+	_throtl_test_io write 1M 1 &
+	wait
+	_throtl_remove_limits
+
+	# set the same bps limit and a high iops limit
+	# should behave the same as no iops limit
+	_throtl_set_limits wbps=$bps_limit wiops=$iops_limit
+	_throtl_test_io write 1M 1 &
+	_throtl_test_io write 1M 1 &
+	wait
+	_throtl_remove_limits
+
+	_clean_up_throtl
+	echo "Test complete"
+}
diff --git a/tests/throtl/008.out b/tests/throtl/008.out
new file mode 100644
index 0000000..72f4db1
--- /dev/null
+++ b/tests/throtl/008.out
@@ -0,0 +1,6 @@ 
+Running throtl/008
+1
+2
+1
+2
+Test complete