Bug 445108 - releng tests should check that "executables" are correctly
signed and that related meta data is correct
- Test added for jar signing
- Not required for executables as the build will fail if executables are
not signed
Change-Id: I3e400c3844b5bfe72deb83b5b91e6fad4a796760
Signed-off-by: Sravan Kumar Lakkimsetti <sravankumarl@in.ibm.com>
diff --git a/bundles/org.eclipse.releng.tests/src/org/eclipse/releng/tests/BuildTests.java b/bundles/org.eclipse.releng.tests/src/org/eclipse/releng/tests/BuildTests.java
index 2339339..962b83d 100644
--- a/bundles/org.eclipse.releng.tests/src/org/eclipse/releng/tests/BuildTests.java
+++ b/bundles/org.eclipse.releng.tests/src/org/eclipse/releng/tests/BuildTests.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2017 IBM Corporation and others.
+ * Copyright (c) 2000, 2018 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -644,6 +644,25 @@
}
+ @Test
+ public void testJarSign() throws Exception {
+
+ String buildId = System.getProperty("buildId");
+ assertNotNull("buildId property must be specified for testJarSign test", buildId);
+ String downloadHost = "build.eclipse.org/eclipse/builds/4" + buildId.charAt(0) + "/siteDir";
+ String urlOfFile = "http://" + downloadHost + "/eclipse/downloads/drops4/" + buildId + "/buildlogs/reporeports/reports/unsigned8.txt";
+ URL logURL = new URL(urlOfFile);
+
+ URLConnection urlConnection = logURL.openConnection();
+ long nBytes = urlConnection.getContentLength();
+ // if find "response does not contain length, on a regular basis, for
+ // some servers, will have to read contents.
+ assertTrue(
+ "Some bundles are unsigned please refer "
+ + urlOfFile,
+ ((-1 == nBytes)));
+ }
+
private String getDownloadHost() {
String downloadHost = System.getProperty("downloadHost");
if (downloadHost == null) {