Bug 8100: Karaf 4 SingleFeatureTest TestBundleDiag blacklist genius
[odlparent.git] / features4-test / src / main / java / org / opendaylight / odlparent / featuretest / SingleFeatureTest.java
index 47c7962218d62a09de96e7e70724488e1e7a76cc..33d273ead1e70faf8096dd05c525ba61886a0e82 100644 (file)
@@ -13,6 +13,7 @@ import static org.opendaylight.odlparent.featuretest.Constants.ORG_OPENDAYLIGHT_
 import static org.opendaylight.odlparent.featuretest.Constants.ORG_OPENDAYLIGHT_FEATURETEST_FEATUREVERSION_PROP;
 import static org.opendaylight.odlparent.featuretest.Constants.ORG_OPENDAYLIGHT_FEATURETEST_URI_PROP;
 import static org.ops4j.pax.exam.CoreOptions.maven;
+import static org.ops4j.pax.exam.CoreOptions.mavenBundle;
 import static org.ops4j.pax.exam.CoreOptions.propagateSystemProperty;
 import static org.ops4j.pax.exam.CoreOptions.systemPackages;
 import static org.ops4j.pax.exam.CoreOptions.when;
@@ -138,6 +139,8 @@ public class SingleFeatureTest {
         return new Option[] {
             // TODO: Find a way to inherit memory limits from Maven options.
             new VMOption("-Xmx2g"),
+            new VMOption("-XX:+HeapDumpOnOutOfMemoryError"),
+            new VMOption("-XX:OnOutOfMemoryError=\"kill -3 %p\""),
             // inspired by org.apache.commons.lang.SystemUtils
             when(System.getProperty("os.name").toLowerCase().startsWith("linux")).useOptions(
                 // This prevents low entropy issues on Linux to affect Java random numbers
@@ -157,8 +160,10 @@ public class SingleFeatureTest {
             logLevel(LogLevel.WARN),
             mvnLocalRepoOption(),
             features(bundleTestRepo, "odl-bundles-test"),
+            mavenBundle("org.apache.aries.quiesce", "org.apache.aries.quiesce.api", "1.0.0"),
             editConfigurationFilePut(ORG_OPS4J_PAX_LOGGING_CFG, LOG4J_LOGGER_ORG_OPENDAYLIGHT_YANGTOOLS_FEATURETEST,
                     LogLevel.INFO.name()),
+            editConfigurationFilePut("etc/config.properties", "karaf.framework", "equinox"),
             editConfigurationFilePut(ETC_ORG_OPS4J_PAX_LOGGING_CFG, "log4j.rootLogger", "INFO, stdout, osgi:*"),
              /*
               *
@@ -199,16 +204,18 @@ public class SingleFeatureTest {
         return File.createTempFile("SingleFeatureTest-Karaf-JavaFlightRecorder", ".jfr").getAbsolutePath();
     }
 
-    private String getKarafVersion() {
+    private String getKarafVersion() throws IOException {
         if (karafVersion == null) {
             // We use a properties file to retrieve ${karaf.version}, instead of .versionAsInProject()
             // This avoids forcing all users to depend on Karaf in their POMs
             Properties singleFeatureTestProps = new Properties();
             try (InputStream singleFeatureTestInputStream = Thread.currentThread().getContextClassLoader()
                     .getResourceAsStream(PROPERTIES_FILENAME)) {
+                if (singleFeatureTestInputStream == null) {
+                    throw new IOException("Resource not found; expected to be present on current thread classloader: "
+                            + PROPERTIES_FILENAME);
+                }
                 singleFeatureTestProps.load(singleFeatureTestInputStream);
-            } catch (IOException e) {
-                LOG.error("Unable to load {} to determine the Karaf version", PROPERTIES_FILENAME, e);
             }
             karafVersion = singleFeatureTestProps.getProperty(KARAF_DISTRO_VERSION_PROP);
 
@@ -220,7 +227,7 @@ public class SingleFeatureTest {
         return karafVersion;
     }
 
-    private String getKarafDistroVersion() {
+    private String getKarafDistroVersion() throws IOException {
         if (karafDistroVersion == null) {
             karafDistroVersion = System.getProperty(KARAF_DISTRO_VERSION_PROP);
             if (karafDistroVersion == null) {
@@ -251,7 +258,7 @@ public class SingleFeatureTest {
                 mvnRepoLocal);
     }
 
-    protected Option getKarafDistroOption() {
+    protected Option getKarafDistroOption() throws IOException {
         String groupId = System.getProperty(KARAF_DISTRO_GROUPID_PROP, KARAF_DISTRO_GROUPID);
         String artifactId = System.getProperty(KARAF_DISTRO_ARTIFACTID_PROP, KARAF_DISTRO_ARTIFACTID);
         String type = System.getProperty(KARAF_DISTRO_TYPE_PROP, KARAF_DISTRO_TYPE);
@@ -345,9 +352,14 @@ public class SingleFeatureTest {
             "odl-mdsal-clustering-commons",
             "odl-mdsal-distributed-datastore",
             "odl-mdsal-remoterpc-connector",
-            // aaa/features/authn due to Cassandra expected to be up on
-            // see https://bugs.opendaylight.org/show_bug.cgi?id=7584
-            "odl-aaa-authn-cassandra-cluster",
+            // Karaf 4 specific problems with genius features
+            // see https://bugs.opendaylight.org/show_bug.cgi?id=8100
+            "odl-genius",
+            "odl-genius-api",
+            "odl-genius-rest",
+            "odl-genius-ui",
+            "odl-genius-fcaps-framework",
+            "odl-genius-fcaps-application",
             // 1/17 in groupbasedpolicy/features due to NOK org.opendaylight.groupbasedpolicy
             // Caused by: org.opendaylight.mdsal.eos.common.api.CandidateAlreadyRegisteredException
             // see https://bugs.opendaylight.org/show_bug.cgi?id=7587