HDDS-590. Add unit test for HDDS-583. Contributed by Namit Maheshwari.
This commit is contained in:
parent
c3d22d3b45
commit
03d66b1f5d
|
@ -58,6 +58,7 @@ import org.apache.hadoop.ozone.om.helpers.OmKeyLocationInfo;
|
||||||
import org.apache.hadoop.ozone.protocol.commands.DeleteBlocksCommand;
|
import org.apache.hadoop.ozone.protocol.commands.DeleteBlocksCommand;
|
||||||
import org.apache.hadoop.ozone.protocol.commands.SCMCommand;
|
import org.apache.hadoop.ozone.protocol.commands.SCMCommand;
|
||||||
import org.apache.hadoop.test.GenericTestUtils;
|
import org.apache.hadoop.test.GenericTestUtils;
|
||||||
|
import org.apache.hadoop.util.ExitUtil;
|
||||||
import org.junit.Assert;
|
import org.junit.Assert;
|
||||||
import org.junit.Rule;
|
import org.junit.Rule;
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
|
@ -436,6 +437,18 @@ public class TestStorageContainerManager {
|
||||||
StorageContainerManager.createSCM(null, conf);
|
StorageContainerManager.createSCM(null, conf);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void testSCMInitializationReturnCode() throws IOException {
|
||||||
|
ExitUtil.disableSystemExit();
|
||||||
|
OzoneConfiguration conf = new OzoneConfiguration();
|
||||||
|
conf.setBoolean(OzoneConfigKeys.OZONE_ENABLED, true);
|
||||||
|
// Set invalid args
|
||||||
|
String[] invalidArgs = {"--zxcvbnm"};
|
||||||
|
exception.expect(ExitUtil.ExitException.class);
|
||||||
|
exception.expectMessage("ExitException");
|
||||||
|
StorageContainerManager.createSCM(invalidArgs, conf);
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testScmInfo() throws Exception {
|
public void testScmInfo() throws Exception {
|
||||||
OzoneConfiguration conf = new OzoneConfiguration();
|
OzoneConfiguration conf = new OzoneConfiguration();
|
||||||
|
|
Loading…
Reference in New Issue