Search in sources :

Example 6 with ContainerAclSpec

use of com.yahoo.vespa.hosted.node.admin.ContainerAclSpec in project vespa by vespa-engine.

the class AclMaintainerTest method does_not_configure_acl_if_unchanged.

@Test
public void does_not_configure_acl_if_unchanged() {
    Container container = makeContainer("container-1");
    List<ContainerAclSpec> aclSpecs = makeAclSpecs(3, container.name);
    when(nodeRepository.getContainerAclSpecs(NODE_ADMIN_HOSTNAME)).thenReturn(aclSpecs);
    // Run twice
    aclMaintainer.run();
    aclMaintainer.run();
    assertAclsApplied(container.name, aclSpecs, times(1));
}
Also used : Container(com.yahoo.vespa.hosted.dockerapi.Container) ContainerAclSpec(com.yahoo.vespa.hosted.node.admin.ContainerAclSpec) Test(org.junit.Test)

Aggregations

ContainerAclSpec (com.yahoo.vespa.hosted.node.admin.ContainerAclSpec)6 Container (com.yahoo.vespa.hosted.dockerapi.Container)4 Test (org.junit.Test)4 List (java.util.List)2 Objects (java.util.Objects)2 ImmutableList (com.google.common.collect.ImmutableList)1 InetAddresses (com.google.common.net.InetAddresses)1 ContainerName (com.yahoo.vespa.hosted.dockerapi.ContainerName)1 DockerImage (com.yahoo.vespa.hosted.dockerapi.DockerImage)1 ContainerNodeSpec (com.yahoo.vespa.hosted.node.admin.ContainerNodeSpec)1 Environment (com.yahoo.vespa.hosted.node.admin.component.Environment)1 ConfigServerApi (com.yahoo.vespa.hosted.node.admin.configserver.ConfigServerApi)1 HttpException (com.yahoo.vespa.hosted.node.admin.configserver.HttpException)1 SslConfigServerApiImpl (com.yahoo.vespa.hosted.node.admin.configserver.SslConfigServerApiImpl)1 GetAclResponse (com.yahoo.vespa.hosted.node.admin.configserver.noderepository.bindings.GetAclResponse)1 GetNodesResponse (com.yahoo.vespa.hosted.node.admin.configserver.noderepository.bindings.GetNodesResponse)1 NodeMessageResponse (com.yahoo.vespa.hosted.node.admin.configserver.noderepository.bindings.NodeMessageResponse)1 UpdateNodeAttributesRequestBody (com.yahoo.vespa.hosted.node.admin.configserver.noderepository.bindings.UpdateNodeAttributesRequestBody)1 UpdateNodeAttributesResponse (com.yahoo.vespa.hosted.node.admin.configserver.noderepository.bindings.UpdateNodeAttributesResponse)1 Action (com.yahoo.vespa.hosted.node.admin.maintenance.acl.iptables.Action)1