From 01e9dccdc1ff4b0dce2b0883e42000f2fc2bb23a Mon Sep 17 00:00:00 2001 From: Josh Date: Mon, 16 May 2016 15:43:15 +0200 Subject: [PATCH] Infra for running ovs dockers Added a class called DockerOvs. See documentation in the class Added component: com.esotericsoftware.yamlbeans yamlbeans this is used to parse the docker-compose files to extract the port mappings Change-Id: I978a9a6bc6296f7d8e1246c37c3895b2f36c5a6d Signed-off-by: Josh --- .../utils/NotifyingDataChangeListener.java | 17 +- utils/ovsdb-it-utils/pom.xml | 31 ++ .../ovsdb/utils/ovsdb/it/utils/DockerOvs.java | 494 ++++++++++++++++++ .../ovsdb/utils/ovsdb/it/utils/NodeInfo.java | 2 +- .../utils/ovsdb/it/utils/OvsdbItUtils.java | 2 +- .../docker-compose-files/docker-ovs-2.5.1.yml | 6 + 6 files changed, 545 insertions(+), 7 deletions(-) create mode 100644 utils/ovsdb-it-utils/src/main/java/org/opendaylight/ovsdb/utils/ovsdb/it/utils/DockerOvs.java create mode 100644 utils/ovsdb-it-utils/src/main/resources/docker-compose-files/docker-ovs-2.5.1.yml diff --git a/utils/mdsal-utils/src/main/java/org/opendaylight/ovsdb/utils/mdsal/utils/NotifyingDataChangeListener.java b/utils/mdsal-utils/src/main/java/org/opendaylight/ovsdb/utils/mdsal/utils/NotifyingDataChangeListener.java index 5e408e7bc..10fd0039d 100644 --- a/utils/mdsal-utils/src/main/java/org/opendaylight/ovsdb/utils/mdsal/utils/NotifyingDataChangeListener.java +++ b/utils/mdsal-utils/src/main/java/org/opendaylight/ovsdb/utils/mdsal/utils/NotifyingDataChangeListener.java @@ -34,10 +34,12 @@ public class NotifyingDataChangeListener implements AutoCloseable, DataChangeLis private final Set> removedIids = new HashSet<>(); private final Set> updatedIids = new HashSet<>(); private InstanceIdentifier iid; - private final int RETRY_WAIT = 100; - private final int MDSAL_TIMEOUT = 10000; + private final static int RETRY_WAIT = 100; + private final static int MDSAL_TIMEOUT_OPERATIONAL = 10000; + private final static int MDSAL_TIMEOUT_CONFIG = 1000; private ListenerRegistration listenerRegistration; private List waitList = null; + private int mdsalTimeout = MDSAL_TIMEOUT_OPERATIONAL; /** * Create a new NotifyingDataChangeListener @@ -53,6 +55,11 @@ public class NotifyingDataChangeListener implements AutoCloseable, DataChangeLis if(this.waitList != null) { this.waitList.add(this); } + + mdsalTimeout = MDSAL_TIMEOUT_OPERATIONAL; + if (type == LogicalDatastoreType.CONFIGURATION) { + mdsalTimeout = MDSAL_TIMEOUT_CONFIG; + } } /** @@ -106,7 +113,7 @@ public class NotifyingDataChangeListener implements AutoCloseable, DataChangeLis } public void waitForCreation() throws InterruptedException { - waitForCreation(MDSAL_TIMEOUT); + waitForCreation(mdsalTimeout); } public void waitForCreation(long timeout) throws InterruptedException { @@ -121,7 +128,7 @@ public class NotifyingDataChangeListener implements AutoCloseable, DataChangeLis } public void waitForUpdate() throws InterruptedException { - waitForUpdate(MDSAL_TIMEOUT); + waitForUpdate(mdsalTimeout); } public void waitForUpdate(long timeout) throws InterruptedException { @@ -136,7 +143,7 @@ public class NotifyingDataChangeListener implements AutoCloseable, DataChangeLis } public void waitForDeletion() throws InterruptedException { - waitForDeletion(MDSAL_TIMEOUT); + waitForDeletion(mdsalTimeout); } public void waitForDeletion(long timeout) throws InterruptedException { diff --git a/utils/ovsdb-it-utils/pom.xml b/utils/ovsdb-it-utils/pom.xml index cf5f6dec2..161d87b9f 100644 --- a/utils/ovsdb-it-utils/pom.xml +++ b/utils/ovsdb-it-utils/pom.xml @@ -63,6 +63,11 @@ and is available at http://www.eclipse.org/legal/epl-v10.html junit compile + + com.esotericsoftware.yamlbeans + yamlbeans + 1.09 +