Search in sources :

Example 41 with MockRoot

use of com.yahoo.config.model.test.MockRoot in project vespa by vespa-engine.

the class SearchNodeTest method requireThatPreShutdownCommandIsEmptyWhenNotActivated.

@Test
public void requireThatPreShutdownCommandIsEmptyWhenNotActivated() {
    MockRoot root = new MockRoot("");
    SearchNode node = createSearchNode(root, "mynode", 3, new NodeSpec(7, 5), false);
    node.setHostResource(new HostResource(new Host(node, "mynbode")));
    node.initService();
    assertFalse(node.getPreShutdownCommand().isPresent());
}
Also used : HostResource(com.yahoo.vespa.model.HostResource) MockRoot(com.yahoo.config.model.test.MockRoot) NodeSpec(com.yahoo.vespa.model.search.NodeSpec) Host(com.yahoo.vespa.model.Host) SearchNode(com.yahoo.vespa.model.search.SearchNode) Test(org.junit.Test)

Example 42 with MockRoot

use of com.yahoo.config.model.test.MockRoot in project vespa by vespa-engine.

the class SearchNodeTest method requireThatPreShutdownCommandUsesPrepareRestartWhenActivated.

@Test
public void requireThatPreShutdownCommandUsesPrepareRestartWhenActivated() {
    MockRoot root = new MockRoot("");
    SearchNode node = createSearchNode(root, "mynode2", 4, new NodeSpec(7, 5), true);
    node.setHostResource(new HostResource(new Host(node, "mynbode2")));
    node.initService();
    assertTrue(node.getPreShutdownCommand().isPresent());
    Assert.assertThat(node.getPreShutdownCommand().get(), CoreMatchers.containsString("vespa-proton-cmd " + node.getRpcPort() + " prepareRestart"));
}
Also used : HostResource(com.yahoo.vespa.model.HostResource) MockRoot(com.yahoo.config.model.test.MockRoot) NodeSpec(com.yahoo.vespa.model.search.NodeSpec) Host(com.yahoo.vespa.model.Host) SearchNode(com.yahoo.vespa.model.search.SearchNode) Test(org.junit.Test)

Example 43 with MockRoot

use of com.yahoo.config.model.test.MockRoot in project vespa by vespa-engine.

the class SearchNodeTest method requireThatBasedirIsCorrectForElasticMode.

@Test
public void requireThatBasedirIsCorrectForElasticMode() {
    MockRoot root = new MockRoot("");
    SearchNode node = createSearchNode(root, "mynode", 3, new NodeSpec(7, 5), false);
    prepare(root, node);
    assertBaseDir(Defaults.getDefaults().underVespaHome("var/db/vespa/search/cluster.mycluster/n3"), node);
}
Also used : MockRoot(com.yahoo.config.model.test.MockRoot) NodeSpec(com.yahoo.vespa.model.search.NodeSpec) SearchNode(com.yahoo.vespa.model.search.SearchNode) Test(org.junit.Test)

Aggregations

MockRoot (com.yahoo.config.model.test.MockRoot)43 Test (org.junit.Test)29 ConfigChangeAction (com.yahoo.config.model.api.ConfigChangeAction)7 ContentCluster (com.yahoo.vespa.model.content.cluster.ContentCluster)7 DeployState (com.yahoo.config.model.deploy.DeployState)6 Host (com.yahoo.vespa.model.Host)4 HostResource (com.yahoo.vespa.model.HostResource)4 ApplicationPackage (com.yahoo.config.application.api.ApplicationPackage)3 DeployProperties (com.yahoo.config.model.deploy.DeployProperties)3 MockApplicationPackage (com.yahoo.config.model.test.MockApplicationPackage)3 Zone (com.yahoo.config.provision.Zone)3 NodeSpec (com.yahoo.vespa.model.search.NodeSpec)3 SearchNode (com.yahoo.vespa.model.search.SearchNode)3 Before (org.junit.Before)3 ConfigserverConfig (com.yahoo.cloud.config.ConfigserverConfig)2 DomBuilderTest (com.yahoo.config.model.builder.xml.test.DomBuilderTest)2 NewDocumentType (com.yahoo.documentmodel.NewDocumentType)2 StorServerConfig (com.yahoo.vespa.config.content.core.StorServerConfig)2 ContainerSearch (com.yahoo.vespa.model.container.search.ContainerSearch)2 SearchChains (com.yahoo.vespa.model.container.search.searchchain.SearchChains)2