import static org.ops4j.pax.exam.CoreOptions.composite;
import static org.ops4j.pax.exam.CoreOptions.maven;
import static org.ops4j.pax.exam.CoreOptions.vmOption;
+import static org.ops4j.pax.exam.CoreOptions.when;
+import static org.ops4j.pax.exam.OptionUtils.combine;
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 java.util.concurrent.atomic.AtomicBoolean;
import javax.inject.Inject;
import org.junit.Before;
-import org.junit.Ignore;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.opendaylight.controller.md.sal.binding.api.DataBroker;
@Configuration
@Override
public Option[] config() {
- Option[] ovsProps = super.config();
- Option[] propertiesOptions = DockerOvs.getSysPropOptions();
- Option[] otherOptions = getOtherOptions();
- Option[] options = new Option[ovsProps.length + propertiesOptions.length + otherOptions.length];
- System.arraycopy(ovsProps, 0, options, 0, ovsProps.length);
- System.arraycopy(propertiesOptions, 0, options, ovsProps.length, propertiesOptions.length);
- System.arraycopy(otherOptions, 0, options, ovsProps.length + propertiesOptions.length,
- otherOptions.length);
- return options;
+ Option[] tempOptions = combine(super.config(), DockerOvs.getSysPropOptions());
+ return combine(tempOptions, getOtherOptions());
}
private Option[] getOtherOptions() {
return new Option[] {
configureConsole().startLocalConsole(),
- // hardcode to use transparent for now.
- //when("transparent".equals(System.getProperty("sgm"))).useOptions(
+ // Use transparent as the default
+ when("transparent".equals(System.getProperty("sgm", "transparent"))).useOptions(
replaceConfigurationFile(
"etc/opendaylight/datastore/initial/config/netvirt-aclservice-config.xml",
- new File("src/test/resources/initial/netvirt-aclservice-config.xml")),//),
+ new File("src/test/resources/initial/netvirt-aclservice-config-transparent.xml"))),
+ when("learn".equals(System.getProperty("sgm"))).useOptions(
+ replaceConfigurationFile(
+ "etc/opendaylight/datastore/initial/config/netvirt-aclservice-config.xml",
+ new File("src/test/resources/initial/netvirt-aclservice-config-learn.xml"))),
+ when("stateful".equals(System.getProperty("sgm"))).useOptions(
+ replaceConfigurationFile(
+ "etc/opendaylight/datastore/initial/config/netvirt-aclservice-config.xml",
+ new File("src/test/resources/initial/netvirt-aclservice-config-stateful.xml"))),
+ when("stateless".equals(System.getProperty("sgm"))).useOptions(
+ replaceConfigurationFile(
+ "etc/opendaylight/datastore/initial/config/netvirt-aclservice-config.xml",
+ new File("src/test/resources/initial/netvirt-aclservice-config-stateless.xml"))),
+ // Add our own logging.cfg so we can log to a single karaf.log file
+ replaceConfigurationFile("etc/org.ops4j.pax.logging.cfg",
+ new File("src/test/resources/org.ops4j.pax.logging.cfg")),
vmOption("-javaagent:../jars/org.jacoco.agent.jar=destfile=../../jacoco-it.exec"),
vmOption("-Xmx2048m"),
//vmOption("-XX:MaxPermSize=m"),
};
}
+ // This won't get used when we use our own logging.cfg file set in getOtherOptions
+ // but we keep it for reference.
@Override
public Option getLoggingOption() {
return composite(
}
// This test requires ovs kernel modules to be loaded which is not in jenkins yet.
- @Ignore
+ //@Ignore
@Test
@SuppressWarnings("checkstyle:IllegalCatch")
public void testNeutronNetTwoNodes() throws InterruptedException {
--- /dev/null
+################################################################################
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+################################################################################
+
+# Root logger
+log4j.rootLogger=INFO, async, stdout, osgi:*
+log4j.throwableRenderer=org.apache.log4j.OsgiThrowableRenderer
+
+# CONSOLE appender not used by default
+log4j.appender.stdout=org.apache.log4j.ConsoleAppender
+log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
+log4j.appender.stdout.layout.ConversionPattern=%d{ISO8601} | %-5.5p | %-16.16t | %-32.32c{1} | %X{bundle.id} - %X{bundle.name} - %X{bundle.version} | %m%n
+
+# Async appender forwarding to file appender
+log4j.appender.async=org.apache.log4j.AsyncAppender
+log4j.appender.async.appenders=out
+
+# File appender
+log4j.appender.out=org.apache.log4j.RollingFileAppender
+log4j.appender.out.layout=org.apache.log4j.PatternLayout
+log4j.appender.out.layout.ConversionPattern=%d{ISO8601} | %-5.5p | %-16.16t | %-32.32c{1} | %X{bundle.id} - %X{bundle.name} - %X{bundle.version} | %m%n
+log4j.appender.out.file=${karaf.data}/log/karaf.log
+log4j.appender.out.append=true
+log4j.appender.out.maxFileSize=1GB
+log4j.appender.out.maxBackupIndex=1
+
+# Sift appender
+log4j.appender.sift=org.apache.log4j.sift.MDCSiftingAppender
+log4j.appender.sift.key=bundle.name
+log4j.appender.sift.default=karaf
+log4j.appender.sift.appender=org.apache.log4j.FileAppender
+log4j.appender.sift.appender.layout=org.apache.log4j.PatternLayout
+log4j.appender.sift.appender.layout.ConversionPattern=%d{ISO8601} | %-5.5p | %-16.16t | %-32.32c{1} | %m%n
+log4j.appender.sift.appender.file=${karaf.data}/log/$\\{bundle.name\\}.log
+log4j.appender.sift.appender.append=true
+
+log4j.logger.org.opendaylight.netvirt = TRACE
+log4j.logger.org.opendaylight.ovsdb.utils.southbound.utils.SouthboundUtils = TRACE
+log4j.logger.org.opendaylight.openflowjava.protocol.impl.util.ListDeserializer = ERROR
+log4j.logger.org.opendaylight.controller.configpusherfeature.internal.FeatureConfigPusher = ERROR
+log4j.logger.org.apache.aries.blueprint.container.ServiceRecipe = WARN
+log4j.logger.org.opendaylight.yangtools.yang.parser.repo.YangTextSchemaContextResolver = WARN
+log4j.logger.org.opendaylight.netvirt.fibmanager.FibNodeCapableListener = ERROR
+log4j.logger.org.opendaylight.controller.mdsal.it.base.AbstractMdsalTestBase = INFO
+log4j.logger.org.opendaylight.controller.config.it.base.AbstractConfigTestBase = INFO
\ No newline at end of file