Search in sources :

Example 76 with Node

use of com.yahoo.vespa.hosted.provision.Node in project vespa by vespa-engine.

the class RetireIPv4OnlyNodesTest method testMultipleIPv6Address.

@Test
public void testMultipleIPv6Address() {
    Node node = createNodeWithAddresses("::1", "::2", "1234:5678:90ab::cdef");
    assertFalse(policy.shouldRetire(node).isPresent());
}
Also used : Node(com.yahoo.vespa.hosted.provision.Node) Test(org.junit.Test)

Example 77 with Node

use of com.yahoo.vespa.hosted.provision.Node in project vespa by vespa-engine.

the class RetireIPv4OnlyNodesTest method testSingleIPv6Address.

@Test
public void testSingleIPv6Address() {
    Node node = createNodeWithAddresses("::1");
    assertFalse(policy.shouldRetire(node).isPresent());
}
Also used : Node(com.yahoo.vespa.hosted.provision.Node) Test(org.junit.Test)

Example 78 with Node

use of com.yahoo.vespa.hosted.provision.Node in project vespa by vespa-engine.

the class RetireIPv4OnlyNodesTest method testMultipleIPv4Address.

@Test
public void testMultipleIPv4Address() {
    Node node = createNodeWithAddresses("127.0.0.1", "10.0.0.1", "192.168.0.1");
    assertTrue(policy.shouldRetire(node).isPresent());
}
Also used : Node(com.yahoo.vespa.hosted.provision.Node) Test(org.junit.Test)

Example 79 with Node

use of com.yahoo.vespa.hosted.provision.Node in project vespa by vespa-engine.

the class SerializationTest method want_to_deprovision_defaults_to_false.

@Test
public void want_to_deprovision_defaults_to_false() {
    String nodeData = "{\n" + "   \"type\" : \"tenant\",\n" + "   \"flavor\" : \"large\",\n" + "   \"openStackId\" : \"myId\",\n" + "   \"hostname\" : \"myHostname\",\n" + "   \"ipAddresses\" : [\"127.0.0.1\"]\n" + "}";
    Node node = nodeSerializer.fromJson(State.provisioned, Utf8.toBytes(nodeData));
    assertFalse(node.status().wantToDeprovision());
}
Also used : Node(com.yahoo.vespa.hosted.provision.Node) Test(org.junit.Test)

Example 80 with Node

use of com.yahoo.vespa.hosted.provision.Node in project vespa by vespa-engine.

the class SerializationTest method testDefaultType.

@Test
public void testDefaultType() {
    Node node = createNode().allocate(ApplicationId.from(TenantName.from("myTenant"), ApplicationName.from("myApplication"), InstanceName.from("myInstance")), ClusterMembership.from("content/myId/0/0", Vtag.currentVersion), clock.instant());
    Node copy = nodeSerializer.fromJson(Node.State.provisioned, nodeSerializer.toJson(node));
    assertEquals(NodeType.host, copy.type());
}
Also used : Node(com.yahoo.vespa.hosted.provision.Node) Test(org.junit.Test)

Aggregations

Node (com.yahoo.vespa.hosted.provision.Node)121 Test (org.junit.Test)67 ApplicationId (com.yahoo.config.provision.ApplicationId)40 ClusterSpec (com.yahoo.config.provision.ClusterSpec)33 List (java.util.List)26 ArrayList (java.util.ArrayList)23 Zone (com.yahoo.config.provision.Zone)22 Flavor (com.yahoo.config.provision.Flavor)21 HashSet (java.util.HashSet)19 Collectors (java.util.stream.Collectors)19 Optional (java.util.Optional)18 NodeRepository (com.yahoo.vespa.hosted.provision.NodeRepository)16 Duration (java.time.Duration)16 HostSpec (com.yahoo.config.provision.HostSpec)15 NodeType (com.yahoo.config.provision.NodeType)15 Agent (com.yahoo.vespa.hosted.provision.node.Agent)13 Map (java.util.Map)13 HashMap (java.util.HashMap)12 Collections (java.util.Collections)11 Set (java.util.Set)11