use of com.yahoo.cloud.config.SentinelConfig in project vespa by vespa-engine.
the class AdminTestCase method disableFiledistributorService.
@Test
public void disableFiledistributorService() throws Exception {
String hosts = "<hosts>" + " <host name=\"localhost\">" + " <alias>node0</alias>" + " </host>" + "</hosts>";
String services = "<services>" + " <admin version='2.0'>" + " <adminserver hostalias='node0' />" + " <filedistribution>" + " <disableFiledistributor>true</disableFiledistributor>" + " </filedistribution>" + " </admin>" + "</services>";
VespaModel vespaModel = new VespaModelCreatorWithMockPkg(hosts, services).create();
String localhost = HostName.getLocalhost();
String localhostConfigId = "hosts/" + localhost;
// Verify services in the sentinel config
SentinelConfig.Builder b = new SentinelConfig.Builder();
vespaModel.getConfig(b, localhostConfigId);
SentinelConfig sentinelConfig = new SentinelConfig(b);
assertThat(sentinelConfig.service().size(), is(3));
assertThat(sentinelConfig.service(0).name(), is("logserver"));
assertThat(sentinelConfig.service(1).name(), is("slobrok"));
assertThat(sentinelConfig.service(2).name(), is("logd"));
// No filedistributor service
}
use of com.yahoo.cloud.config.SentinelConfig in project vespa by vespa-engine.
the class AdminTestCase method testTenantAndAppInSentinelConfig.
@Test
public void testTenantAndAppInSentinelConfig() {
DeployState state = new DeployState.Builder().zone(new Zone(Environment.dev, RegionName.from("baz"))).properties(new DeployProperties.Builder().applicationId(new ApplicationId.Builder().tenant("quux").applicationName("foo").instanceName("bim").build()).build()).build(true);
TestRoot root = new TestDriver().buildModel(state);
String localhost = HostName.getLocalhost();
SentinelConfig config = root.getConfig(SentinelConfig.class, "hosts/" + localhost);
assertThat(config.application().tenant(), is("quux"));
assertThat(config.application().name(), is("foo"));
assertThat(config.application().environment(), is("dev"));
assertThat(config.application().region(), is("baz"));
assertThat(config.application().instance(), is("bim"));
}
Aggregations