use of com.yahoo.vespa.hosted.provision.node.NodeAcl in project vespa by vespa-engine.
the class AclProvisioningTest method trusted_nodes_for_unallocated_node.
@Test
public void trusted_nodes_for_unallocated_node() {
List<Node> configServers = setConfigServers("cfg1:1234,cfg2:1234,cfg3:1234");
// Populate repo
tester.makeReadyNodes(10, "default");
List<Node> proxyNodes = tester.makeReadyNodes(3, "default", NodeType.proxy);
// Allocate 2 nodes to an application
allocateNodes(2);
// Get trusted nodes for a ready tenant node
Node node = tester.nodeRepository().getNodes(NodeType.tenant, Node.State.ready).get(0);
List<NodeAcl> nodeAcls = tester.nodeRepository().getNodeAcls(node, false);
List<Node> tenantNodes = tester.nodeRepository().getNodes(NodeType.tenant);
// Trusted nodes are all proxy-, config-, and, tenant-nodes
assertAcls(Arrays.asList(proxyNodes, configServers, tenantNodes), nodeAcls);
}
use of com.yahoo.vespa.hosted.provision.node.NodeAcl in project vespa by vespa-engine.
the class AclProvisioningTest method trusted_nodes_for_docker_host.
@Test
public void trusted_nodes_for_docker_host() {
List<Node> configServers = setConfigServers("cfg1:1234,cfg2:1234,cfg3:1234");
// Populate repo
tester.makeReadyNodes(2, "default", NodeType.host);
// Deploy zone application
ApplicationId zoneApplication = tester.makeApplicationId();
allocateNodes(Capacity.fromRequiredNodeType(NodeType.host), zoneApplication);
List<Node> dockerHostNodes = tester.nodeRepository().getNodes(zoneApplication);
List<NodeAcl> acls = tester.nodeRepository().getNodeAcls(dockerHostNodes.get(0), false);
// Trusted nodes is all Docker hosts and all config servers
assertAcls(Arrays.asList(dockerHostNodes, configServers), dockerBridgeNetwork, acls.get(0));
}
Aggregations