From 434ee83df66f2eac9982adc1698e6a84e5978ca2 Mon Sep 17 00:00:00 2001 From: Martijn van Groningen Date: Fri, 7 Nov 2014 14:24:56 +0100 Subject: [PATCH] Build: Configure randomizedtesting properly Original commit: elastic/x-pack-elasticsearch@e7b1a4fb9c10efdce1e4b519af28da40c658fcff --- pom.xml | 213 +++++++++++++++++++++++++++++++++++++++++---------- tests.policy | 42 ++++++++++ 2 files changed, 216 insertions(+), 39 deletions(-) create mode 100644 tests.policy diff --git a/pom.xml b/pom.xml index ea2d7ac4a2b..d402a15dcd3 100644 --- a/pom.xml +++ b/pom.xml @@ -2,7 +2,6 @@ - alerting-plugin 4.0.0 @@ -10,16 +9,43 @@ elasticsearch-alerts 1.0.0-SNAPSHOT - - jar + + org.sonatype.oss + oss-parent + 7 + 1.4.0 + 4.10.2 4.10.2 + + auto + true + onerror + + ${project.basedir}/backwards + INFO + 512m + 5 + .local-${project.version}-execution-hints.log + false + + org.elasticsearch + elasticsearch + ${elasticsearch.version} + + + + org.apache.lucene + lucene-core + ${lucene.version} + + org.quartz-scheduler quartz @@ -35,7 +61,7 @@ log4j log4j - 1.2.16 + 1.2.17 @@ -65,6 +91,13 @@ + + org.codehaus.groovy + groovy-all + 2.3.2 + test + + org.apache.lucene lucene-test-framework @@ -72,27 +105,6 @@ test - - org.hamcrest - hamcrest-core - 1.3.RC2 - test - - - - org.hamcrest - hamcrest-library - 1.3.RC2 - test - - - - com.carrotsearch.randomizedtesting - randomizedtesting-runner - 2.1.10 - test - - org.elasticsearch elasticsearch @@ -101,27 +113,25 @@ test - - - org.elasticsearch - elasticsearch - ${elasticsearch.version} - provided + org.hamcrest + hamcrest-all + 1.3 + test - org.apache.lucene - lucene-core - ${lucene.version} - provided + com.carrotsearch.randomizedtesting + randomizedtesting-runner + 2.1.10 + test - org.codehaus.groovy - groovy-all - 2.3.2 - provided + junit + junit + 4.11 + test @@ -190,6 +200,131 @@ be fixed in version > 3.1 --> false + + -XDignore.symbol.file + + + + + com.carrotsearch.randomizedtesting + junit4-maven-plugin + 2.1.2 + + + tests + test + + junit4 + + + 20 + pipe,warn + true + + + + + + + + + + + ${tests.jvms} + + + + + + + **/*Tests.class + **/*Test.class + + + **/Abstract*.class + **/*StressTest.class + + + -Xmx${tests.heap.size} + -Xms${tests.heap.size} + -Xss256k + -XX:MaxPermSize=128m + -XX:MaxDirectMemorySize=512m + -Des.logger.prefix= + + ${tests.shuffle} + ${tests.verbose} + ${tests.seed} + ${tests.failfast} + false + + . + + + ${tests.bwc} + ${tests.bwc.path} + ${tests.bwc.version} + ${tests.jvm.argline} + ${tests.processors} + ${tests.appendseed} + ${tests.iters} + ${tests.maxfailures} + ${tests.failfast} + ${tests.class} + ${tests.method} + ${tests.nightly} + ${tests.verbose} + ${tests.badapples} + ${tests.weekly} + ${tests.slow} + ${tests.awaitsfix} + ${tests.slow} + ${tests.timeoutSuite} + ${tests.showSuccess} + ${tests.integration} + ${tests.client.ratio} + ${tests.enable_mock_modules} + ${tests.assertion.disabled} + ${tests.rest} + ${tests.rest.suite} + ${tests.rest.blacklist} + ${tests.rest.spec} + ${tests.network} + ${tests.cluster} + ${tests.heap.size} + ${tests.filter} + ${env.ES_TEST_LOCAL} + ${es.node.mode} + ${es.logger.level} + ${tests.security.manager} + ${tests.compatibility} + true + + ${project.build.directory} + ${basedir}/tests.policy + + + + + + + + + org.apache.maven.plugins + maven-surefire-plugin + 2.16 + + true diff --git a/tests.policy b/tests.policy new file mode 100644 index 00000000000..ad06580d8b8 --- /dev/null +++ b/tests.policy @@ -0,0 +1,42 @@ +grant { + // permissions for file access, write access only to sandbox: + permission java.io.FilePermission "<>", "read,execute"; + permission java.io.FilePermission "${junit4.childvm.cwd}", "read,execute,write"; + permission java.io.FilePermission "${junit4.childvm.cwd}${/}-", "read,execute,write,delete"; + permission java.io.FilePermission "${junit4.tempDir}${/}*", "read,execute,write,delete"; + permission groovy.security.GroovyCodeSourcePermission "/groovy/script"; + + // Allow connecting to the internet anywhere + permission java.net.SocketPermission "*", "accept,listen,connect,resolve"; + + // Basic permissions needed for Lucene / Elasticsearch to work: + permission java.util.PropertyPermission "*", "read,write"; + permission java.lang.reflect.ReflectPermission "*"; + permission java.lang.RuntimePermission "*"; + + // These two *have* to be spelled out a separate + permission java.lang.management.ManagementPermission "control"; + permission java.lang.management.ManagementPermission "monitor"; + + permission java.net.NetPermission "*"; + permission java.util.logging.LoggingPermission "control"; + permission javax.management.MBeanPermission "*", "*"; + permission javax.management.MBeanServerPermission "*"; + permission javax.management.MBeanTrustPermission "*"; + + // Needed for some things in DNS caching in the JVM + permission java.security.SecurityPermission "getProperty.networkaddress.cache.ttl"; + permission java.security.SecurityPermission "getProperty.networkaddress.cache.negative.ttl"; + + // Needed for accept all ssl certs in tests + permission javax.net.ssl.SSLPermission "setHostnameVerifier"; + + // Needed to startup embedded apacheDS LDAP server for tests + permission java.security.SecurityPermission "putProviderProperty.BC"; + permission java.security.SecurityPermission "insertProvider.BC"; + permission java.security.SecurityPermission "getProperty.ssl.KeyManagerFactory.algorithm"; + + //this shouldn't be in a production environment, just to run tests: + permission java.lang.reflect.ReflectPermission "suppressAccessChecks"; + permission java.lang.RuntimePermission "setDefaultUncaughtExceptionHandler"; +};