Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
dragonwell11
提交
8ae3eff9
D
dragonwell11
项目概览
openanolis
/
dragonwell11
通知
7
Star
2
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
D
dragonwell11
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
8ae3eff9
编写于
3月 12, 2014
作者:
W
weijun
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
8035963: The failed Kerberos tests due to timeouts
Reviewed-by: alanb, xuelei
上级
3a8c8f18
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
46 addition
and
20 deletion
+46
-20
jdk/test/ProblemList.txt
jdk/test/ProblemList.txt
+0
-9
jdk/test/sun/security/krb5/auto/BadKdc.java
jdk/test/sun/security/krb5/auto/BadKdc.java
+26
-3
jdk/test/sun/security/krb5/auto/BadKdc1.java
jdk/test/sun/security/krb5/auto/BadKdc1.java
+9
-2
jdk/test/sun/security/krb5/auto/BadKdc2.java
jdk/test/sun/security/krb5/auto/BadKdc2.java
+6
-1
jdk/test/sun/security/krb5/auto/MaxRetries.java
jdk/test/sun/security/krb5/auto/MaxRetries.java
+4
-4
jdk/test/sun/security/krb5/auto/TcpTimeout.java
jdk/test/sun/security/krb5/auto/TcpTimeout.java
+1
-1
未找到文件。
jdk/test/ProblemList.txt
浏览文件 @
8ae3eff9
...
...
@@ -221,15 +221,6 @@ sun/security/pkcs11/sslecc/ClientJSSEServerJSSE.java solaris-all
java/security/KeyPairGenerator/SolarisShortDSA.java solaris-all
sun/security/tools/keytool/standard.sh solaris-all
# 8000439: NPG: REGRESSION : sun/security/krb5/auto/MaxRetries.java fails with timeout
sun/security/krb5/auto/MaxRetries.java solaris-sparcv9
# 8006690: sun/security/krb5/auto/BadKdc1.java fails intermittently
sun/security/krb5/auto/BadKdc1.java solaris-sparcv9
sun/security/krb5/auto/BadKdc2.java solaris-sparcv9
sun/security/krb5/auto/BadKdc3.java solaris-sparcv9
sun/security/krb5/auto/BadKdc4.java solaris-sparcv9
############################################################################
# jdk_sound
...
...
jdk/test/sun/security/krb5/auto/BadKdc.java
浏览文件 @
8ae3eff9
...
...
@@ -39,7 +39,29 @@ public class BadKdc {
// ^ kdc# ^ timeout
static
final
Pattern
re
=
Pattern
.
compile
(
">>> KDCCommunication: kdc=kdc.rabbit.hole UDP:(\\d)...., "
+
"timeout=(\\d)000,"
);
"timeout=(\\d+),"
);
// Ratio for timeout values of all timeout tests. Not final so that
// each test can choose their own.
static
float
ratio
=
2
f
;
static
void
setRatio
(
float
ratio
)
{
BadKdc
.
ratio
=
ratio
;
}
static
float
getRatio
()
{
return
ratio
;
}
// Gets real timeout value. This method is called when writing krb5.conf
static
int
toReal
(
int
from
)
{
return
(
int
)(
from
*
ratio
+
.
5
);
}
// De-ratio a millisecond value to second
static
int
toSymbolicSec
(
int
from
)
{
return
(
int
)(
from
/
ratio
/
1000
f
+
0.5
);
}
/*
* There are several cases this test fails:
...
...
@@ -101,7 +123,7 @@ public class BadKdc {
fw
.
write
(
"[libdefaults]\n"
+
"default_realm = "
+
OneKDC
.
REALM
+
"\n"
+
"kdc_timeout =
2000
\n"
);
"kdc_timeout =
"
+
toReal
(
2000
)
+
"
\n"
);
fw
.
write
(
"[realms]\n"
+
OneKDC
.
REALM
+
" = {\n"
+
"kdc = "
+
OneKDC
.
KDCHOST
+
":"
+
p1
+
"\n"
+
"kdc = "
+
OneKDC
.
KDCHOST
+
":"
+
p2
+
"\n"
+
...
...
@@ -184,7 +206,8 @@ public class BadKdc {
Matcher
m
=
re
.
matcher
(
line
);
if
(
m
.
find
())
{
System
.
out
.
println
(
line
);
sb
.
append
(
m
.
group
(
1
)).
append
(
m
.
group
(
2
));
sb
.
append
(
m
.
group
(
1
))
.
append
(
toSymbolicSec
(
Integer
.
parseInt
(
m
.
group
(
2
))));
}
}
if
(
failed
)
sb
.
append
(
'-'
);
...
...
jdk/test/sun/security/krb5/auto/BadKdc1.java
浏览文件 @
8ae3eff9
...
...
@@ -28,14 +28,21 @@
* @summary krb5 should not try to access unavailable kdc too often
*/
import
java.io.*
;
import
java.security.Security
;
public
class
BadKdc1
{
public
static
void
main
(
String
[]
args
)
throws
Exception
{
Security
.
setProperty
(
"krb5.kdc.bad.policy"
,
"tryLess"
);
// 5 sec is default timeout for tryLess
if
(
BadKdc
.
getRatio
()
>
2.5
)
{
Security
.
setProperty
(
"krb5.kdc.bad.policy"
,
"tryLess:1,"
+
BadKdc
.
toReal
(
2000
));
}
else
{
Security
.
setProperty
(
"krb5.kdc.bad.policy"
,
"tryLess"
);
}
BadKdc
.
go
(
"121212222222(32){1,2}1222(32){1,2}"
,
// 1 2
// The above line means try kdc1 for 2 seconds then kdc1
...
...
jdk/test/sun/security/krb5/auto/BadKdc2.java
浏览文件 @
8ae3eff9
...
...
@@ -35,7 +35,12 @@ public class BadKdc2 {
public
static
void
main
(
String
[]
args
)
throws
Exception
{
Security
.
setProperty
(
"krb5.kdc.bad.policy"
,
"tryLess:2,1000"
);
// 1 sec is too short.
BadKdc
.
setRatio
(
3.0f
);
Security
.
setProperty
(
"krb5.kdc.bad.policy"
,
"tryLess:2,"
+
BadKdc
.
toReal
(
1000
));
BadKdc
.
go
(
"121212222222(32){1,2}11112121(32){1,2}"
,
// 1 2
"11112121(32){1,2}11112121(32){1,2}"
,
// 1 2
...
...
jdk/test/sun/security/krb5/auto/MaxRetries.java
浏览文件 @
8ae3eff9
...
...
@@ -60,7 +60,7 @@ public class MaxRetries {
test1
(
5000
,
2
);
// 2 2
// For tryLess
Security
.
setProperty
(
"krb5.kdc.bad.policy"
,
"tryless
"
);
Security
.
setProperty
(
"krb5.kdc.bad.policy"
,
"tryless
:1,"
+
BadKdc
.
toReal
(
5000
)
);
rewriteMaxRetries
(
4
);
test1
(
4000
,
7
);
// 1 1 1 1 2 1 2
test1
(
4000
,
4
);
// 1 2 1 2
...
...
@@ -94,7 +94,7 @@ public class MaxRetries {
* @param count the expected total try
*/
private
static
void
test1
(
int
timeout
,
int
count
)
throws
Exception
{
String
timeoutTag
=
"timeout="
+
timeout
;
String
timeoutTag
=
"timeout="
+
BadKdc
.
toReal
(
timeout
)
;
ByteArrayOutputStream
bo
=
new
ByteArrayOutputStream
();
PrintStream
oldout
=
System
.
out
;
System
.
setOut
(
new
PrintStream
(
bo
));
...
...
@@ -192,12 +192,12 @@ public class MaxRetries {
if
(
s
.
startsWith
(
"[realms]"
))
{
// Reconfig global setting
fw
.
write
(
"max_retries = 2\n"
);
fw
.
write
(
"kdc_timeout =
5000
\n"
);
fw
.
write
(
"kdc_timeout =
"
+
BadKdc
.
toReal
(
5000
)
+
"
\n"
);
}
else
if
(
s
.
trim
().
startsWith
(
"kdc = "
))
{
if
(
value
!=
-
1
)
{
// Reconfig for realm
fw
.
write
(
" max_retries = "
+
value
+
"\n"
);
fw
.
write
(
" kdc_timeout = "
+
(
value
*
1000
)
+
"\n"
);
fw
.
write
(
" kdc_timeout = "
+
BadKdc
.
toReal
(
value
*
1000
)
+
"\n"
);
}
// Add a bad KDC as the first candidate
fw
.
write
(
" kdc = localhost:33333\n"
);
...
...
jdk/test/sun/security/krb5/auto/TcpTimeout.java
浏览文件 @
8ae3eff9
...
...
@@ -63,7 +63,7 @@ public class TcpTimeout {
"udp_preference_limit = 1\n"
+
"max_retries = 2\n"
+
"default_realm = "
+
OneKDC
.
REALM
+
"\n"
+
"kdc_timeout =
5000
\n"
);
"kdc_timeout =
"
+
BadKdc
.
toReal
(
5000
)
+
"
\n"
);
fw
.
write
(
"[realms]\n"
+
OneKDC
.
REALM
+
" = {\n"
+
"kdc = "
+
OneKDC
.
KDCHOST
+
":"
+
p1
+
"\n"
+
"kdc = "
+
OneKDC
.
KDCHOST
+
":"
+
p2
+
"\n"
+
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录