public inbox for ltp@lists.linux.it
 help / color / mirror / Atom feed
* [LTP] [PATCH 1/3] commands/keyctl01: Fix potential infinite loop
@ 2017-05-11  6:20 Guangwen Feng
  2017-05-11  6:20 ` [LTP] [PATCH 2/3] commands/keyctl01: Fix getting key serial number Guangwen Feng
                   ` (3 more replies)
  0 siblings, 4 replies; 22+ messages in thread
From: Guangwen Feng @ 2017-05-11  6:20 UTC (permalink / raw)
  To: ltp

End the loop when max key quota is less than or equal to current
key usage, in case some errors happen and result in endless loop.

We expect the test to trigger key quota excess which breaks the
loop but it may not happen, so add a TWARN message for this.

Signed-off-by: Guangwen Feng <fenggw-fnst@cn.fujitsu.com>
---
 testcases/commands/keyctl/keyctl01.sh | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/testcases/commands/keyctl/keyctl01.sh b/testcases/commands/keyctl/keyctl01.sh
index 076a130..5a97499 100644
--- a/testcases/commands/keyctl/keyctl01.sh
+++ b/testcases/commands/keyctl/keyctl01.sh
@@ -62,15 +62,17 @@ cleanup()
 
 do_test()
 {
+	local quota_excd=0
 	local maxkeysz=$((ORIG_KEYSZ + 100))
 
-	while true
+	while [ $maxkeysz -gt $ORIG_KEYSZ ]
 	do
 		echo $maxkeysz >$PATH_KEYQUOTA
 
 		keyctl request2 user debug:fred negate @t >temp 2>&1
 		grep -q -E "quota exceeded" temp
 		if [ $? -eq 0 ]; then
+			quota_excd=1
 			break
 		fi
 
@@ -83,6 +85,10 @@ do_test()
 		((maxkeysz -= 4))
 	done
 
+	if [ $quota_excd -eq 0 ]; then
+		tst_res TWARN "Failed to trigger the quota excess"
+	fi
+
 	tst_res TPASS "Bug not reproduced"
 }
 
-- 
1.8.4.2




^ permalink raw reply related	[flat|nested] 22+ messages in thread

end of thread, other threads:[~2017-08-23 16:23 UTC | newest]

Thread overview: 22+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-05-11  6:20 [LTP] [PATCH 1/3] commands/keyctl01: Fix potential infinite loop Guangwen Feng
2017-05-11  6:20 ` [LTP] [PATCH 2/3] commands/keyctl01: Fix getting key serial number Guangwen Feng
2017-07-07 13:08   ` Cyril Hrubis
2017-07-11 12:27     ` Guangwen Feng
2017-07-13 10:55       ` Guangwen Feng
2017-07-13 12:15         ` Guangwen Feng
2017-07-17 11:42           ` Cyril Hrubis
2017-07-18  6:31             ` [LTP] [PATCH v2 1/3] commands/keyctl01: Fix potential infinite loop Guangwen Feng
2017-07-18  6:31               ` [LTP] [PATCH v2 2/3] commands/keyctl01: Fix getting key serial number Guangwen Feng
2017-07-18  6:31               ` [LTP] [PATCH v2 3/3] commands/keyctl01: Check keyctl support instead of kernel version Guangwen Feng
2017-07-18 13:27                 ` Cyril Hrubis
2017-07-19  3:42                   ` Guangwen Feng
2017-07-20  5:38                     ` [LTP] [PATCH v3] " Guangwen Feng
2017-08-04 12:08                       ` Cyril Hrubis
2017-08-14 11:25                         ` [LTP] [PATCH v4] " Guangwen Feng
2017-08-23 16:23                           ` Cyril Hrubis
2017-05-11  6:20 ` [LTP] [PATCH 3/3] commands/keyctl01: Enable this test for RHEL6 Guangwen Feng
2017-07-07 13:13   ` Cyril Hrubis
2017-07-11 11:47     ` Guangwen Feng
2017-07-04  2:33 ` [LTP] [PATCH 1/3] commands/keyctl01: Fix potential infinite loop Guangwen Feng
2017-07-07 12:55 ` Cyril Hrubis
2017-07-11 11:48   ` Guangwen Feng

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox