Roy Golan has uploaded a new change for review.

Change subject: packaging: fail the build if osinfo-defaults.properties fails 
to parse
......................................................................

packaging: fail the build if osinfo-defaults.properties fails to parse

check the properties file we ship with the exact code that checks it
at runtime when the engine loads.

this test is hooked into the packaging process and must fail it.

Change-Id: I9aead46c067134dbc59b83ad70d1715ec004587c
Bug-Url: https://bugzilla.redhat.com/1056965
Signed-off-by: Roy Golan <rgo...@redhat.com>
---
M Makefile
A build/validations/pom.xml
A 
build/validations/src/test/java/org/ovirt/engine/build/validations/OsinfoValidationsTest.java
3 files changed, 48 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/20/34820/1

diff --git a/Makefile b/Makefile
index f65f05b..0865244 100644
--- a/Makefile
+++ b/Makefile
@@ -210,6 +210,7 @@
        generated-files \
        validations \
        $(BUILD_FILE) \
+       post-build-validations \
        $(NULL)
 
 generated-files:       $(GENERATED)
@@ -231,6 +232,11 @@
 $(BUILD_FILE):
        $(MAKE) maven
 
+post-build-validations:
+       if [ "$(BUILD_VALIDATION)" != 0 ]; then \
+               ( cd build/validations && $(MVN) clean test 
-Dosinfo.properties=../../packaging/conf/osinfo-defaults.properties ); \
+       fi
+
 clean:
        # Clean maven generated stuff:
        $(MVN) clean $(EXTRA_BUILD_FLAGS)
diff --git a/build/validations/pom.xml b/build/validations/pom.xml
new file mode 100644
index 0000000..6faa5d8
--- /dev/null
+++ b/build/validations/pom.xml
@@ -0,0 +1,24 @@
+<project>
+    <modelVersion>4.0.0</modelVersion>
+
+    <name>build-validations</name>
+    <artifactId>build-validations</artifactId>
+    <groupId>org.ovirt.engine.build</groupId>
+    <version>3.6.0-SNAPSHOT</version>
+
+    <dependencies>
+        <dependency>
+            <groupId>org.ovirt.engine.core</groupId>
+            <artifactId>utils</artifactId>
+            <version>${project.version}</version>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>junit</groupId>
+            <artifactId>junit</artifactId>
+            <version>4.11</version>
+            <scope>test</scope>
+        </dependency>
+    </dependencies>
+
+</project>
diff --git 
a/build/validations/src/test/java/org/ovirt/engine/build/validations/OsinfoValidationsTest.java
 
b/build/validations/src/test/java/org/ovirt/engine/build/validations/OsinfoValidationsTest.java
new file mode 100644
index 0000000..eb588a8
--- /dev/null
+++ 
b/build/validations/src/test/java/org/ovirt/engine/build/validations/OsinfoValidationsTest.java
@@ -0,0 +1,18 @@
+package org.ovirt.engine.build.validations;
+
+import org.junit.Test;
+import org.ovirt.engine.core.utils.osinfo.OsinfoPropertiesParser;
+
+public class OsinfoValidationsTest {
+
+    @Test
+    public void parse() throws Exception {
+        try {
+            
OsinfoPropertiesParser.parse(System.getProperty("osinfo.properties"));
+        } catch (Exception e) {
+            System.err.println("Ovirt-engine will fail to load with a broken 
osinfo properties file.");
+            System.err.println("Please fix the properties file or Osinfo.g4 
grammer under org.ovirt.engine.core.utils.");
+            throw e;
+        }
+    }
+}


-- 
To view, visit http://gerrit.ovirt.org/34820
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I9aead46c067134dbc59b83ad70d1715ec004587c
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-engine
Gerrit-Branch: ovirt-engine-3.5
Gerrit-Owner: Roy Golan <rgo...@redhat.com>
_______________________________________________
Engine-patches mailing list
Engine-patches@ovirt.org
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to