HDFS-15862. Make TestViewfsWithNfs3.testNfsRenameSingleNN() idempotent (#2724)
Signed-off-by: Akira Ajisaka <aajisaka@apache.org>
(cherry picked from commit 7ba91c1235
)
This commit is contained in:
parent
53f76b9b1c
commit
1ee661d7da
@ -154,8 +154,6 @@ public static void setup() throws Exception {
|
|||||||
DFSTestUtil.createFile(viewFs, new Path("/hdfs2/write2"), 0, (short) 1, 0);
|
DFSTestUtil.createFile(viewFs, new Path("/hdfs2/write2"), 0, (short) 1, 0);
|
||||||
DFSTestUtil.createFile(viewFs, new Path("/hdfs1/renameMultiNN"),
|
DFSTestUtil.createFile(viewFs, new Path("/hdfs1/renameMultiNN"),
|
||||||
0, (short) 1, 0);
|
0, (short) 1, 0);
|
||||||
DFSTestUtil.createFile(viewFs, new Path("/hdfs1/renameSingleNN"),
|
|
||||||
0, (short) 1, 0);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@AfterClass
|
@AfterClass
|
||||||
@ -307,6 +305,8 @@ public void testNfsRenameMultiNN() throws Exception {
|
|||||||
|
|
||||||
@Test (timeout = 60000)
|
@Test (timeout = 60000)
|
||||||
public void testNfsRenameSingleNN() throws Exception {
|
public void testNfsRenameSingleNN() throws Exception {
|
||||||
|
DFSTestUtil.createFile(viewFs, new Path("/hdfs1/renameSingleNN"),
|
||||||
|
0, (short) 1, 0);
|
||||||
HdfsFileStatus fromFileStatus = nn1.getRpcServer().getFileInfo("/user1");
|
HdfsFileStatus fromFileStatus = nn1.getRpcServer().getFileInfo("/user1");
|
||||||
int fromNNId = Nfs3Utils.getNamenodeId(config, hdfs1.getUri());
|
int fromNNId = Nfs3Utils.getNamenodeId(config, hdfs1.getUri());
|
||||||
FileHandle fromHandle =
|
FileHandle fromHandle =
|
||||||
@ -316,6 +316,8 @@ public void testNfsRenameSingleNN() throws Exception {
|
|||||||
nn1.getRpcServer().getFileInfo("/user1/renameSingleNN");
|
nn1.getRpcServer().getFileInfo("/user1/renameSingleNN");
|
||||||
Assert.assertEquals(statusBeforeRename.isDirectory(), false);
|
Assert.assertEquals(statusBeforeRename.isDirectory(), false);
|
||||||
|
|
||||||
|
Path successFilePath = new Path("/user1/renameSingleNNSucess");
|
||||||
|
hdfs1.delete(successFilePath, false);
|
||||||
testNfsRename(fromHandle, "renameSingleNN",
|
testNfsRename(fromHandle, "renameSingleNN",
|
||||||
fromHandle, "renameSingleNNSucess", Nfs3Status.NFS3_OK);
|
fromHandle, "renameSingleNNSucess", Nfs3Status.NFS3_OK);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user