sarvekshayr commented on code in PR #9216:
URL: https://github.com/apache/ozone/pull/9216#discussion_r2480563151
##########
hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/repair/om/TestFSORepairTool.java:
##########
@@ -378,6 +390,40 @@ private int execute(boolean dryRun, String... args) {
.execute(() -> cmd.execute(argList.toArray(new String[0])));
}
+ @Order(2)
+ @Test
+ public void testAlternateOmDbDirNameDryRun() throws Exception {
Review Comment:
We should assert the actual report values to ensure the report is not null,
just verifying the presence of report fields is not enough.
Update the test to:
- change the order
- rename the method
- place it after all dry run tests
- validate the report content instead of only checking for field existence.
```
@Order(ORDER_DRY_RUN)
@Test
public void testAlternateOmDbDirName() throws Exception {
File original = new File(OMStorage.getOmDbDir(cluster.getConf()),
OM_DB_NAME);
// Place backup under a different parent directory to ensure we don't
// accidentally open the original om.db due to path handling bugs.
File backupParent = new File(OMStorage.getOmDbDir(cluster.getConf()),
"copy");
File backup = new File(backupParent, "om-db-backup");
if (backup.exists()) {
FileUtils.deleteDirectory(backup);
}
if (backupParent.exists()) {
FileUtils.deleteDirectory(backupParent);
}
boolean created = backupParent.mkdirs();
if (!created && !backupParent.exists()) {
throw new IOException("Failed to create backup parent directory: " +
backupParent);
}
FileUtils.copyDirectory(original, backup);
out.reset();
String expectedOutput = serializeReport(fullReport);
int exitCode = executeWithDb(true, backup.getPath());
assertEquals(0, exitCode, err.getOutput());
String cliOutput = out.getOutput();
String reportOutput = extractRelevantSection(cliOutput);
assertEquals(expectedOutput, reportOutput);
FileUtils.deleteDirectory(backupParent);
}
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]