Search in sources :

Example 6 with Host

use of com.yahoo.vespa.model.Host 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)

Aggregations

Host (com.yahoo.vespa.model.Host)6 HostResource (com.yahoo.vespa.model.HostResource)6 MockRoot (com.yahoo.config.model.test.MockRoot)3 ClusterControllerContainer (com.yahoo.vespa.model.admin.clustercontroller.ClusterControllerContainer)2 NodeSpec (com.yahoo.vespa.model.search.NodeSpec)2 SearchNode (com.yahoo.vespa.model.search.SearchNode)2 Test (org.junit.Test)2 SimpleConfigProducer (com.yahoo.vespa.model.SimpleConfigProducer)1 ContentCluster (com.yahoo.vespa.model.content.cluster.ContentCluster)1 TransactionLogServer (com.yahoo.vespa.model.search.TransactionLogServer)1 Matchers.containsString (org.hamcrest.Matchers.containsString)1