Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
dragonwell8_jdk
提交
17f25997
D
dragonwell8_jdk
项目概览
openanolis
/
dragonwell8_jdk
通知
4
Star
2
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
D
dragonwell8_jdk
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
17f25997
编写于
7月 21, 2012
作者:
W
weijun
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
7178649: TEST BUG: BadKdc3.java needs improvement to ignore the unlikely but possible timeout
Reviewed-by: xuelei
上级
493194dd
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
42 addition
and
38 deletion
+42
-38
test/sun/security/krb5/auto/BadKdc.java
test/sun/security/krb5/auto/BadKdc.java
+16
-12
test/sun/security/krb5/auto/BadKdc1.java
test/sun/security/krb5/auto/BadKdc1.java
+8
-8
test/sun/security/krb5/auto/BadKdc2.java
test/sun/security/krb5/auto/BadKdc2.java
+6
-6
test/sun/security/krb5/auto/BadKdc3.java
test/sun/security/krb5/auto/BadKdc3.java
+6
-6
test/sun/security/krb5/auto/BadKdc4.java
test/sun/security/krb5/auto/BadKdc4.java
+6
-6
未找到文件。
test/sun/security/krb5/auto/BadKdc.java
浏览文件 @
17f25997
...
@@ -67,7 +67,7 @@ public class BadKdc {
...
@@ -67,7 +67,7 @@ public class BadKdc {
* This is tough.
* This is tough.
* c. Feed the KDC a UDP packet first. The current "solution".
* c. Feed the KDC a UDP packet first. The current "solution".
*/
*/
public
static
void
go
(
int
[]
...
expected
)
public
static
void
go
(
String
...
expected
)
throws
Exception
{
throws
Exception
{
try
{
try
{
go0
(
expected
);
go0
(
expected
);
...
@@ -83,7 +83,7 @@ public class BadKdc {
...
@@ -83,7 +83,7 @@ public class BadKdc {
}
}
}
}
public
static
void
go0
(
int
[]
...
expected
)
public
static
void
go0
(
String
...
expected
)
throws
Exception
{
throws
Exception
{
System
.
setProperty
(
"sun.security.krb5.debug"
,
"true"
);
System
.
setProperty
(
"sun.security.krb5.debug"
,
"true"
);
...
@@ -148,8 +148,9 @@ public class BadKdc {
...
@@ -148,8 +148,9 @@ public class BadKdc {
return
k
;
return
k
;
}
}
private
static
void
test
(
int
...
expected
)
throws
Exception
{
private
static
void
test
(
String
expected
)
throws
Exception
{
ByteArrayOutputStream
bo
=
new
ByteArrayOutputStream
();
ByteArrayOutputStream
bo
=
new
ByteArrayOutputStream
();
System
.
out
.
println
(
"----------------- TEST -----------------"
);
try
{
try
{
test0
(
bo
,
expected
);
test0
(
bo
,
expected
);
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
...
@@ -164,31 +165,34 @@ public class BadKdc {
...
@@ -164,31 +165,34 @@ public class BadKdc {
* One round of test for max_retries and timeout.
* One round of test for max_retries and timeout.
* @param expected the expected kdc# timeout kdc# timeout...
* @param expected the expected kdc# timeout kdc# timeout...
*/
*/
private
static
void
test0
(
ByteArrayOutputStream
bo
,
int
...
expected
)
private
static
void
test0
(
ByteArrayOutputStream
bo
,
String
expected
)
throws
Exception
{
throws
Exception
{
PrintStream
oldout
=
System
.
out
;
PrintStream
oldout
=
System
.
out
;
boolean
failed
=
false
;
System
.
setOut
(
new
PrintStream
(
bo
));
System
.
setOut
(
new
PrintStream
(
bo
));
try
{
try
{
Context
.
fromUserPass
(
OneKDC
.
USER
,
OneKDC
.
PASS
,
false
);
Context
.
fromUserPass
(
OneKDC
.
USER
,
OneKDC
.
PASS
,
false
);
}
catch
(
Exception
e
)
{
failed
=
true
;
}
finally
{
}
finally
{
System
.
setOut
(
oldout
);
System
.
setOut
(
oldout
);
}
}
String
[]
lines
=
new
String
(
bo
.
toByteArray
()).
split
(
"\n"
);
String
[]
lines
=
new
String
(
bo
.
toByteArray
()).
split
(
"\n"
);
System
.
out
.
println
(
"----------------- TEST -----------------"
);
StringBuilder
sb
=
new
StringBuilder
();
int
count
=
0
;
for
(
String
line:
lines
)
{
for
(
String
line:
lines
)
{
Matcher
m
=
re
.
matcher
(
line
);
Matcher
m
=
re
.
matcher
(
line
);
if
(
m
.
find
())
{
if
(
m
.
find
())
{
System
.
out
.
println
(
line
);
System
.
out
.
println
(
line
);
if
(
Integer
.
parseInt
(
m
.
group
(
1
))
!=
expected
[
count
++]
||
sb
.
append
(
m
.
group
(
1
)).
append
(
m
.
group
(
2
));
Integer
.
parseInt
(
m
.
group
(
2
))
!=
expected
[
count
++])
{
throw
new
Exception
(
"Fail here"
);
}
}
}
}
}
if
(
count
!=
expected
.
length
)
{
if
(
failed
)
sb
.
append
(
'-'
);
throw
new
Exception
(
"Less rounds"
);
String
output
=
sb
.
toString
();
System
.
out
.
println
(
"Expected: "
+
expected
+
", actual "
+
output
);
if
(!
output
.
matches
(
expected
))
{
throw
new
Exception
(
"Does not match"
);
}
}
}
}
}
}
test/sun/security/krb5/auto/BadKdc1.java
浏览文件 @
17f25997
...
@@ -37,16 +37,16 @@ public class BadKdc1 {
...
@@ -37,16 +37,16 @@ public class BadKdc1 {
throws
Exception
{
throws
Exception
{
Security
.
setProperty
(
"krb5.kdc.bad.policy"
,
"tryLess"
);
Security
.
setProperty
(
"krb5.kdc.bad.policy"
,
"tryLess"
);
BadKdc
.
go
(
BadKdc
.
go
(
new
int
[]{
1
,
2
,
1
,
2
,
1
,
2
,
2
,
2
,
2
,
2
,
2
,
2
,
3
,
2
,
1
,
2
,
2
,
2
,
3
,
2
},
// 1,
2
"121212222222(32){1,2}1222(32){1,2}"
,
// 1
2
// The above line means try kdc1 for 2 seconds
,
then kdc1
// The above line means try kdc1 for 2 seconds then kdc1
// for 2 seconds
,...,
finally kdc3 for 2 seconds.
// for 2 seconds
...
finally kdc3 for 2 seconds.
new
int
[]{
1
,
2
,
2
,
2
,
3
,
2
,
1
,
2
,
2
,
2
,
3
,
2
},
// 1,
2
"1222(32){1,2}1222(32){1,2}"
,
// 1
2
// refresh
// refresh
new
int
[]{
1
,
2
,
1
,
2
,
1
,
2
,
2
,
2
,
2
,
2
,
2
,
2
,
3
,
2
,
1
,
2
,
2
,
2
,
3
,
2
},
// 1,
2
"121212222222(32){1,2}1222(32){1,2}"
,
// 1
2
// k3 off
,
k2 on
// k3 off k2 on
new
int
[]{
1
,
2
,
2
,
2
,
1
,
2
,
2
,
2
}
,
// 1
"(122212(22){1,2}|1222323232-)"
,
// 1
// k1 on
// k1 on
new
int
[]{
1
,
2
,
1
,
2
}
// empty
"(12(12){1,2}|122232-)"
// empty
);
);
}
}
}
}
...
...
test/sun/security/krb5/auto/BadKdc2.java
浏览文件 @
17f25997
...
@@ -37,14 +37,14 @@ public class BadKdc2 {
...
@@ -37,14 +37,14 @@ public class BadKdc2 {
throws
Exception
{
throws
Exception
{
Security
.
setProperty
(
"krb5.kdc.bad.policy"
,
"tryLess:2,1000"
);
Security
.
setProperty
(
"krb5.kdc.bad.policy"
,
"tryLess:2,1000"
);
BadKdc
.
go
(
BadKdc
.
go
(
new
int
[]{
1
,
2
,
1
,
2
,
1
,
2
,
2
,
2
,
2
,
2
,
2
,
2
,
3
,
2
,
1
,
1
,
1
,
1
,
2
,
1
,
2
,
1
,
3
,
2
},
// 1,
2
"121212222222(32){1,2}11112121(32){1,2}"
,
// 1
2
new
int
[]{
1
,
1
,
1
,
1
,
2
,
1
,
2
,
1
,
3
,
2
,
1
,
1
,
1
,
1
,
2
,
1
,
2
,
1
,
3
,
2
},
// 1,
2
"11112121(32){1,2}11112121(32){1,2}"
,
// 1
2
// refresh
// refresh
new
int
[]{
1
,
2
,
1
,
2
,
1
,
2
,
2
,
2
,
2
,
2
,
2
,
2
,
3
,
2
,
1
,
1
,
1
,
1
,
2
,
1
,
2
,
1
,
3
,
2
},
// 1,
2
"121212222222(32){1,2}11112121(32){1,2}"
,
// 1
2
// k3 off
,
k2 on
// k3 off k2 on
new
int
[]{
1
,
1
,
1
,
1
,
2
,
1
,
1
,
1
,
1
,
1
,
2
,
2
}
,
// 1
"1111(21){1,2}1111(22){1,2}"
,
// 1
// k1 on
// k1 on
new
int
[]{
1
,
1
,
1
,
2
}
// empty
"(11){1,2}(12){1,2}"
// empty
);
);
}
}
}
}
test/sun/security/krb5/auto/BadKdc3.java
浏览文件 @
17f25997
...
@@ -37,14 +37,14 @@ public class BadKdc3 {
...
@@ -37,14 +37,14 @@ public class BadKdc3 {
throws
Exception
{
throws
Exception
{
Security
.
setProperty
(
"krb5.kdc.bad.policy"
,
"tryLast"
);
Security
.
setProperty
(
"krb5.kdc.bad.policy"
,
"tryLast"
);
BadKdc
.
go
(
BadKdc
.
go
(
new
int
[]{
1
,
2
,
1
,
2
,
1
,
2
,
2
,
2
,
2
,
2
,
2
,
2
,
3
,
2
,
3
,
2
},
// 1,
2
"121212222222(32){2,4}"
,
// 1
2
new
int
[]{
3
,
2
,
3
,
2
},
// 1,
2
"(32){2,4}"
,
// 1
2
// refresh
// refresh
new
int
[]{
1
,
2
,
1
,
2
,
1
,
2
,
2
,
2
,
2
,
2
,
2
,
2
,
3
,
2
,
3
,
2
},
// 1,
2
"121212222222(32){2,4}"
,
// 1
2
// k3 off
,
k2 on
// k3 off k2 on
new
int
[]{
3
,
2
,
3
,
2
,
3
,
2
,
1
,
2
,
1
,
2
,
1
,
2
,
2
,
2
,
2
,
2
},
// 1,
3
"323232121212(22){2,4}"
,
// 1
3
// k1 on
// k1 on
new
int
[]{
2
,
2
,
2
,
2
}
// 1,
3
"(22){2,4}"
// 1
3
);
);
}
}
}
}
test/sun/security/krb5/auto/BadKdc4.java
浏览文件 @
17f25997
...
@@ -37,14 +37,14 @@ public class BadKdc4 {
...
@@ -37,14 +37,14 @@ public class BadKdc4 {
throws
Exception
{
throws
Exception
{
Security
.
setProperty
(
"krb5.kdc.bad.policy"
,
""
);
Security
.
setProperty
(
"krb5.kdc.bad.policy"
,
""
);
BadKdc
.
go
(
BadKdc
.
go
(
new
int
[]{
1
,
2
,
1
,
2
,
1
,
2
,
2
,
2
,
2
,
2
,
2
,
2
,
3
,
2
,
1
,
2
,
1
,
2
,
1
,
2
,
2
,
2
,
2
,
2
,
2
,
2
,
3
,
2
}
,
"121212222222(32){1,2}121212222222(32){1,2}"
,
new
int
[]{
1
,
2
,
1
,
2
,
1
,
2
,
2
,
2
,
2
,
2
,
2
,
2
,
3
,
2
,
1
,
2
,
1
,
2
,
1
,
2
,
2
,
2
,
2
,
2
,
2
,
2
,
3
,
2
}
,
"121212222222(32){1,2}121212222222(32){1,2}"
,
// refresh
// refresh
new
int
[]{
1
,
2
,
1
,
2
,
1
,
2
,
2
,
2
,
2
,
2
,
2
,
2
,
3
,
2
,
1
,
2
,
1
,
2
,
1
,
2
,
2
,
2
,
2
,
2
,
2
,
2
,
3
,
2
}
,
"121212222222(32){1,2}121212222222(32){1,2}"
,
// k3 off
,
k2 on
// k3 off k2 on
new
int
[]{
1
,
2
,
1
,
2
,
1
,
2
,
2
,
2
,
1
,
2
,
1
,
2
,
1
,
2
,
2
,
2
}
,
"121212(22){1,2}121212(22){1,2}"
,
// k1 on
// k1 on
new
int
[]{
1
,
2
,
1
,
2
}
"(12){2,4}"
);
);
}
}
}
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录