use of com.yahoo.cloud.config.ConfigserverConfig in project vespa by vespa-engine.
the class PermanentApplicationPackageTest method testExistingApplication.
@Test
public void testExistingApplication() throws IOException {
File tmpDir = folder.newFolder();
PermanentApplicationPackage permanentApplicationPackage = new PermanentApplicationPackage(new ConfigserverConfig(new ConfigserverConfig.Builder().applicationDirectory(tmpDir.getAbsolutePath())));
assertTrue(permanentApplicationPackage.applicationPackage().isPresent());
}
use of com.yahoo.cloud.config.ConfigserverConfig in project vespa by vespa-engine.
the class SessionCreateHandlerTest method createHandler.
private SessionCreateHandler createHandler(Tenants tenants) throws Exception {
TestTenantBuilder testTenantBuilder = new TestTenantBuilder();
final ConfigserverConfig configserverConfig = new ConfigserverConfig(new ConfigserverConfig.Builder());
return new SessionCreateHandler(SessionCreateHandler.testOnlyContext(), new ApplicationRepository(testTenantBuilder.createTenants(), new SessionHandlerTest.MockProvisioner(), Clock.systemUTC()), tenants, configserverConfig);
}
use of com.yahoo.cloud.config.ConfigserverConfig in project vespa by vespa-engine.
the class CuratorTest method require_that_server_count_is_correct.
@Test
public void require_that_server_count_is_correct() {
ConfigserverConfig.Builder builder = new ConfigserverConfig.Builder();
builder.zookeeperserver(createZKBuilder(localhost, port1));
try (Curator curator = createCurator(new ConfigserverConfig(builder))) {
assertThat(curator.zooKeeperEnsembleCount(), is(1));
}
}
use of com.yahoo.cloud.config.ConfigserverConfig in project vespa by vespa-engine.
the class CuratorTest method localhost_affinity.
@Test
public void localhost_affinity() {
String localhostHostName = "myhost";
int localhostPort = 123;
ConfigserverConfig.Builder builder = new ConfigserverConfig.Builder();
builder.zookeeperserver(createZKBuilder(localhostHostName, localhostPort));
builder.zookeeperserver(createZKBuilder("otherhost", 345));
ConfigserverConfig config = new ConfigserverConfig(builder);
HostName.setHostNameForTestingOnly(localhostHostName);
String localhostSpec = localhostHostName + ":" + localhostPort;
assertThat(Curator.createConnectionSpecForLocalhost(config), is(localhostSpec));
}
use of com.yahoo.cloud.config.ConfigserverConfig in project vespa by vespa-engine.
the class ProvisioningTest method application_deployment_multiple_flavors_default_per_type.
@Test
public void application_deployment_multiple_flavors_default_per_type() {
ConfigserverConfig.Builder config = new ConfigserverConfig.Builder();
config.environment("prod");
config.region("us-east");
config.defaultFlavor("not-used");
config.defaultContainerFlavor("small");
config.defaultContentFlavor("large");
ProvisioningTester tester = new ProvisioningTester(new Zone(new ConfigserverConfig(config), new NodeFlavors(new FlavorsConfig(new FlavorsConfig.Builder()))));
ApplicationId application1 = tester.makeApplicationId();
tester.makeReadyNodes(10, "small");
tester.makeReadyNodes(9, "large");
// deploy
SystemState state1 = prepare(application1, 2, 3, 4, 5, null, tester);
tester.activate(application1, state1.allHosts);
assertEquals("'small' nodes are used for containers", 2 + 3, tester.getNodes(application1, Node.State.active).flavor("small").size());
assertEquals("'large' nodes are used for content", 4 + 5, tester.getNodes(application1, Node.State.active).flavor("large").size());
}
Aggregations