diff options
author | Bjørn Christian Seime <bjorncs@verizonmedia.com> | 2020-07-07 15:09:31 +0200 |
---|---|---|
committer | Bjørn Christian Seime <bjorncs@verizonmedia.com> | 2020-07-07 15:09:31 +0200 |
commit | ef3c3cb0db99c48f8bbc0cbc9030e4ee188ca99e (patch) | |
tree | 67a75f140e0479bf2836484863e2c6180365104c /vespa-osgi-testrunner | |
parent | 7e850093caa30d9abdbba7a956e69fd075843176 (diff) |
Add temporary solution for propagating credentials root path
Diffstat (limited to 'vespa-osgi-testrunner')
-rw-r--r-- | vespa-osgi-testrunner/src/main/java/com/yahoo/vespa/testrunner/JunitRunner.java | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/vespa-osgi-testrunner/src/main/java/com/yahoo/vespa/testrunner/JunitRunner.java b/vespa-osgi-testrunner/src/main/java/com/yahoo/vespa/testrunner/JunitRunner.java index ccf963e2c3f..04b4a9ec1b6 100644 --- a/vespa-osgi-testrunner/src/main/java/com/yahoo/vespa/testrunner/JunitRunner.java +++ b/vespa-osgi-testrunner/src/main/java/com/yahoo/vespa/testrunner/JunitRunner.java @@ -4,6 +4,7 @@ package com.yahoo.vespa.testrunner; import ai.vespa.hosted.api.TestDescriptor; import ai.vespa.hosted.cd.internal.TestRuntimeProvider; import com.google.inject.Inject; +import com.yahoo.cloud.config.ConfigserverConfig; import com.yahoo.component.AbstractComponent; import com.yahoo.io.IOUtils; import com.yahoo.jdisc.application.OsgiFramework; @@ -46,9 +47,11 @@ public class JunitRunner extends AbstractComponent { @Inject public JunitRunner(OsgiFramework osgiFramework, - TestRuntimeProvider testRuntimeProvider) { + TestRuntimeProvider testRuntimeProvider, + ConfigserverConfig configserverConfig) { this.testRuntimeProvider = testRuntimeProvider; this.bundleContext = getUnrestrictedBundleContext(osgiFramework); + uglyHackSetCredentialsRootSystemProperty(configserverConfig); } // Hack to retrieve bundle context that allows access to other bundles @@ -63,6 +66,17 @@ public class JunitRunner extends AbstractComponent { } } + // TODO(bjorncs|tokle) Propagate credentials root without ConfigserverConfig and system property + private static void uglyHackSetCredentialsRootSystemProperty(ConfigserverConfig config) { + String credentialsRoot; + if (config.system().equals("public") || config.system().equals("publiccd")) { + credentialsRoot = "/opt/vespa/tmp/test/artifacts"; + } else { + credentialsRoot = "/opt/vespa/var/vespa/sia"; + } + System.setProperty("vespa.test.credentials.root", credentialsRoot); + } + public void executeTests(TestDescriptor.TestCategory category, byte[] testConfig) { if (execution != null) { throw new RuntimeException("Test execution already in progress"); |