aboutsummaryrefslogtreecommitdiffstats
path: root/vespa-osgi-testrunner/src/main/java/com/yahoo/vespa/testrunner/VespaCliTestRunner.java
diff options
context:
space:
mode:
Diffstat (limited to 'vespa-osgi-testrunner/src/main/java/com/yahoo/vespa/testrunner/VespaCliTestRunner.java')
-rw-r--r--vespa-osgi-testrunner/src/main/java/com/yahoo/vespa/testrunner/VespaCliTestRunner.java25
1 files changed, 15 insertions, 10 deletions
diff --git a/vespa-osgi-testrunner/src/main/java/com/yahoo/vespa/testrunner/VespaCliTestRunner.java b/vespa-osgi-testrunner/src/main/java/com/yahoo/vespa/testrunner/VespaCliTestRunner.java
index 274fa91a59c..9bb0e7ff955 100644
--- a/vespa-osgi-testrunner/src/main/java/com/yahoo/vespa/testrunner/VespaCliTestRunner.java
+++ b/vespa-osgi-testrunner/src/main/java/com/yahoo/vespa/testrunner/VespaCliTestRunner.java
@@ -6,6 +6,7 @@ import com.yahoo.component.annotation.Inject;
import com.yahoo.slime.Cursor;
import com.yahoo.slime.Slime;
import com.yahoo.slime.SlimeUtils;
+import com.yahoo.vespa.defaults.Defaults;
import java.io.BufferedReader;
import java.io.IOException;
@@ -116,7 +117,7 @@ public class VespaCliTestRunner implements TestRunner {
ProcessBuilder builder = new ProcessBuilder("vespa", "test", suitePath.get().toAbsolutePath().toString(),
"--application", config.application().toFullString(),
"--zone", config.zone().value(),
- "--target", "cloud");
+ "--target", config.system().isPublic() ? "cloud" : "hosted");
builder.redirectErrorStream(true);
// The CI environment variables tells Vespa CLI to omit certain warnings that do not apply to CI environments
builder.environment().put("CI", "true");
@@ -124,19 +125,23 @@ public class VespaCliTestRunner implements TestRunner {
builder.environment().put("VESPA_CLI_HOME", ensureDirectoryForVespaCli("cli-home").toString());
builder.environment().put("VESPA_CLI_CACHE_DIR", ensureDirectoryForVespaCli("cli-cache").toString());
builder.environment().put("VESPA_CLI_ENDPOINTS", toEndpointsConfig(config));
- builder.environment().put("VESPA_CLI_DATA_PLANE_KEY_FILE", artifactsPath.resolve("key").toAbsolutePath().toString());
- builder.environment().put("VESPA_CLI_DATA_PLANE_CERT_FILE", artifactsPath.resolve("cert").toAbsolutePath().toString());
+ Path certRoot = certificateRoot(config);
+ builder.environment().put("VESPA_CLI_DATA_PLANE_KEY_FILE", certRoot.resolve("key").toAbsolutePath().toString());
+ builder.environment().put("VESPA_CLI_DATA_PLANE_CERT_FILE", certRoot.resolve("cert").toAbsolutePath().toString());
return builder;
}
+ private Path certificateRoot(TestConfig config) {
+ return config.system().isPublic() ? artifactsPath : Path.of(Defaults.getDefaults().underVespaHome("var/vespa/sia"));
+ }
+
private static String toSuiteDirectoryName(Suite suite) {
- switch (suite) {
- case SYSTEM_TEST: return "system-test";
- case STAGING_SETUP_TEST: return "staging-setup";
- case STAGING_TEST: return "staging-test";
- case PRODUCTION_TEST: return "production-test";
- default: throw new IllegalArgumentException("Unsupported test suite '" + suite + "'");
- }
+ return switch (suite) {
+ case SYSTEM_TEST -> "system-test";
+ case STAGING_SETUP_TEST -> "staging-setup";
+ case STAGING_TEST -> "staging-test";
+ case PRODUCTION_TEST -> "production-test";
+ };
}
private void log(Level level, String message, Throwable thrown) {