summaryrefslogtreecommitdiffstats
path: root/controller-server/src/test/java/com
diff options
context:
space:
mode:
Diffstat (limited to 'controller-server/src/test/java/com')
-rw-r--r--controller-server/src/test/java/com/yahoo/vespa/hosted/controller/deployment/InternalStepRunnerTest.java25
-rw-r--r--controller-server/src/test/java/com/yahoo/vespa/hosted/controller/integration/ConfigServerMock.java7
2 files changed, 22 insertions, 10 deletions
diff --git a/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/deployment/InternalStepRunnerTest.java b/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/deployment/InternalStepRunnerTest.java
index 2f245ab9736..c5ddc850611 100644
--- a/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/deployment/InternalStepRunnerTest.java
+++ b/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/deployment/InternalStepRunnerTest.java
@@ -510,10 +510,11 @@ public class InternalStepRunnerTest {
assertEquals(unfinished, tester.jobs().run(id).stepStatuses().get(Step.deployTester));
assertEquals(unfinished, tester.jobs().run(id).stepStatuses().get(Step.deployReal));
- List<X509Certificate> oldTrusted = new ArrayList<>(DeploymentContext.publicApplicationPackage().trustedCertificates());
- X509Certificate oldCert = tester.jobs().run(id).testerCertificate().get();
- oldTrusted.add(oldCert);
- assertEquals(oldTrusted, tester.configServer().application(app.instanceId(), id.type().zone()).get().applicationPackage().trustedCertificates());
+ List<X509Certificate> oldApplicationTruststore = new ArrayList<>(DeploymentContext.publicApplicationPackage().trustedCertificates());
+ List<X509Certificate> oldTesterCert = List.of(tester.jobs().run(id).testerCertificate().get());
+
+ assertEquals(oldApplicationTruststore, tester.configServer().application(app.instanceId(), id.type().zone()).get().applicationPackage().trustedCertificates());
+ assertEquals(oldTesterCert, tester.configServer().additionalCertificates(app.deploymentIdIn(id.type().zone())));
tester.configServer().throwOnNextPrepare(null);
tester.clock().advance(Duration.ofSeconds(450));
@@ -521,11 +522,13 @@ public class InternalStepRunnerTest {
assertEquals(succeeded, tester.jobs().run(id).stepStatuses().get(Step.deployTester));
assertEquals(succeeded, tester.jobs().run(id).stepStatuses().get(Step.deployReal));
- List<X509Certificate> newTrusted = new ArrayList<>(DeploymentContext.publicApplicationPackage().trustedCertificates());
- X509Certificate newCert = tester.jobs().run(id).testerCertificate().get();
- newTrusted.add(newCert);
- assertEquals(newTrusted, tester.configServer().application(app.instanceId(), id.type().zone()).get().applicationPackage().trustedCertificates());
- assertNotEquals(oldCert, newCert);
+ List<X509Certificate> newApplicationTruststore = new ArrayList<>(DeploymentContext.publicApplicationPackage().trustedCertificates());
+ List<X509Certificate> newTesterCert = List.of(tester.jobs().run(id).testerCertificate().get());
+ assertEquals(newApplicationTruststore, tester.configServer().application(app.instanceId(), id.type().zone()).get().applicationPackage().trustedCertificates());
+ assertEquals(newTesterCert, tester.configServer().additionalCertificates(app.deploymentIdIn(id.type().zone())));
+
+ assertEquals(oldApplicationTruststore, newApplicationTruststore);
+ assertNotEquals(oldTesterCert, newTesterCert);
}
@Test
@@ -535,7 +538,9 @@ public class InternalStepRunnerTest {
RunId id = app.startSystemTestTests();
List<X509Certificate> trusted = new ArrayList<>(DeploymentContext.publicApplicationPackage().trustedCertificates());
- trusted.add(tester.jobs().run(id).testerCertificate().get());
+ assertEquals(trusted, tester.configServer().application(app.instanceId(), id.type().zone()).get().applicationPackage().trustedCertificates());
+
+ assertEquals(List.of(tester.jobs().run(id).testerCertificate().get()), tester.configServer().additionalCertificates(app.deploymentIdIn(id.type().zone())));
assertEquals(trusted, tester.configServer().application(app.instanceId(), id.type().zone()).get().applicationPackage().trustedCertificates());
tester.clock().advance(InternalStepRunner.Timeouts.of(system()).testerCertificate().plus(Duration.ofSeconds(1)));
diff --git a/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/integration/ConfigServerMock.java b/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/integration/ConfigServerMock.java
index 64d34e55a03..f576c90e195 100644
--- a/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/integration/ConfigServerMock.java
+++ b/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/integration/ConfigServerMock.java
@@ -50,6 +50,7 @@ import java.io.IOException;
import java.io.InputStream;
import java.io.UncheckedIOException;
import java.net.URI;
+import java.security.cert.X509Certificate;
import java.time.Duration;
import java.time.Instant;
import java.util.Collection;
@@ -95,6 +96,7 @@ public class ConfigServerMock extends AbstractComponent implements ConfigServer
private final Map<DeploymentId, List<ClusterMetrics>> clusterMetrics = new HashMap<>();
private final Map<DeploymentId, TestReport> testReport = new HashMap<>();
private final Map<DeploymentId, CloudAccount> cloudAccounts = new HashMap<>();
+ private final Map<DeploymentId, List<X509Certificate>> additionalCertificates = new HashMap<>();
private List<ProtonMetrics> protonMetrics;
private Version lastPrepareVersion = null;
@@ -307,6 +309,10 @@ public class ConfigServerMock extends AbstractComponent implements ConfigServer
deferLoadBalancerProvisioning.addAll(environments);
}
+ public List<X509Certificate> additionalCertificates(DeploymentId deployment) {
+ return additionalCertificates.getOrDefault(deployment, List.of());
+ }
+
@Override
public NodeRepositoryMock nodeRepository() {
return nodeRepository;
@@ -435,6 +441,7 @@ public class ConfigServerMock extends AbstractComponent implements ConfigServer
1))
.toList()));
+ additionalCertificates.put(id, deployment.operatorCertificates());
DeploymentResult result = new DeploymentResult("foo", warnings.getOrDefault(id, List.of()));
return () -> result;
}