HDFS-13251. Avoid using hard coded datanode data dirs in unit tests(addendum). Contributed by Ajay Kumar.
This commit is contained in:
parent
6de135169e
commit
da777a5498
|
@ -159,7 +159,7 @@ public class TestDataNodeVolumeFailureToleration {
|
|||
long dnCapacity = DFSTestUtil.getDatanodeCapacity(dm, 0);
|
||||
|
||||
// Fail a volume on the 2nd DN
|
||||
File dn2Vol1 = cluster.getStorageDir(1, 0);
|
||||
File dn2Vol1 = cluster.getInstanceStorageDir(1, 0);
|
||||
DataNodeTestUtils.injectDataDirFailure(dn2Vol1);
|
||||
|
||||
// Should only get two replicas (the first DN and the 3rd)
|
||||
|
|
|
@ -351,11 +351,11 @@ public class TestDFSAdmin {
|
|||
}
|
||||
File dnDir0 = cluster.getInstanceStorageDir(0, 0);
|
||||
File dnDir1 = cluster.getInstanceStorageDir(0, 1);
|
||||
assertThat(outs.get(offset + 1),
|
||||
is(allOf(containsString("From:"), containsString(dnDir0.getName()),
|
||||
containsString(dnDir1.getName()))));
|
||||
assertThat(outs.get(offset + 2), is(not(
|
||||
anyOf(containsString(dnDir0.getName()),
|
||||
assertThat(outs.get(offset + 1), is(allOf(containsString("From:"),
|
||||
containsString(dnDir0.getName()),
|
||||
containsString(dnDir1.getName()))));
|
||||
assertThat(outs.get(offset + 2),
|
||||
is(not(anyOf(containsString(dnDir0.getName()),
|
||||
containsString(dnDir1.getName())))));
|
||||
assertThat(outs.get(offset + 2),
|
||||
is(allOf(containsString("To"), containsString("data_new"))));
|
||||
|
|
Loading…
Reference in New Issue