HDFS-9159. [OIV] : return value of the command is not correct if invalid value specified in '-p (processor)' option (Contributed by nijel)
This commit is contained in:
parent
3112f26368
commit
61b3547c46
|
@ -1971,6 +1971,9 @@ Release 2.8.0 - UNRELEASED
|
|||
|
||||
HDFS-9196. Fix TestWebHdfsContentLength. (Masatake Iwasaki via jing9)
|
||||
|
||||
HDFS-9159. [OIV] : return value of the command is not correct if invalid
|
||||
value specified in "-p (processor)" option (nijel via vinayakumarb)
|
||||
|
||||
Release 2.7.2 - UNRELEASED
|
||||
|
||||
INCOMPATIBLE CHANGES
|
||||
|
|
|
@ -182,6 +182,10 @@ public class OfflineImageViewerPB {
|
|||
writer.visit(new RandomAccessFile(inputFile, "r"));
|
||||
}
|
||||
break;
|
||||
default:
|
||||
System.err.println("Invalid processor specified : " + processor);
|
||||
printUsage();
|
||||
return -1;
|
||||
}
|
||||
return 0;
|
||||
} catch (EOFException e) {
|
||||
|
|
|
@ -341,6 +341,15 @@ public class TestOfflineImageViewer {
|
|||
new FileSystemTestHelper().getTestRootDir() + "/delimited.db");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testInvalidProcessorOption() throws Exception {
|
||||
int status =
|
||||
OfflineImageViewerPB.run(new String[] { "-i",
|
||||
originalFsimage.getAbsolutePath(), "-o", "-", "-p", "invalid" });
|
||||
assertTrue("Exit code returned for invalid processor option is incorrect",
|
||||
status != 0);
|
||||
}
|
||||
|
||||
private void testPBDelimitedWriter(String db)
|
||||
throws IOException, InterruptedException {
|
||||
final String DELIMITER = "\t";
|
||||
|
|
Loading…
Reference in New Issue