Skip to content

Commit 84c2276

Browse files
committed
addendum
1 parent b824fa7 commit 84c2276

File tree

1 file changed

+11
-1
lines changed
  • hadoop-hdfs-project/hadoop-hdfs-rbf/src/test/java/org/apache/hadoop/hdfs/server/federation/router

1 file changed

+11
-1
lines changed

hadoop-hdfs-project/hadoop-hdfs-rbf/src/test/java/org/apache/hadoop/hdfs/server/federation/router/TestRouterAdminCLI.java

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,8 +167,9 @@ public void testAddMountTable() throws Exception {
167167
assertEquals(0, ToolRunner.run(admin, argv));
168168
assertEquals(-1, ToolRunner.run(admin, argv));
169169

170-
171170
stateStore.loadCache(MountTableStoreImpl.class, true);
171+
verifyMountTableContents(src, dest);
172+
172173
GetMountTableEntriesRequest getRequest = GetMountTableEntriesRequest
173174
.newInstance(src);
174175
GetMountTableEntriesResponse getResponse = client.getMountTableManager()
@@ -207,6 +208,15 @@ public void testAddMountTable() throws Exception {
207208
assertTrue(mountTable.isFaultTolerant());
208209
}
209210

211+
private void verifyMountTableContents(String src, String dest) throws Exception {
212+
String[] argv = new String[] {"-ls", "/"};
213+
System.setOut(new PrintStream(out));
214+
assertEquals(0, ToolRunner.run(admin, argv));
215+
String response = out.toString();
216+
assertTrue("The response should have " + src + ": " + response, response.contains(src));
217+
assertTrue("The response should have " + dest + ": " + response, response.contains(dest));
218+
}
219+
210220
@Test
211221
public void testAddMountTableNotNormalized() throws Exception {
212222
String nsId = "ns0";

0 commit comments

Comments
 (0)