Fix mdsal-it-base karaf setup 55/86455/2
authorRobert Varga <robert.varga@pantheon.tech>
Tue, 17 Dec 2019 02:43:17 +0000 (03:43 +0100)
committerRobert Varga <robert.varga@pantheon.tech>
Tue, 17 Dec 2019 02:45:19 +0000 (03:45 +0100)
Since we are setting up a karaf environment, we must make sure
we are not overriding opendaylight-karaf-empty, otherwise we are
not matching distribution (and not picking up its fixes,
to ARIES-1923 for example).

JIRA: ODLPARENT-209
Change-Id: I9f723ee2edd13ee4848e302c572285517a1d552b
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
opendaylight/md-sal/mdsal-it-base/src/main/java/org/opendaylight/controller/mdsal/it/base/AbstractMdsalTestBase.java

index b8cabad..cf74e7d 100644 (file)
@@ -38,7 +38,6 @@ public abstract class AbstractMdsalTestBase {
 
     private static final Logger LOG = LoggerFactory.getLogger(AbstractMdsalTestBase.class);
     private static final String MAVEN_REPO_LOCAL = "maven.repo.local";
-    private static final String ORG_OPS4J_PAX_URL_MVN_LOCAL_REPOSITORY = "org.ops4j.pax.url.mvn.localRepository";
     private static final String ETC_ORG_OPS4J_PAX_URL_MVN_CFG = "etc/org.ops4j.pax.url.mvn.cfg";
     private static final String ETC_ORG_OPS4J_PAX_LOGGING_CFG = "etc/org.ops4j.pax.logging.cfg";
 
@@ -117,8 +116,8 @@ public abstract class AbstractMdsalTestBase {
     protected Option mvnLocalRepoOption() {
         String mvnRepoLocal = System.getProperty(MAVEN_REPO_LOCAL, "");
         LOG.info("mvnLocalRepo \"{}\"", mvnRepoLocal);
-        return editConfigurationFilePut(ETC_ORG_OPS4J_PAX_URL_MVN_CFG, ORG_OPS4J_PAX_URL_MVN_LOCAL_REPOSITORY,
-                mvnRepoLocal);
+        return editConfigurationFilePut(ETC_ORG_OPS4J_PAX_URL_MVN_CFG,
+            "org.ops4j.pax.url.mvn.localRepository", mvnRepoLocal);
     }
 
     @Configuration
@@ -130,8 +129,12 @@ public abstract class AbstractMdsalTestBase {
                         .unpackDirectory(new File(PAX_EXAM_UNPACK_DIRECTORY)).useDeployFolder(false),
                 when(Boolean.getBoolean(KEEP_UNPACK_DIRECTORY_PROP)).useOptions(keepRuntimeFolder()),
                 features(getFeatureRepo(), getFeatureName()),
-                //mavenBundle("org.apache.aries.quiesce", "org.apache.aries.quiesce.api", "1.0.0"), getLoggingOption(),
                 mvnLocalRepoOption(),
+
+                // Make sure karaf's default repository is consulted before anything else
+                editConfigurationFilePut(ETC_ORG_OPS4J_PAX_URL_MVN_CFG, "org.ops4j.pax.url.mvn.defaultRepositories",
+                        "file:${karaf.home}/${karaf.default.repository}@id=system.repository"),
+
                 configureConsole().ignoreLocalConsole().ignoreRemoteShell(),
                 editConfigurationFilePut(ETC_ORG_OPS4J_PAX_LOGGING_CFG, "log4j2.rootLogger.level", "INFO") };
 

©2013 OpenDaylight, A Linux Foundation Collaborative Project. All Rights Reserved.
OpenDaylight is a registered trademark of The OpenDaylight Project, Inc.
Linux Foundation and OpenDaylight are registered trademarks of the Linux Foundation.
Linux is a registered trademark of Linus Torvalds.