-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/316/#review106-----------------------------------------------------------
trunk/src/test/core/org/apache/hadoop/security/TestSecurityUtil.java
<
https://reviews.apache.org/r/316/#comment217>
I think this test case could be improved a few ways:
- Rather than actually rely on forward/reverse DNS for the localhost matching up in the test case, you can do something like:
private InetAddress mockAddr(String reverseTo) {
InetAddress mock = Mockito.mock(InetAddress.class);
doReturn(reverseTo).when(mock).getCanonicalHostName();
return mock;
}
then for the test:
verify("hdfs/_HOST@REALM", mockAddr("foohost"), "hdfs/foohost@REALM");
- another useful test to make sure reverse DNS doesn't happen:
InetAddress mock = Mockito.mock(InetAddress.class);
verify("hdfs/specifiedhost@REALM", mock, "hdfs/specifiedhost@REALM");
Mockito.verify(mock, Mockito.never()).getCanonicalHostName();
This should hopefully make the tests less fussy on hudson boxes where experience shows DNS is often screwy.
- Need to test the newly allowed case for hdfs@REALM instead of hdfs/...@REALM, right?
- Todd
On 2011-01-13 16:02:16, Todd Lipcon wrote:-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/316/-----------------------------------------------------------
(Updated 2011-01-13 16:02:16)
Review request for hadoop-common.
Summary
-------
Patch from HADOOP-7104 (written by Kan)
This addresses bug HADOOP-7104.
https://issues.apache.org/jira/browse/HADOOP-7104Diffs
-----
trunk/src/java/org/apache/hadoop/ipc/Client.java 1058749
trunk/src/java/org/apache/hadoop/ipc/Server.java 1058749
trunk/src/java/org/apache/hadoop/security/SecurityUtil.java 1058749
trunk/src/java/org/apache/hadoop/security/authorize/ServiceAuthorizationManager.java 1058749
trunk/src/test/core/org/apache/hadoop/security/TestSecurityUtil.java 1058749
Diff:
https://reviews.apache.org/r/316/diffTesting
-------
Thanks,
Todd