11/*
2- * Copyright (c) 2021, Oracle and/or its affiliates. All rights reserved.
2+ * Copyright (c) 2021, 2025, Oracle and/or its affiliates. All rights reserved.
33 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44 *
55 * This code is free software; you can redistribute it and/or modify it
2727 * @summary SCDynamicStoreConfig works
2828 * @modules java.security.jgss/sun.security.krb5
2929 * @library /test/lib
30- * @run main/manual/native TestDynamicStore
30+ * @run main/manual/native/timeout=180 TestDynamicStore
3131 * @requires (os.family == "mac")
3232 */
3333
3434import jdk .test .lib .Asserts ;
3535import sun .security .krb5 .Config ;
3636
37+ import javax .swing .JOptionPane ;
38+
3739// =================== Attention ===================
3840// This test calls a native method implemented in libTestDynamicStore.m
3941// to modify system-level Kerberos 5 settings stored in the dynamic store.
@@ -56,6 +58,17 @@ static int action(char what, char whom) throws Exception {
5658
5759 public static void main (String [] args ) throws Exception {
5860
61+ // Show a popup to remind to run this test as sudo user
62+ // this will only trigger if sudo (root) user is not detected
63+ if (!"root" .equals (System .getProperty ("user.name" ))) {
64+
65+ JOptionPane .showMessageDialog (null , """
66+ This test MUST be run as ROOT.\s
67+ Please close and RESTART the test.""" );
68+
69+ Asserts .assertFalse (true , "This test must be run as ROOT" );
70+ }
71+
5972 System .loadLibrary ("TestDynamicStore" );
6073
6174 Config cfg = Config .getInstance ();
0 commit comments