diff options
author | andreer <andreer@verizonmedia.com> | 2019-08-12 14:26:34 +0200 |
---|---|---|
committer | andreer <andreer@verizonmedia.com> | 2019-08-12 14:26:34 +0200 |
commit | f852e52107490b3e966770393150193ac6b0cf02 (patch) | |
tree | 462cb49329a4f5bf82256615f613fc169df99a81 /controller-server | |
parent | ce655c3e9c3260ef67cbdd2f765c63ac5fb43498 (diff) |
expose bug in unit test
Diffstat (limited to 'controller-server')
-rw-r--r-- | controller-server/src/test/java/com/yahoo/vespa/hosted/controller/ControllerTest.java | 31 |
1 files changed, 21 insertions, 10 deletions
diff --git a/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/ControllerTest.java b/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/ControllerTest.java index 17ba19d8f7d..fa32dcba767 100644 --- a/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/ControllerTest.java +++ b/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/ControllerTest.java @@ -1,6 +1,7 @@ // Copyright 2018 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. package com.yahoo.vespa.hosted.controller; +import com.google.common.collect.Sets; import com.yahoo.component.Version; import com.yahoo.config.application.api.DeploymentSpec; import com.yahoo.config.application.api.ValidationId; @@ -358,6 +359,7 @@ public class ControllerTest { .endpoint("foobar", "qrs", "us-west-1", "us-central-1") .endpoint("default", "qrs", "us-west-1", "us-central-1") .endpoint("all", "qrs") + .endpoint("west", "qrs", "us-west-1") .region("us-west-1") .region("us-central-1") .build(); @@ -366,25 +368,29 @@ public class ControllerTest { Collection<Deployment> deployments = tester.application(application.id()).deployments().values(); assertFalse(deployments.isEmpty()); for (Deployment deployment : deployments) { + var notWest = Set.of( + "rotation-id-01", + "rotation-id-02", + "rotation-id-03", + "app1--tenant1.global.vespa.oath.cloud", + "foobar--app1--tenant1.global.vespa.oath.cloud", + "all--app1--tenant1.global.vespa.oath.cloud" + ); + + var west = Sets.union(notWest, Set.of("rotation-id-04", "west--app1--tenant1.global.vespa.oath.cloud")); + assertEquals("Rotation names are passed to config server in " + deployment.zone(), - Set.of( - "rotation-id-01", - "rotation-id-02", - "rotation-id-03", - "app1--tenant1.global.vespa.oath.cloud", - "foobar--app1--tenant1.global.vespa.oath.cloud", - "all--app1--tenant1.global.vespa.oath.cloud" - ), + ZoneId.from("prod.us-west-1").equals(deployment.zone()) ? west : notWest, tester.configServer().rotationNames().get(new DeploymentId(application.id(), deployment.zone()))); } tester.flushDnsRequests(); - assertEquals(3, tester.controllerTester().nameService().records().size()); + assertEquals(4, tester.controllerTester().nameService().records().size()); var record1 = tester.controllerTester().findCname("app1--tenant1.global.vespa.oath.cloud"); assertTrue(record1.isPresent()); assertEquals("app1--tenant1.global.vespa.oath.cloud", record1.get().name().asString()); - assertEquals("rotation-fqdn-03.", record1.get().data().asString()); + assertEquals("rotation-fqdn-04.", record1.get().data().asString()); var record2 = tester.controllerTester().findCname("foobar--app1--tenant1.global.vespa.oath.cloud"); assertTrue(record2.isPresent()); @@ -395,6 +401,11 @@ public class ControllerTest { assertTrue(record3.isPresent()); assertEquals("all--app1--tenant1.global.vespa.oath.cloud", record3.get().name().asString()); assertEquals("rotation-fqdn-02.", record3.get().data().asString()); + + var record4 = tester.controllerTester().findCname("west--app1--tenant1.global.vespa.oath.cloud"); + assertTrue(record4.isPresent()); + assertEquals("west--app1--tenant1.global.vespa.oath.cloud", record4.get().name().asString()); + assertEquals("rotation-fqdn-03.", record4.get().data().asString()); } @Test |