Search in sources :

Example 11 with ConfigserverConfig

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());
}
Also used : ConfigserverConfig(com.yahoo.cloud.config.ConfigserverConfig) File(java.io.File) Test(org.junit.Test)

Example 12 with ConfigserverConfig

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);
}
Also used : ConfigserverConfig(com.yahoo.cloud.config.ConfigserverConfig) ApplicationRepository(com.yahoo.vespa.config.server.ApplicationRepository)

Example 13 with 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));
    }
}
Also used : ConfigserverConfig(com.yahoo.cloud.config.ConfigserverConfig) Test(org.junit.Test)

Example 14 with ConfigserverConfig

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));
}
Also used : ConfigserverConfig(com.yahoo.cloud.config.ConfigserverConfig) Test(org.junit.Test)

Example 15 with ConfigserverConfig

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());
}
Also used : ConfigserverConfig(com.yahoo.cloud.config.ConfigserverConfig) NodeFlavors(com.yahoo.config.provision.NodeFlavors) Zone(com.yahoo.config.provision.Zone) ApplicationId(com.yahoo.config.provision.ApplicationId) FlavorsConfig(com.yahoo.config.provisioning.FlavorsConfig) Test(org.junit.Test)

Aggregations

ConfigserverConfig (com.yahoo.cloud.config.ConfigserverConfig)23 Test (org.junit.Test)16 File (java.io.File)4 RpcServer (com.yahoo.vespa.config.server.rpc.RpcServer)3 Before (org.junit.Before)3 Zone (com.yahoo.config.provision.Zone)2 PermanentApplicationPackage (com.yahoo.vespa.config.server.application.PermanentApplicationPackage)2 DeployTester (com.yahoo.vespa.config.server.deploy.DeployTester)2 FileServer (com.yahoo.vespa.config.server.filedistribution.FileServer)2 HostRegistries (com.yahoo.vespa.config.server.host.HostRegistries)2 SessionHandlerTest (com.yahoo.vespa.config.server.http.SessionHandlerTest)2 VersionState (com.yahoo.vespa.config.server.version.VersionState)2 MockCurator (com.yahoo.vespa.curator.mock.MockCurator)2 JsonNode (com.fasterxml.jackson.databind.JsonNode)1 ComponentRegistry (com.yahoo.component.provider.ComponentRegistry)1 NullConfigModelRegistry (com.yahoo.config.model.NullConfigModelRegistry)1 DeployProperties (com.yahoo.config.model.deploy.DeployProperties)1 DeployState (com.yahoo.config.model.deploy.DeployState)1 MockRoot (com.yahoo.config.model.test.MockRoot)1 ApplicationId (com.yahoo.config.provision.ApplicationId)1