From 2f872ec34363481a93bbcb164f121ce7530ef7a2 Mon Sep 17 00:00:00 2001 From: Lorand Jakab Date: Wed, 30 May 2018 19:19:20 +0200 Subject: [PATCH] Keep integrationtest runtime folder It is very helpful to have the full Karaf environment used for the integrationtest stay available after the test finishes. It lives in the integrationtest/target/exam/{guid} folder, and has the full (~350MB) Karaf distribution. The most useful piece is the data/log/karaf.log file, which can be examined in case of a failure. Other useful pieces are the configuration files in etc/ which are modified by the integrationtests. The patch makes sure to delete any existing such runtime environment, to avoid developers building up many such folders, which takes up a lot of space, and makes it harder to determine which environment was the last one. When running builds in Jenkins, only the log files are saved to the log server, so the impact is minimal, but it helps debugging integration test failures which occur on the CI infrastructure. Change-Id: I11e92efebf6d74c95e4ddf12d02c4ba98462d8ba Signed-off-by: Lorand Jakab --- .../MappingServiceIntegrationTest.java | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/integrationtest/src/test/java/org/opendaylight/lispflowmapping/integrationtest/MappingServiceIntegrationTest.java b/integrationtest/src/test/java/org/opendaylight/lispflowmapping/integrationtest/MappingServiceIntegrationTest.java index 2d5450896..d53205aa6 100644 --- a/integrationtest/src/test/java/org/opendaylight/lispflowmapping/integrationtest/MappingServiceIntegrationTest.java +++ b/integrationtest/src/test/java/org/opendaylight/lispflowmapping/integrationtest/MappingServiceIntegrationTest.java @@ -30,10 +30,13 @@ import static org.opendaylight.lispflowmapping.integrationtest.MultiSiteScenario import static org.opendaylight.lispflowmapping.integrationtest.MultiSiteScenarioUtil.SITE_E_SB; import static org.ops4j.pax.exam.CoreOptions.composite; import static org.ops4j.pax.exam.CoreOptions.maven; +import static org.ops4j.pax.exam.karaf.options.KarafDistributionOption.configureConsole; import static org.ops4j.pax.exam.karaf.options.KarafDistributionOption.editConfigurationFilePut; +import static org.ops4j.pax.exam.karaf.options.KarafDistributionOption.keepRuntimeFolder; import com.google.common.collect.Lists; import com.google.common.collect.Sets; +import java.io.File; import java.io.IOException; import java.net.DatagramSocket; import java.net.InetAddress; @@ -136,6 +139,7 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev151105.ma import org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev151105.rloc.container.Rloc; import org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev151105.rloc.container.RlocBuilder; import org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.mappingservice.rev150906.MappingOrigin; +import org.ops4j.io.FileUtils; import org.ops4j.pax.exam.Option; import org.ops4j.pax.exam.junit.PaxExam; import org.ops4j.pax.exam.karaf.options.LogLevelOption.LogLevel; @@ -207,6 +211,14 @@ public class MappingServiceIntegrationTest extends AbstractMdsalTestBase { return option; } + @Override + protected Option[] getAdditionalOptions() { + return new Option[] { + keepRuntimeFolder(), + configureConsole().ignoreLocalConsole().ignoreRemoteShell() + }; + } + @Test public void testLispFlowMappingFeatureLoad() { Assert.assertTrue(true); @@ -221,6 +233,9 @@ public class MappingServiceIntegrationTest extends AbstractMdsalTestBase { @Before public void before() throws Exception { + File paxExamDirectory = new File("target/exam/"); + FileUtils.delete(paxExamDirectory); + areWeReady(); mapService.setLookupPolicy(IMappingService.LookupPolicy.NB_FIRST); mapService.setMappingMerge(false); -- 2.36.6