mirror of
https://github.com/openjdk/jdk.git
synced 2025-09-18 18:14:38 +02:00
8268093: Manual Testcase: "sun/security/krb5/config/native/TestDynamicStore.java" Fails with NPE
Reviewed-by: mullan
This commit is contained in:
parent
cce8da2c60
commit
e39346e708
2 changed files with 14 additions and 2 deletions
|
@ -34,6 +34,13 @@
|
|||
import jdk.test.lib.Asserts;
|
||||
import sun.security.krb5.Config;
|
||||
|
||||
// =================== Attention ===================
|
||||
// This test calls a native method implemented in libTestDynamicStore.m
|
||||
// to modify system-level Kerberos 5 settings stored in the dynamic store.
|
||||
// It must be launched by a user with enough privilege or with "sudo".
|
||||
// If launched with sudo, remember to remove the report and working
|
||||
// directories with sudo as well after executing the test.
|
||||
|
||||
public class TestDynamicStore {
|
||||
|
||||
native static int actionInternal(char what, char whom);
|
||||
|
@ -59,7 +66,10 @@ public class TestDynamicStore {
|
|||
|
||||
try {
|
||||
System.out.println("Fill in dynamic store");
|
||||
action('a', 'a');
|
||||
if (action('a', 'a') == 0) {
|
||||
throw new Exception("Cannot write native Kerberos settings. " +
|
||||
"Please make sure the test runs with enough privilege.");
|
||||
}
|
||||
Asserts.assertTrue(Config.getInstance().get("libdefaults", "default_realm").equals("A.COM"));
|
||||
Asserts.assertTrue(Config.getInstance().exists("domain_realm"));
|
||||
|
||||
|
|
|
@ -62,7 +62,9 @@ int addMapping(SCDynamicStoreRef store) {
|
|||
|
||||
int addAll(SCDynamicStoreRef store) {
|
||||
NSArray *keys = [NSArray arrayWithObjects:@"A.COM", @"B.COM", nil];
|
||||
fprintf(stderr, "%d\n", SCDynamicStoreSetValue(store, (CFStringRef) KERBEROS_DEFAULT_REALMS, keys));
|
||||
Boolean b = SCDynamicStoreSetValue(store, (CFStringRef) KERBEROS_DEFAULT_REALMS, keys);
|
||||
fprintf(stderr, "%d\n", b);
|
||||
if (!b) return 0;
|
||||
|
||||
NSDictionary *k1 = [NSDictionary dictionaryWithObjectsAndKeys:
|
||||
@"kdc1.a.com", @"host", nil];
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue