|
@@ -126,14 +126,6 @@ public class TestRMAdminService {
|
|
|
throws IOException, YarnException {
|
|
|
configuration.set(YarnConfiguration.RM_CONFIGURATION_PROVIDER_CLASS,
|
|
|
"org.apache.hadoop.yarn.FileSystemBasedConfigurationProvider");
|
|
|
- try {
|
|
|
- rm = new MockRM(configuration);
|
|
|
- rm.init(configuration);
|
|
|
- rm.start();
|
|
|
- fail("Should throw an exception");
|
|
|
- } catch(Exception ex) {
|
|
|
- // Expect exception here
|
|
|
- }
|
|
|
|
|
|
//upload default configurations
|
|
|
uploadDefaultConfiguration();
|
|
@@ -180,14 +172,6 @@ public class TestRMAdminService {
|
|
|
throws IOException, YarnException {
|
|
|
configuration.set(YarnConfiguration.RM_CONFIGURATION_PROVIDER_CLASS,
|
|
|
"org.apache.hadoop.yarn.FileSystemBasedConfigurationProvider");
|
|
|
- try {
|
|
|
- rm = new MockRM(configuration);
|
|
|
- rm.init(configuration);
|
|
|
- rm.start();
|
|
|
- fail("Should throw an exception");
|
|
|
- } catch(Exception ex) {
|
|
|
- // Expect exception here
|
|
|
- }
|
|
|
|
|
|
//upload default configurations
|
|
|
uploadDefaultConfiguration();
|
|
@@ -246,14 +230,6 @@ public class TestRMAdminService {
|
|
|
"org.apache.hadoop.yarn.FileSystemBasedConfigurationProvider");
|
|
|
ResourceManager resourceManager = null;
|
|
|
try {
|
|
|
- try {
|
|
|
- resourceManager = new ResourceManager();
|
|
|
- resourceManager.init(configuration);
|
|
|
- resourceManager.start();
|
|
|
- fail("Should throw an exception");
|
|
|
- } catch (Exception ex) {
|
|
|
- // expect to get an exception here
|
|
|
- }
|
|
|
|
|
|
//upload default configurations
|
|
|
uploadDefaultConfiguration();
|
|
@@ -350,14 +326,6 @@ public class TestRMAdminService {
|
|
|
throws IOException, YarnException {
|
|
|
configuration.set(YarnConfiguration.RM_CONFIGURATION_PROVIDER_CLASS,
|
|
|
"org.apache.hadoop.yarn.FileSystemBasedConfigurationProvider");
|
|
|
- try {
|
|
|
- rm = new MockRM(configuration);
|
|
|
- rm.init(configuration);
|
|
|
- rm.start();
|
|
|
- fail("Should throw an exception");
|
|
|
- } catch(Exception ex) {
|
|
|
- // Expect exception here
|
|
|
- }
|
|
|
|
|
|
//upload default configurations
|
|
|
uploadDefaultConfiguration();
|
|
@@ -408,14 +376,6 @@ public class TestRMAdminService {
|
|
|
throws IOException, YarnException {
|
|
|
configuration.set(YarnConfiguration.RM_CONFIGURATION_PROVIDER_CLASS,
|
|
|
"org.apache.hadoop.yarn.FileSystemBasedConfigurationProvider");
|
|
|
- try {
|
|
|
- rm = new MockRM(configuration);
|
|
|
- rm.init(configuration);
|
|
|
- rm.start();
|
|
|
- fail("Should throw an exception");
|
|
|
- } catch (Exception ex) {
|
|
|
- // Expect exception here
|
|
|
- }
|
|
|
|
|
|
String user = UserGroupInformation.getCurrentUser().getUserName();
|
|
|
List<String> groupWithInit =
|
|
@@ -484,14 +444,6 @@ public class TestRMAdminService {
|
|
|
throws IOException, YarnException {
|
|
|
configuration.set(YarnConfiguration.RM_CONFIGURATION_PROVIDER_CLASS,
|
|
|
"org.apache.hadoop.yarn.FileSystemBasedConfigurationProvider");
|
|
|
- try {
|
|
|
- rm = new MockRM(configuration);
|
|
|
- rm.init(configuration);
|
|
|
- rm.start();
|
|
|
- fail("Should throw an exception");
|
|
|
- } catch (Exception ex) {
|
|
|
- // Expect exception here
|
|
|
- }
|
|
|
|
|
|
// upload default configurations
|
|
|
uploadDefaultConfiguration();
|
|
@@ -617,6 +569,27 @@ public class TestRMAdminService {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ @Test
|
|
|
+ public void testRMStartsWithoutConfigurationFilesProvided() {
|
|
|
+ // enable FileSystemBasedConfigurationProvider without uploading
|
|
|
+ // any configuration files into Remote File System.
|
|
|
+ configuration.set(YarnConfiguration.RM_CONFIGURATION_PROVIDER_CLASS,
|
|
|
+ "org.apache.hadoop.yarn.FileSystemBasedConfigurationProvider");
|
|
|
+
|
|
|
+ // The configurationProvider will return NULL instead of
|
|
|
+ // throwing out Exceptions, if there are no configuration files provided.
|
|
|
+ // RM will not load the remote Configuration files,
|
|
|
+ // and should start successfully.
|
|
|
+ try {
|
|
|
+ rm = new MockRM(configuration);
|
|
|
+ rm.init(configuration);
|
|
|
+ rm.start();
|
|
|
+ } catch (Exception ex) {
|
|
|
+ fail("Should not get any exceptions");
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
private String writeConfigurationXML(Configuration conf, String confXMLName)
|
|
|
throws IOException {
|
|
|
DataOutputStream output = null;
|