Fix karaf's aries-blueprint feature 50/51450/4
authorRobert Varga <rovarga@cisco.com>
Mon, 6 Feb 2017 06:57:35 +0000 (07:57 +0100)
committerRobert Varga <rovarga@cisco.com>
Mon, 6 Feb 2017 14:22:57 +0000 (15:22 +0100)
quiesce.api is something we are using and since blueprint-core has
it as an optional dependency, we end up refreshing blueprint when
we install it. That leads to pax-exam thinking the test during SFT
has ended and proceeds to the next test -- wreaking havoc in process
of doing so.

Patch the upstream feature file so quiesce.api is installed
unconditionally, so we do not have to install it from a feature,
hence we won't trigger blueprint refresh.

Change-Id: I14ad8b70d1dc8a961944da9087a54242ba017195
Signed-off-by: Robert Varga <rovarga@cisco.com>
features4-test/src/main/java/org/opendaylight/odlparent/featuretest/SingleFeatureTest.java
karaf/karaf4-parent/pom.xml
karaf/opendaylight-karaf4-resources/src/main/resources/patches/karaf-quiesce-4.0.7.patch [new file with mode: 0644]

index bff755d3ef33224440fc659cbc5ed0c2bca00dc7..2773d7b970dc30003f32404ac9535f5114a14c69 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;
@@ -157,6 +158,7 @@ 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_ORG_OPS4J_PAX_LOGGING_CFG, "log4j.rootLogger", "INFO, stdout, osgi:*"),
index e47279a22817c7a189c7d6be095740f1a4351356..a00bd0eda05bb7b796631e21f5204c1fca666cd1 100644 (file)
                     </execution>
                 </executions>
             </plugin>
+
+            <!-- This needs to execute before patching, otherwise the feature will be left unpatched -->
+            <plugin>
+                <groupId>org.opendaylight.odlparent</groupId>
+                <artifactId>karaf4-plugin</artifactId>
+                <version>1.8.0-SNAPSHOT</version>
+                <executions>
+                    <execution>
+                        <id>populate-local-repo</id>
+                        <goals>
+                            <goal>populate-local-repo</goal>
+                        </goals>
+                        <configuration>
+                            <localRepo>${project.build.directory}/assembly/system</localRepo>
+                        </configuration>
+                    </execution>
+                </executions>
+            </plugin>
             <plugin>
                 <artifactId>maven-antrun-plugin</artifactId>
                 <executions>
                                 <patch patchfile="${project.build.directory}/assembly/patches/karaf-setenv.bat.patch"
                                        originalfile="${project.build.directory}/assembly/bin/setenv.bat"
                                        failonerror="true"/>
+                                <patch patchfile="${project.build.directory}/assembly/patches/karaf-quiesce-4.0.7.patch"
+                                       originalfile="${project.build.directory}/assembly/system/org/apache/karaf/features/standard/4.0.7/standard-4.0.7-features.xml"
+                                       failonerror="true"/>
                                 <fixcrlf srcdir="${project.build.directory}/assembly/bin"
                                          includes="*.bat" eol="crlf"/>
                             </target>
                     <javase>1.8</javase>
                 </configuration>
             </plugin>
-            <plugin>
-                <groupId>org.opendaylight.odlparent</groupId>
-                <artifactId>karaf4-plugin</artifactId>
-                <version>1.8.0-SNAPSHOT</version>
-                <executions>
-                    <execution>
-                        <id>populate-local-repo</id>
-                        <goals>
-                            <goal>populate-local-repo</goal>
-                        </goals>
-                        <configuration>
-                            <localRepo>${project.build.directory}/assembly/system</localRepo>
-                        </configuration>
-                    </execution>
-                </executions>
-            </plugin>
         </plugins>
     </build>
 
diff --git a/karaf/opendaylight-karaf4-resources/src/main/resources/patches/karaf-quiesce-4.0.7.patch b/karaf/opendaylight-karaf4-resources/src/main/resources/patches/karaf-quiesce-4.0.7.patch
new file mode 100644 (file)
index 0000000..cc6dfcf
--- /dev/null
@@ -0,0 +1,10 @@
+--- system/org/apache/karaf/features/standard/4.0.7/standard-4.0.7-features.xml        2017-01-10 16:50:18.000000000 +0100
++++ system/org/apache/karaf/features/standard/4.0.7/standard-4.0.7-features.xml        2017-02-06 07:51:32.804000000 +0100
+@@ -24,6 +24,7 @@
+         <bundle start-level="20">mvn:org.apache.aries.blueprint/org.apache.aries.blueprint.cm/1.0.8</bundle>
+         <bundle start-level="20">mvn:org.apache.aries.blueprint/org.apache.aries.blueprint.core.compatibility/1.0.0</bundle>
+         <bundle start-level="20">mvn:org.apache.aries.blueprint/org.apache.aries.blueprint.core/1.6.2</bundle>
++        <bundle start-level="20">mvn:org.apache.aries.quiesce/org.apache.aries.quiesce.api/1.0.0</bundle>
+         <conditional>
+             <condition>bundle</condition>
+             <bundle start-level="30">mvn:org.apache.karaf.bundle/org.apache.karaf.bundle.blueprintstate/4.0.7</bundle>