From dbda0e2bda5d8ba86f068684941a05387947d993 Mon Sep 17 00:00:00 2001 From: Sibabrata Sahoo Date: Thu, 19 May 2022 06:05:57 +0000 Subject: [PATCH] 8286969: Add a new test library API to execute kinit in SecurityTools.java Reviewed-by: rhalade, weijun --- test/lib/jdk/test/lib/SecurityTools.java | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/test/lib/jdk/test/lib/SecurityTools.java b/test/lib/jdk/test/lib/SecurityTools.java index 41d21e57203..6e3a55f7e5c 100644 --- a/test/lib/jdk/test/lib/SecurityTools.java +++ b/test/lib/jdk/test/lib/SecurityTools.java @@ -225,6 +225,18 @@ public class SecurityTools { return execute(getProcessBuilder("klist", makeList(args))); } + /** + * Runs kinit. + * + * @param args arguments to kinit in a single string. The string is + * converted to be List with makeList. + * @return an {@link OutputAnalyzer} object + * @throws Exception if there is an error + */ + public static OutputAnalyzer kinit(String args) throws Exception { + return execute(getProcessBuilder("kinit", makeList(args))); + } + /** * Runs jar. *