diff mbox series

[v2,blktests,2/5] tests/throtl: add a new test 002

Message ID 20240417022005.1410525-3-yukuai1@huaweicloud.com (mailing list archive)
State New, archived
Headers show
Series add new tests for blk-throttle | expand

Commit Message

Yu Kuai April 17, 2024, 2:20 a.m. UTC
From: Yu Kuai <yukuai3@huawei.com>

Test iops limit over IO split, regression tests for:

commit 9f5ede3c01f9 ("block: throttle split bio in case of iops limit")

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

Patch

diff --git a/tests/throtl/002 b/tests/throtl/002
new file mode 100755
index 0000000..83cd27f
--- /dev/null
+++ b/tests/throtl/002
@@ -0,0 +1,30 @@ 
+#!/bin/bash
+# SPDX-License-Identifier: GPL-3.0+
+# Copyright (C) 2024 Yu Kuai
+#
+# Test iops limit work correctly for big IO of blk-throttle, regression test
+# for commit 9f5ede3c01f9 ("block: throttle split bio in case of iops limit")
+
+. tests/throtl/rc
+
+DESCRIPTION="iops limit over IO split"
+QUICK=1
+
+test() {
+	echo "Running ${TEST_NAME}"
+
+	if ! _set_up_test max_sectors=8; then
+		return 1;
+	fi
+
+	_set_limits wiops=256
+	_test_io write 1M 1
+	_remove_limits
+
+	_set_limits riops=256
+	_test_io read 1M 1
+	_remove_limits
+
+	_clean_up_test
+	echo "Test complete"
+}
diff --git a/tests/throtl/002.out b/tests/throtl/002.out
new file mode 100644
index 0000000..7e1ae85
--- /dev/null
+++ b/tests/throtl/002.out
@@ -0,0 +1,4 @@ 
+Running throtl/002
+1
+1
+Test complete