[LTP] [PATCH v4 03/10] tst_test.sh/tst_brk(): Allow only TBROK and TCONF

Petr Vorel pvorel@suse.cz
Thu Dec 14 16:19:47 CET 2023


C API has compilation check TST_BRK_SUPPORTS_ONLY_TCONF_TBROK()
which allows only TBROK and TCONF. Allow only these in shell API as well.

Signed-off-by: Petr Vorel <pvorel@suse.cz>
---
 testcases/lib/tst_test.sh | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/testcases/lib/tst_test.sh b/testcases/lib/tst_test.sh
index a6a5d82a4..5f178a1be 100644
--- a/testcases/lib/tst_test.sh
+++ b/testcases/lib/tst_test.sh
@@ -134,7 +134,12 @@ tst_brk()
 		return
 	fi
 
-	tst_res "$res" "$@"
+	if [ "$res" != TBROK -a "$res" != TCONF ]; then
+		tst_res TBROK "tst_brk can be called only with TBROK or TCONF"
+	else
+		tst_res "$res" "$@"
+	fi
+
 	_tst_do_exit
 }
 
-- 
2.43.0



More information about the ltp mailing list