Merged with origin/master
diff --git a/cluster-mgmt/bin/bootup.sh b/cluster-mgmt/bin/bootup.sh
index e58e802..ca86f7e 100755
--- a/cluster-mgmt/bin/bootup.sh
+++ b/cluster-mgmt/bin/bootup.sh
@@ -1,5 +1,5 @@
#! /bin/bash
-. $HOME/bin/func.sh
+. `dirname $0`/func.sh
onos stop
cassandra cleandb
diff --git a/cluster-mgmt/bin/cassandra b/cluster-mgmt/bin/cassandra
index 262c936..b2033ad 100755
--- a/cluster-mgmt/bin/cassandra
+++ b/cluster-mgmt/bin/cassandra
@@ -1,5 +1,5 @@
#! /bin/bash
-. ${HOME}/bin/func.sh
+. `dirname $0`/func.sh
#$0 $1 $2
`basename $0` $1 $2
diff --git a/cluster-mgmt/bin/cmd b/cluster-mgmt/bin/cmd
index 262c936..b2033ad 100755
--- a/cluster-mgmt/bin/cmd
+++ b/cluster-mgmt/bin/cmd
@@ -1,5 +1,5 @@
#! /bin/bash
-. ${HOME}/bin/func.sh
+. `dirname $0`/func.sh
#$0 $1 $2
`basename $0` $1 $2
diff --git a/cluster-mgmt/bin/config.sh b/cluster-mgmt/bin/config.sh
index 5baf2e0..19bfbf2 100755
--- a/cluster-mgmt/bin/config.sh
+++ b/cluster-mgmt/bin/config.sh
@@ -1,6 +1,6 @@
#! /bin/sh
-. ${HOME}/bin/func.sh
+. `dirname $0`/func.sh
basename=$ONOS_CLUSTER_BASENAME
nr_nodes=$ONOS_CLUSTER_NR_NODES
diff --git a/cluster-mgmt/bin/func.sh b/cluster-mgmt/bin/func.sh
index e3a5b68..fe65ab6 100755
--- a/cluster-mgmt/bin/func.sh
+++ b/cluster-mgmt/bin/func.sh
@@ -1,6 +1,7 @@
CASSANDRA_DIR='${HOME}/apache-cassandra-1.1.4'
ZK_DIR='${HOME}/zookeeper-3.4.5'
ONOS_DIR='${HOME}/ONOS'
+
ZK_LIB='/var/lib/zookeeper'
CASSANDRA_LIB='/var/lib/cassandra'
diff --git a/cluster-mgmt/bin/onos b/cluster-mgmt/bin/onos
index 262c936..b2033ad 100755
--- a/cluster-mgmt/bin/onos
+++ b/cluster-mgmt/bin/onos
@@ -1,5 +1,5 @@
#! /bin/bash
-. ${HOME}/bin/func.sh
+. `dirname $0`/func.sh
#$0 $1 $2
`basename $0` $1 $2
diff --git a/src/main/java/net/floodlightcontroller/core/internal/OFSwitchImpl.java b/src/main/java/net/floodlightcontroller/core/internal/OFSwitchImpl.java
index 0eca19c..467c74a 100644
--- a/src/main/java/net/floodlightcontroller/core/internal/OFSwitchImpl.java
+++ b/src/main/java/net/floodlightcontroller/core/internal/OFSwitchImpl.java
@@ -402,7 +402,7 @@
*/
@Override
public String toString() {
- return "OFSwitchImpl [" + channel.getRemoteAddress() + " DPID[" + ((stringId != null) ? stringId : "?") + "]]";
+ return "OFSwitchImpl [" + ((channel != null) ? channel.getRemoteAddress() : "?") + " DPID[" + ((stringId != null) ? stringId : "?") + "]]";
}
@Override
diff --git a/src/main/java/net/onrc/onos/graph/GraphDBConnection.java b/src/main/java/net/onrc/onos/graph/GraphDBConnection.java
index 1e00668..f9f3b67 100644
--- a/src/main/java/net/onrc/onos/graph/GraphDBConnection.java
+++ b/src/main/java/net/onrc/onos/graph/GraphDBConnection.java
@@ -69,8 +69,8 @@
if (!s.contains("type")) {
graph.createKeyIndex("type", Vertex.class);
}
- if (!s.contains("dl_address")) {
- graph.createKeyIndex("dl_address", Vertex.class);
+ if (!s.contains("dl_addr")) {
+ graph.createKeyIndex("dl_addr", Vertex.class);
}
if (!s.contains("flow_id")) {
graph.createKeyIndex("flow_id", Vertex.class);
diff --git a/src/main/java/net/onrc/onos/ofcontroller/core/internal/DeviceStorageImpl.java b/src/main/java/net/onrc/onos/ofcontroller/core/internal/DeviceStorageImpl.java
index d4ab34f..386c1bd 100644
--- a/src/main/java/net/onrc/onos/ofcontroller/core/internal/DeviceStorageImpl.java
+++ b/src/main/java/net/onrc/onos/ofcontroller/core/internal/DeviceStorageImpl.java
@@ -50,7 +50,7 @@
/***
* Finalize/close function. After you use this class, please call this method.
- * It will close the DB connection. This is for Java gabage collection.
+ * It will close the DB connection. This is for Java garbage collection.
*/
@Override
public void finalize() {
diff --git a/src/main/java/net/onrc/onos/ofcontroller/core/internal/SwitchStorageImpl.java b/src/main/java/net/onrc/onos/ofcontroller/core/internal/SwitchStorageImpl.java
index 4bcf9a2..03a5e8e 100644
--- a/src/main/java/net/onrc/onos/ofcontroller/core/internal/SwitchStorageImpl.java
+++ b/src/main/java/net/onrc/onos/ofcontroller/core/internal/SwitchStorageImpl.java
@@ -40,7 +40,7 @@
/***
* Finalize/close function. After you use this class, please call this method.
- * It will close the DB connection. This is for Java gabage collection.
+ * It will close the DB connection. This is for Java garbage collection.
*/
@Override
public void close() {
diff --git a/src/test/java/net/onrc/onos/ofcontroller/core/internal/LinkStorageImplTest.java b/src/test/java/net/onrc/onos/ofcontroller/core/internal/LinkStorageImplTest.java
index 57e77b2..5c42452 100644
--- a/src/test/java/net/onrc/onos/ofcontroller/core/internal/LinkStorageImplTest.java
+++ b/src/test/java/net/onrc/onos/ofcontroller/core/internal/LinkStorageImplTest.java
@@ -5,17 +5,21 @@
import static org.junit.Assert.assertTrue;
import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.Iterator;
import java.util.List;
+import java.util.Map;
import net.floodlightcontroller.routing.Link;
import net.onrc.onos.graph.GraphDBConnection;
import net.onrc.onos.graph.GraphDBOperation;
import net.onrc.onos.ofcontroller.core.ILinkStorage;
import net.onrc.onos.ofcontroller.core.INetMapStorage.DM_OPERATION;
-import net.onrc.onos.ofcontroller.core.internal.TestableGraphDBOperation.TestPortObject;
+import net.onrc.onos.ofcontroller.core.INetMapTopologyObjects.IPortObject;
+import net.onrc.onos.ofcontroller.core.INetMapTopologyObjects.ISwitchObject;
import net.onrc.onos.ofcontroller.linkdiscovery.LinkInfo;
-import org.easymock.EasyMock;
+import org.easymock.*;
import org.junit.After;
import org.junit.Before;
import org.junit.Ignore;
@@ -40,7 +44,54 @@
private static GraphDBConnection conn;
// Mock GraphDBOperation (mocks port-related methods only)
- private static TestableGraphDBOperation ope;
+ private static GraphDBOperation ope;
+
+ // Uncommitted actions executed in LinkStorageImpl
+ private static ArrayList<LinkEvent> actions;
+
+ // Dictionary of mock IPortObject to information of port
+ // -> Used to refer DPID from IPortObject
+ private static Map<IPortObject,PortInfo> mockToPortInfoMap;
+
+
+ // Links existing in virtual graph
+ private List<Link> links;
+
+ //================ Utility classes for logging actions in LinkStorageImpl ===========
+ private enum LinkEventType {
+ ADD, DELETE
+ }
+
+ private class LinkEvent {
+ private Long src_dpid = null;
+ private Long dst_dpid = null;
+ private Short src_port = null;
+ private Short dst_port = null;
+
+ public LinkEventType type;
+
+ public LinkEvent(Link link, LinkEventType type) {
+ this.src_dpid = link.getSrc();
+ this.src_port = link.getSrcPort();
+ this.dst_dpid = link.getDst();
+ this.dst_port = link.getDstPort();
+
+ this.type = type;
+ }
+
+ public Long getSrcDpid() { return src_dpid; }
+ public Short getSrcPort() { return src_port; }
+ public Long getDstDpid() { return dst_dpid; }
+ public Short getDstPort() { return dst_port; }
+ public LinkEventType getType() { return type; }
+ }
+
+ private class PortInfo {
+ public Long dpid = null;
+ public Short port = null;
+
+ public PortInfo(Long dpid, Short port) { this.dpid = dpid; this.port = port; }
+ }
/**
* Setup code called before each tests.
@@ -55,10 +106,13 @@
EasyMock.expect(GraphDBConnection.getInstance((String)EasyMock.anyObject())).andReturn(conn).anyTimes();
PowerMock.replay(GraphDBConnection.class);
- ope = new TestableGraphDBOperation();
- PowerMock.expectNew(GraphDBOperation.class, (GraphDBConnection)EasyMock.anyObject()).andReturn(ope).anyTimes();
+ ope = createMockGraphDBOperation();
+ PowerMock.expectNew(GraphDBOperation.class, new Class<?>[] {GraphDBConnection.class}, EasyMock.anyObject(GraphDBConnection.class)).andReturn(ope).anyTimes();
PowerMock.replay(GraphDBOperation.class);
-
+
+ actions = new ArrayList<LinkEvent>();
+ mockToPortInfoMap = new HashMap<IPortObject,PortInfo>();
+
linkStorage = new LinkStorageImpl();
linkStorage.init("/dummy/path/to/conf");
@@ -74,7 +128,6 @@
public void tearDown() throws Exception {
// finish code
linkStorage.close();
- ope.close();
}
// TODO: remove @Ignore after UPDATE method is implemented
@@ -104,6 +157,14 @@
//Use the link storage API to add the link
linkStorage.update(linkToCreate, ILinkStorage.DM_OPERATION.CREATE);
doTestLinkExist(linkToVerify);
+
+ // Avoiding duplication is out of scope. DBOperation is responsible for this.
+// // Add same link
+// Link linkToCreateTwice = createFeasibleLink();
+// linkStorage.update(linkToCreateTwice, ILinkStorage.DM_OPERATION.CREATE);
+//
+// // this occurs assertion failure if there are two links in titanGraph
+// doTestLinkIsInGraph(linkToVerify);
}
/**
@@ -145,6 +206,14 @@
for(Link l : linksToVerify) {
doTestLinkExist(l);
}
+
+ // Out of scope: DBOperation is responsible for avoiding duplication.
+// // Test creation of existing links
+// linksToCreate = createFeasibleLinks();
+// linkStorage.update(linksToCreate, ILinkStorage.DM_OPERATION.CREATE);
+// for(Link l : linksToVerify) {
+// doTestLinkIsInGraph(l);
+// }
}
/**
@@ -298,7 +367,7 @@
List<Link> list = linkStorage.getLinks(dpid, port);
- assertEquals(list.size(), 1);
+ assertEquals(1, list.size());
Link l = list.get(0);
assertEquals(l.getSrc(), linkToVerify.getSrc());
@@ -310,7 +379,7 @@
List<Link> list2 = linkStorage.getLinks(linkToVerifyNot.getSrc(), (short)linkToVerifyNot.getSrcPort());
- assertEquals(list2.size(), 0);
+ assertEquals(0, list2.size());
}
/**
@@ -398,25 +467,26 @@
}
/**
- * Test if specific link is existing
+ * Test if specific link exists
* @param link
*/
private void doTestLinkExist(Link link) {
- assertTrue(ope.hasLinkBetween(HexString.toHexString(link.getSrc()),
- link.getSrcPort(),
- HexString.toHexString(link.getDst()),
- link.getDstPort()));
+ int count = 0;
+ for(Link lt : links) {
+ if(lt.equals(link)) {
+ ++count;
+ }
+ }
+
+ assertTrue(count == 1);
}
/**
- * Test if titanGraph doesn't have specific link
+ * Test if specific link doesn't exist
* @param link
*/
private void doTestLinkNotExist(Link link) {
- assertFalse(ope.hasLinkBetween(HexString.toHexString(link.getSrc()),
- link.getSrcPort(),
- HexString.toHexString(link.getDst()),
- link.getDstPort()));
+ assertFalse(links.contains(link));
}
/**
@@ -426,6 +496,252 @@
private void doTestLinkHasStateOf(Link link, LinkInfo info) {
}
+ /**
+ * Class defines a function called back when IPortObject#removeLink is called.
+ * @author Naoki Shiota
+ *
+ */
+ private class RemoveLinkCallback implements IAnswer<Object> {
+ private long dpid;
+ private short port;
+ public RemoveLinkCallback(long dpid, short port) {
+ this.dpid = dpid; this.port = port;
+ }
+
+ @Override
+ public Object answer() throws Throwable {
+ IPortObject dstPort = (IPortObject) EasyMock.getCurrentArguments()[0];
+ PortInfo dst = mockToPortInfoMap.get(dstPort);
+
+ Link linkToRemove = new Link(this.dpid,this.port,dst.dpid,dst.port);
+ actions.add(new LinkEvent(linkToRemove,LinkEventType.DELETE));
+
+ return null;
+ }
+ }
+
+ /**
+ * Class defines a function called back when IPortObject#setLinkPort is called.
+ * @author Naoki Shiota
+ *
+ */
+ private class SetLinkPortCallback implements IAnswer<Object> {
+ private long dpid;
+ private short port;
+ public SetLinkPortCallback(long dpid, short port) {
+ this.dpid = dpid; this.port = port;
+ }
+
+ @Override
+ public Object answer() throws Throwable {
+ IPortObject dstPort = (IPortObject) EasyMock.getCurrentArguments()[0];
+ PortInfo dst = mockToPortInfoMap.get(dstPort);
+
+ Link linkToAdd = new Link(this.dpid,this.port,dst.dpid,dst.port);
+ actions.add(new LinkEvent(linkToAdd,LinkEventType.ADD));
+
+ return null;
+ }
+
+ }
+
+ /**
+ * Class defines a function called back when IPortObject#getSwitch is called.
+ * @author Naoki Shiota
+ *
+ */
+ private class GetSwitchCallback implements IAnswer<ISwitchObject> {
+ private long dpid;
+
+ public GetSwitchCallback(long dpid) {
+ this.dpid = dpid;
+ }
+
+ @Override
+ public ISwitchObject answer() throws Throwable {
+ ISwitchObject sw = createMockSwitch(dpid);
+ return sw;
+ }
+ }
+
+ /**
+ * Class defines a function called back when IPortObject#getLinkedPorts is called.
+ * @author Naoki Shiota
+ *
+ */
+ private class GetLinkedPortsCallback implements IAnswer< Iterable<IPortObject> > {
+ private long dpid;
+ private short port;
+
+ public GetLinkedPortsCallback(long dpid, short port) {
+ this.dpid = dpid;
+ this.port = port;
+ }
+
+ @Override
+ public Iterable<IPortObject> answer() throws Throwable {
+ List<IPortObject> ports = new ArrayList<IPortObject>();
+
+ for(Link lk : links) {
+ if(lk.getSrc() == dpid && lk.getSrcPort() == port) {
+ ports.add(createMockPort(lk.getDst(), lk.getDstPort()));
+ }
+ }
+
+ return ports;
+ }
+
+ }
+
+ /**
+ * Class defines a function called back when ISwitchObject#getPorts is called.
+ * @author Naoki Shiota
+ *
+ */
+ private class GetPortsCallback implements IAnswer< Iterable <IPortObject> > {
+ private long dpid;
+
+ public GetPortsCallback(long dpid) {
+ this.dpid = dpid;
+ }
+
+ @Override
+ public Iterable<IPortObject> answer() throws Throwable {
+ List<IPortObject> ports = new ArrayList<IPortObject>();
+
+ for(Short number : getPorts(dpid)) {
+ ports.add(createMockPort(dpid, number));
+ }
+
+ return ports;
+ }
+ }
+
+ // ------------------------Creation of Mock-----------------------------
+ /**
+ * Create a mock GraphDBOperation which hooks port-related methods.
+ * @return EasyMock-wrapped GraphDBOperation object.
+ */
+ @SuppressWarnings("serial")
+ private GraphDBOperation createMockGraphDBOperation() {
+ GraphDBOperation mockDBOpe = EasyMock.createNiceMock(GraphDBOperation.class);
+
+ // Mock searchPort() method to create new mock IPortObject.
+ EasyMock.expect(mockDBOpe.searchPort((String)EasyMock.anyObject(), EasyMock.anyShort())).
+ andAnswer(new IAnswer<IPortObject>() {
+ @Override
+ public IPortObject answer() throws Throwable {
+ long dpid = HexString.toLong((String)EasyMock.getCurrentArguments()[0]);
+ short port = (Short) EasyMock.getCurrentArguments()[1];
+ IPortObject ret = createMockPort(dpid,port);
+
+ return ret;
+ }
+ }).anyTimes();
+
+ // Mock searchSwitch() method to create new mock ISwitchObject.
+ EasyMock.expect(mockDBOpe.searchSwitch((String)EasyMock.anyObject())).
+ andAnswer(new IAnswer<ISwitchObject>() {
+ @Override
+ public ISwitchObject answer() throws Throwable {
+ long dpid = HexString.toLong((String)EasyMock.getCurrentArguments()[0]);
+ ISwitchObject ret = createMockSwitch(dpid);
+
+ return ret;
+ }
+ }).anyTimes();
+
+ // Mock getActiveSwitches() method to create list of mock ISwitchObject.
+ EasyMock.expect(mockDBOpe.getActiveSwitches()).andReturn(new ArrayList<ISwitchObject> () {{
+ for(Long dpid : getDpids()) {
+ add(createMockSwitch(dpid));
+ }
+ }}).anyTimes();
+
+ // Mock commit() method to commit change of link information
+ mockDBOpe.commit();
+ EasyMock.expectLastCall().andAnswer(new IAnswer<Object>() {
+ @Override
+ public Object answer() throws Throwable {
+ for(LinkEvent action : actions) {
+ if(action.getType().equals(LinkEventType.ADD)) {
+ Link linkToAdd = new Link(
+ action.getSrcDpid(),
+ action.getSrcPort(),
+ action.getDstDpid(),
+ action.getDstPort());
+ links.add(linkToAdd);
+ } else if(action.getType().equals(LinkEventType.DELETE)) {
+ Link linkToRemove = new Link(
+ action.getSrcDpid(),
+ action.getSrcPort(),
+ action.getDstDpid(),
+ action.getDstPort());
+ links.remove(linkToRemove);
+ } else {
+ log.error("mock commit(): unexpected action {}", new Object[]{action.getType()});
+ }
+ }
+ actions.clear();
+ return null;
+ }
+ }).atLeastOnce();
+
+ EasyMock.replay(mockDBOpe);
+ return mockDBOpe;
+ }
+
+ /**
+ * Create a mock IPortObject using given DPID and port number.
+ * IPortObject can't store DPID, so DPID is stored to mockToPortInfoMap for later use.
+ * Duplication is not checked.
+ * @param dpid DPID of a port
+ * @param number Port Number
+ * @return EasyMock-wrapped IPortObject
+ */
+ private IPortObject createMockPort(long dpid, short number) {
+ IPortObject mockPort = EasyMock.createNiceMock(IPortObject.class);
+
+ EasyMock.expect(mockPort.getNumber()).andReturn(number);
+
+ // Mock removeLink() method
+ mockPort.removeLink((IPortObject) EasyMock.anyObject());
+ EasyMock.expectLastCall().andAnswer(new RemoveLinkCallback(dpid, number)).anyTimes();
+
+ // Mock setLinkPort() method
+ mockPort.setLinkPort((IPortObject) EasyMock.anyObject());
+ EasyMock.expectLastCall().andAnswer(new SetLinkPortCallback(dpid, number)).anyTimes();
+
+ // Mock getLinkPorts() method
+ EasyMock.expect(mockPort.getLinkedPorts()).andAnswer(new GetLinkedPortsCallback(dpid, number)).anyTimes();
+
+ // Mock getSwitch() method
+ EasyMock.expect(mockPort.getSwitch()).andAnswer(new GetSwitchCallback(dpid)).anyTimes();
+
+ mockToPortInfoMap.put(mockPort, new PortInfo(dpid,number));
+ EasyMock.replay(mockPort);
+
+ return mockPort;
+ }
+
+ /**
+ * Create a mock ISwitchObject using given DPID number.
+ * Duplication is not checked.
+ * @param dpid DPID of a switch
+ * @return EasyMock-wrapped ISwitchObject
+ */
+ private ISwitchObject createMockSwitch(long dpid) {
+ ISwitchObject mockSw = EasyMock.createNiceMock(ISwitchObject.class);
+
+ EasyMock.expect(mockSw.getPorts()).andAnswer(new GetPortsCallback(dpid)).anyTimes();
+ EasyMock.expect(mockSw.getDPID()).andReturn(HexString.toHexString(dpid)).anyTimes();
+ EasyMock.expect(mockSw.getState()).andReturn("ACTIVE").anyTimes();
+
+ EasyMock.replay(mockSw);
+ return mockSw;
+ }
+
+
//----------------- Creation of test data -----------------------
// Assume a network shown below.
//
@@ -441,38 +757,61 @@
// dpid2 : 00:00:00:00:0a:02
// dpid3 : 00:00:00:00:0a:03
+ /**
+ * Initialize links member to represent test topology above.
+ */
private void initLinks() {
- final String dpid1 = "00:00:00:00:0a:01";
- final String dpid2 = "00:00:00:00:0a:02";
- final String dpid3 = "00:00:00:00:0a:03";
+ links = new ArrayList<Link>();
- ope.createNewSwitchForTest(dpid1).setStateForTest("ACTIVE");
- ope.createNewSwitchForTest(dpid2).setStateForTest("ACTIVE");
- ope.createNewSwitchForTest(dpid3).setStateForTest("ACTIVE");
-
- TestPortObject ports1 [] = {
- ope.createNewPortForTest(dpid1, (short)1),
- ope.createNewPortForTest(dpid1, (short)2),
- ope.createNewPortForTest(dpid1, (short)3),
- ope.createNewPortForTest(dpid1, (short)4),
- };
-
- TestPortObject ports2 [] = {
- ope.createNewPortForTest(dpid2, (short)1),
- ope.createNewPortForTest(dpid2, (short)2),
- };
-
- TestPortObject ports3 [] = {
- ope.createNewPortForTest(dpid3, (short)1),
- ope.createNewPortForTest(dpid3, (short)2),
- };
-
- ope.setLinkBetweenPortsForTest(ports1[0], ports2[0]);
- ope.setLinkBetweenPortsForTest(ports1[3], ports3[1]);
+ links.add(new Link(Long.decode("0x0000000000000a01"), 1, Long.decode("0x0000000000000a02"), 1));
+ links.add(new Link(Long.decode("0x0000000000000a01"), 4, Long.decode("0x0000000000000a03"), 2));
}
/**
- * Returns new Link object of existing link
+ * Returns list of port number attached to the switch specified by given DPID.
+ * @param dpid DPID of the switch
+ * @return List of port number
+ */
+ @SuppressWarnings("serial")
+ private List<Short> getPorts(long dpid) {
+ List<Short> ports;
+
+ if(dpid == Long.decode("0x0000000000000a01")) {
+ ports = new ArrayList<Short>() {{
+ add((short)1);
+ add((short)2);
+ add((short)3);
+ add((short)4);
+ }};
+ } else if(dpid == Long.decode("0x0000000000000a02") || dpid == Long.decode("0x0000000000000a03")) {
+ ports = new ArrayList<Short>() {{
+ add((short)1);
+ add((short)2);
+ }};
+ } else {
+ ports = new ArrayList<Short>();
+ }
+
+ return ports;
+ }
+
+ /**
+ * Returns list of DPIDs in test topology.
+ * @return List of DPIDs
+ */
+ @SuppressWarnings("serial")
+ private List<Long> getDpids() {
+ List<Long> dpids = new ArrayList<Long>() {{
+ add(Long.decode("0x0000000000000a01"));
+ add(Long.decode("0x0000000000000a02"));
+ add(Long.decode("0x0000000000000a03"));
+ }};
+
+ return dpids;
+ }
+
+ /**
+ * Returns new Link object of an existing link
* @return new Link object
*/
private Link createExistingLink() {
@@ -480,7 +819,7 @@
}
/**
- * Returns new Link object of not-existing but feasible link
+ * Returns new Link object of a not-existing but feasible link
* @return new Link object
*/
private Link createFeasibleLink() {
diff --git a/start-cassandra.sh b/start-cassandra.sh
index ffc21e4..3bc62e4 100755
--- a/start-cassandra.sh
+++ b/start-cassandra.sh
@@ -30,6 +30,7 @@
# Run cassandra
echo "Starting cassandra"
+ cp ${ONOS_HOME}/conf/cassandra.yaml $CASSANDRA_DIR/conf
$CASSANDRA_DIR/bin/cassandra > $CASSANDRA_LOG 2>&1
}
diff --git a/start-zk.sh b/start-zk.sh
index 26db2fa..4e1134e 100755
--- a/start-zk.sh
+++ b/start-zk.sh
@@ -8,7 +8,9 @@
function start {
# Run Zookeeper with our configuration
echo "Starting Zookeeper"
- $ZK_DIR/bin/zkServer.sh start $ZK_CONF
+ cp $ZK_CONF $ZK_DIR/conf
+ echo "cp $ZK_CONF $ZK_DIR/conf"
+ $ZK_DIR/bin/zkServer.sh start
}
function stop {
diff --git a/titan/schema/dbapi-testdata.graphml b/titan/schema/dbapi-testdata.graphml
index fbf7e2b..952a62a 100644
--- a/titan/schema/dbapi-testdata.graphml
+++ b/titan/schema/dbapi-testdata.graphml
@@ -1 +1 @@
-<?xml version=\"1.0\" ?><graphml xmlns=\"http://graphml.graphdrawing.org/xmlns\"> <key id=\"id\" for=\"node\" attr.name=\"id\" attr.type=\"string\"></key> <key id=\"type\" for=\"node\" attr.name=\"type\" attr.type=\"string\"></key> <key id=\"dpid\" for=\"node\" attr.name=\"dpid\" attr.type=\"string\"></key> <key id=\"desc\" for=\"node\" attr.name=\"desc\" attr.type=\"string\"></key> <key id=\"number\" for=\"node\" attr.name=\"number\" attr.type=\"int\"></key> <key id=\"dl_addr\" for=\"node\" attr.name=\"dl_addr\" attr.type=\"string\"></key> <key id=\"nw_addr\" for=\"node\" attr.name=\"nw_addr\" attr.type=\"string\"></key> <key id=\"id\" for=\"edge\" attr.name=\"id\" attr.type=\"string\"></key> <key id=\"source\" for=\"edge\" attr.name=\"source\" attr.type=\"string\"></key> <key id=\"target\" for=\"edge\" attr.name=\"target\" attr.type=\"string\"></key> <key id=\"label\" for=\"edge\" attr.name=\"label\" attr.type=\"string\"></key> <graph id=\"G\" edgedefault=\"directed\"> <node id=\"1\"> <data key=\"type\">switch</data> <data key=\"dpid\">00:00:00:00:00:00:0a:01</data> <data key=\"desc\">OpenFlow Switch at SEA</data> </node> <node id=\"2\"> <data key=\"type\">switch</data> <data key=\"dpid\">00:00:00:00:00:00:0a:02</data> <data key=\"desc\">OpenFlow Switch at LAX</data> </node> <node id=\"3\"> <data key=\"type\">switch</data> <data key=\"dpid\">00:00:00:00:00:00:0a:03</data> <data key=\"desc\">OpenFlow Switch at CHI</data> </node> <node id=\"4\"> <data key=\"type\">switch</data> <data key=\"dpid\">00:00:00:00:00:00:0a:04</data> <data key=\"desc\">OpenFlow Switch at IAH</data> </node> <node id=\"5\"> <data key=\"type\">switch</data> <data key=\"dpid\">00:00:00:00:00:00:0a:05</data> <data key=\"desc\">OpenFlow Switch at NYC</data> </node> <node id=\"6\"> <data key=\"type\">switch</data> <data key=\"dpid\">00:00:00:00:00:00:0a:06</data> <data key=\"desc\">OpenFlow Switch at ATL</data> </node> <node id=\"100\"> <data key=\"type\">port</data> <data key=\"number\">1</data> <data key=\"desc\">port 1 at SEA Switch</data> </node> <node id=\"101\"> <data key=\"type\">port</data> <data key=\"number\">2</data> <data key=\"desc\">port 2 at SEA Switch</data> </node> <node id=\"102\"> <data key=\"type\">port</data> <data key=\"number\">3</data> <data key=\"desc\">port 3 at SEA Switch</data> </node> <node id=\"103\"> <data key=\"type\">port</data> <data key=\"number\">4</data> <data key=\"desc\">port 4 at SEA Switch</data> </node> <node id=\"104\"> <data key=\"type\">port</data> <data key=\"number\">1</data> <data key=\"desc\">port 1 at LAX Switch</data> </node> <node id=\"105\"> <data key=\"type\">port</data> <data key=\"number\">2</data> <data key=\"desc\">port 2 at LAX Switch</data> </node> <node id=\"106\"> <data key=\"type\">port</data> <data key=\"number\">3</data> <data key=\"desc\">port 3 at LAX Switch</data> </node> <node id=\"107\"> <data key=\"type\">port</data> <data key=\"number\">1</data> <data key=\"desc\">port 1 at CHI Switch</data> </node> <node id=\"108\"> <data key=\"type\">port</data> <data key=\"number\">2</data> <data key=\"desc\">port 2 at CHI Switch</data> </node> <node id=\"109\"> <data key=\"type\">port</data> <data key=\"number\">3</data> <data key=\"desc\">port 3 at CHI Switch</data> </node> <node id=\"110\"> <data key=\"type\">port</data> <data key=\"number\">4</data> <data key=\"desc\">port 4 at CHI Switch</data> </node> <node id=\"111\"> <data key=\"type\">port</data> <data key=\"number\">1</data> <data key=\"desc\">port 1 at IAH Switch</data> </node> <node id=\"112\"> <data key=\"type\">port</data> <data key=\"number\">2</data> <data key=\"desc\">port 2 at IAH Switch</data> </node> <node id=\"113\"> <data key=\"type\">port</data> <data key=\"number\">3</data> <data key=\"desc\">port 3 at IAH Switch</data> </node> <node id=\"114\"> <data key=\"type\">port</data> <data key=\"number\">1</data> <data key=\"desc\">port 1 at NYC Switch</data> </node> <node id=\"115\"> <data key=\"type\">port</data> <data key=\"number\">2</data> <data key=\"desc\">port 2 at NYC Switch</data> </node> <node id=\"116\"> <data key=\"type\">port</data> <data key=\"number\">3</data> <data key=\"desc\">port 3 at NYC Switch</data> </node> <node id=\"117\"> <data key=\"type\">port</data> <data key=\"number\">1</data> <data key=\"desc\">port 1 at ATL Switch</data> </node> <node id=\"118\"> <data key=\"type\">port</data> <data key=\"number\">2</data> <data key=\"desc\">port 2 at ATL Switch</data> </node> <node id=\"119\"> <data key=\"type\">port</data> <data key=\"number\">3</data> <data key=\"desc\">port 3 at ATL Switch</data> </node> <node id=\"1000\"> <data key=\"type\">device</data> <data key=\"dl_addr\">20:c9:d0:4a:e1:73</data> <data key=\"nw_addr\">192.168.10.101</data> </node> <node id=\"1001\"> <data key=\"type\">device</data> <data key=\"dl_addr\">20:c9:d0:4a:e1:62</data> <data key=\"nw_addr\">192.168.20.101</data> </node> <node id=\"1002\"> <data key=\"type\">device</data> <data key=\"dl_addr\">10:40:f3:e6:8d:55</data> <data key=\"nw_addr\">192.168.10.1</data> </node> <node id=\"1003\"> <data key=\"type\">device</data> <data key=\"dl_addr\">a0:b3:cc:9c:c6:88</data> <data key=\"nw_addr\">192.168.20.1</data> </node> <node id=\"1004\"> <data key=\"type\">device</data> <data key=\"dl_addr\">00:04:20:e2:50:a2</data> <data key=\"nw_addr\">192.168.30.1</data> </node> <node id=\"1005\"> <data key=\"type\">device</data> <data key=\"dl_addr\">58:55:ca:c4:1b:a0</data> <data key=\"nw_addr\">192.168.40.1</data> </node> <edge id=\"10000\" source=\"1\" target=\"101\" label=\"on\"></edge> <edge id=\"10001\" source=\"1\" target=\"102\" label=\"on\"></edge> <edge id=\"10002\" source=\"1\" target=\"103\" label=\"on\"></edge> <edge id=\"10003\" source=\"2\" target=\"104\" label=\"on\"></edge> <edge id=\"10004\" source=\"2\" target=\"105\" label=\"on\"></edge> <edge id=\"10005\" source=\"2\" target=\"106\" label=\"on\"></edge> <edge id=\"10006\" source=\"3\" target=\"107\" label=\"on\"></edge> <edge id=\"10007\" source=\"3\" target=\"108\" label=\"on\"></edge> <edge id=\"10008\" source=\"3\" target=\"109\" label=\"on\"></edge> <edge id=\"10009\" source=\"3\" target=\"110\" label=\"on\"></edge> <edge id=\"10010\" source=\"4\" target=\"111\" label=\"on\"></edge> <edge id=\"10011\" source=\"4\" target=\"112\" label=\"on\"></edge> <edge id=\"10012\" source=\"4\" target=\"113\" label=\"on\"></edge> <edge id=\"10013\" source=\"5\" target=\"114\" label=\"on\"></edge> <edge id=\"10014\" source=\"5\" target=\"115\" label=\"on\"></edge> <edge id=\"10015\" source=\"5\" target=\"116\" label=\"on\"></edge> <edge id=\"10016\" source=\"6\" target=\"117\" label=\"on\"></edge> <edge id=\"10017\" source=\"6\" target=\"118\" label=\"on\"></edge> <edge id=\"10018\" source=\"6\" target=\"119\" label=\"on\"></edge> <edge id=\"11000\" source=\"101\" target=\"107\" label=\"link\"></edge> <edge id=\"11003\" source=\"105\" target=\"111\" label=\"link\"></edge> <edge id=\"11004\" source=\"107\" target=\"101\" label=\"link\"></edge> <edge id=\"11005\" source=\"108\" target=\"112\" label=\"link\"></edge> <edge id=\"11006\" source=\"109\" target=\"114\" label=\"link\"></edge> <edge id=\"11007\" source=\"111\" target=\"105\" label=\"link\"></edge> <edge id=\"11008\" source=\"112\" target=\"108\" label=\"link\"></edge> <edge id=\"11009\" source=\"113\" target=\"117\" label=\"link\"></edge> <edge id=\"11010\" source=\"114\" target=\"109\" label=\"link\"></edge> <edge id=\"11011\" source=\"115\" target=\"118\" label=\"link\"></edge> <edge id=\"11012\" source=\"117\" target=\"113\" label=\"link\"></edge> <edge id=\"11013\" source=\"118\" target=\"115\" label=\"link\"></edge> <edge id=\"12000\" source=\"103\" target=\"1000\" label=\"host\"></edge> <edge id=\"12001\" source=\"103\" target=\"1001\" label=\"host\"></edge> <edge id=\"12002\" source=\"110\" target=\"1002\" label=\"host\"></edge> <edge id=\"12003\" source=\"116\" target=\"1003\" label=\"host\"></edge> <edge id=\"12004\" source=\"106\" target=\"1004\" label=\"host\"></edge> <edge id=\"12005\" source=\"119\" target=\"1005\" label=\"host\"></edge> </graph> </graphml>
\ No newline at end of file
+<?xml version=\"1.0\" ?><graphml xmlns=\"http://graphml.graphdrawing.org/xmlns\"> <key id=\"id\" for=\"node\" attr.name=\"id\" attr.type=\"string\"></key> <key id=\"type\" for=\"node\" attr.name=\"type\" attr.type=\"string\"></key> <key id=\"dpid\" for=\"node\" attr.name=\"dpid\" attr.type=\"string\"></key> <key id=\"desc\" for=\"node\" attr.name=\"desc\" attr.type=\"string\"></key> <key id=\"number\" for=\"node\" attr.name=\"number\" attr.type=\"int\"></key> <key id=\"dl_add\" for=\"node\" attr.name=\"dl_addr\" attr.type=\"string\"></key> <key id=\"nw_addr\" for=\"node\" attr.name=\"nw_addr\" attr.type=\"string\"></key> <key id=\"id\" for=\"edge\" attr.name=\"id\" attr.type=\"string\"></key> <key id=\"source\" for=\"edge\" attr.name=\"source\" attr.type=\"string\"></key> <key id=\"target\" for=\"edge\" attr.name=\"target\" attr.type=\"string\"></key> <key id=\"label\" for=\"edge\" attr.name=\"label\" attr.type=\"string\"></key> <graph id=\"G\" edgedefault=\"directed\"> <node id=\"1\"> <data key=\"type\">switch</data> <data key=\"dpid\">00:00:00:00:00:00:0a:01</data> <data key=\"desc\">OpenFlow Switch at SEA</data> </node> <node id=\"2\"> <data key=\"type\">switch</data> <data key=\"dpid\">00:00:00:00:00:00:0a:02</data> <data key=\"desc\">OpenFlow Switch at LAX</data> </node> <node id=\"3\"> <data key=\"type\">switch</data> <data key=\"dpid\">00:00:00:00:00:00:0a:03</data> <data key=\"desc\">OpenFlow Switch at CHI</data> </node> <node id=\"4\"> <data key=\"type\">switch</data> <data key=\"dpid\">00:00:00:00:00:00:0a:04</data> <data key=\"desc\">OpenFlow Switch at IAH</data> </node> <node id=\"5\"> <data key=\"type\">switch</data> <data key=\"dpid\">00:00:00:00:00:00:0a:05</data> <data key=\"desc\">OpenFlow Switch at NYC</data> </node> <node id=\"6\"> <data key=\"type\">switch</data> <data key=\"dpid\">00:00:00:00:00:00:0a:06</data> <data key=\"desc\">OpenFlow Switch at ATL</data> </node> <node id=\"100\"> <data key=\"type\">port</data> <data key=\"number\">1</data> <data key=\"desc\">port 1 at SEA Switch</data> </node> <node id=\"101\"> <data key=\"type\">port</data> <data key=\"number\">2</data> <data key=\"desc\">port 2 at SEA Switch</data> </node> <node id=\"102\"> <data key=\"type\">port</data> <data key=\"number\">3</data> <data key=\"desc\">port 3 at SEA Switch</data> </node> <node id=\"103\"> <data key=\"type\">port</data> <data key=\"number\">4</data> <data key=\"desc\">port 4 at SEA Switch</data> </node> <node id=\"104\"> <data key=\"type\">port</data> <data key=\"number\">1</data> <data key=\"desc\">port 1 at LAX Switch</data> </node> <node id=\"105\"> <data key=\"type\">port</data> <data key=\"number\">2</data> <data key=\"desc\">port 2 at LAX Switch</data> </node> <node id=\"106\"> <data key=\"type\">port</data> <data key=\"number\">3</data> <data key=\"desc\">port 3 at LAX Switch</data> </node> <node id=\"107\"> <data key=\"type\">port</data> <data key=\"number\">1</data> <data key=\"desc\">port 1 at CHI Switch</data> </node> <node id=\"108\"> <data key=\"type\">port</data> <data key=\"number\">2</data> <data key=\"desc\">port 2 at CHI Switch</data> </node> <node id=\"109\"> <data key=\"type\">port</data> <data key=\"number\">3</data> <data key=\"desc\">port 3 at CHI Switch</data> </node> <node id=\"110\"> <data key=\"type\">port</data> <data key=\"number\">4</data> <data key=\"desc\">port 4 at CHI Switch</data> </node> <node id=\"111\"> <data key=\"type\">port</data> <data key=\"number\">1</data> <data key=\"desc\">port 1 at IAH Switch</data> </node> <node id=\"112\"> <data key=\"type\">port</data> <data key=\"number\">2</data> <data key=\"desc\">port 2 at IAH Switch</data> </node> <node id=\"113\"> <data key=\"type\">port</data> <data key=\"number\">3</data> <data key=\"desc\">port 3 at IAH Switch</data> </node> <node id=\"114\"> <data key=\"type\">port</data> <data key=\"number\">1</data> <data key=\"desc\">port 1 at NYC Switch</data> </node> <node id=\"115\"> <data key=\"type\">port</data> <data key=\"number\">2</data> <data key=\"desc\">port 2 at NYC Switch</data> </node> <node id=\"116\"> <data key=\"type\">port</data> <data key=\"number\">3</data> <data key=\"desc\">port 3 at NYC Switch</data> </node> <node id=\"117\"> <data key=\"type\">port</data> <data key=\"number\">1</data> <data key=\"desc\">port 1 at ATL Switch</data> </node> <node id=\"118\"> <data key=\"type\">port</data> <data key=\"number\">2</data> <data key=\"desc\">port 2 at ATL Switch</data> </node> <node id=\"119\"> <data key=\"type\">port</data> <data key=\"number\">3</data> <data key=\"desc\">port 3 at ATL Switch</data> </node> <node id=\"1000\"> <data key=\"type\">device</data> <data key=\"dl_addr\">20:c9:d0:4a:e1:73</data> <data key=\"nw_addr\">192.168.10.101</data> </node> <node id=\"1001\"> <data key=\"type\">device</data> <data key=\"dl_addr\">20:c9:d0:4a:e1:62</data> <data key=\"nw_addr\">192.168.20.101</data> </node> <node id=\"1002\"> <data key=\"type\">device</data> <data key=\"dl_addr\">10:40:f3:e6:8d:55</data> <data key=\"nw_addr\">192.168.10.1</data> </node> <node id=\"1003\"> <data key=\"type\">device</data> <data key=\"dl_addr\">a0:b3:cc:9c:c6:88</data> <data key=\"nw_addr\">192.168.20.1</data> </node> <node id=\"1004\"> <data key=\"type\">device</data> <data key=\"dl_addr\">00:04:20:e2:50:a2</data> <data key=\"nw_addr\">192.168.30.1</data> </node> <node id=\"1005\"> <data key=\"type\">device</data> <data key=\"dl_addr\">58:55:ca:c4:1b:a0</data> <data key=\"nw_addr\">192.168.40.1</data> </node> <edge id=\"10000\" source=\"1\" target=\"101\" label=\"on\"></edge> <edge id=\"10001\" source=\"1\" target=\"102\" label=\"on\"></edge> <edge id=\"10002\" source=\"1\" target=\"103\" label=\"on\"></edge> <edge id=\"10003\" source=\"2\" target=\"104\" label=\"on\"></edge> <edge id=\"10004\" source=\"2\" target=\"105\" label=\"on\"></edge> <edge id=\"10005\" source=\"2\" target=\"106\" label=\"on\"></edge> <edge id=\"10006\" source=\"3\" target=\"107\" label=\"on\"></edge> <edge id=\"10007\" source=\"3\" target=\"108\" label=\"on\"></edge> <edge id=\"10008\" source=\"3\" target=\"109\" label=\"on\"></edge> <edge id=\"10009\" source=\"3\" target=\"110\" label=\"on\"></edge> <edge id=\"10010\" source=\"4\" target=\"111\" label=\"on\"></edge> <edge id=\"10011\" source=\"4\" target=\"112\" label=\"on\"></edge> <edge id=\"10012\" source=\"4\" target=\"113\" label=\"on\"></edge> <edge id=\"10013\" source=\"5\" target=\"114\" label=\"on\"></edge> <edge id=\"10014\" source=\"5\" target=\"115\" label=\"on\"></edge> <edge id=\"10015\" source=\"5\" target=\"116\" label=\"on\"></edge> <edge id=\"10016\" source=\"6\" target=\"117\" label=\"on\"></edge> <edge id=\"10017\" source=\"6\" target=\"118\" label=\"on\"></edge> <edge id=\"10018\" source=\"6\" target=\"119\" label=\"on\"></edge> <edge id=\"11000\" source=\"101\" target=\"107\" label=\"link\"></edge> <edge id=\"11003\" source=\"105\" target=\"111\" label=\"link\"></edge> <edge id=\"11004\" source=\"107\" target=\"101\" label=\"link\"></edge> <edge id=\"11005\" source=\"108\" target=\"112\" label=\"link\"></edge> <edge id=\"11006\" source=\"109\" target=\"114\" label=\"link\"></edge> <edge id=\"11007\" source=\"111\" target=\"105\" label=\"link\"></edge> <edge id=\"11008\" source=\"112\" target=\"108\" label=\"link\"></edge> <edge id=\"11009\" source=\"113\" target=\"117\" label=\"link\"></edge> <edge id=\"11010\" source=\"114\" target=\"109\" label=\"link\"></edge> <edge id=\"11011\" source=\"115\" target=\"118\" label=\"link\"></edge> <edge id=\"11012\" source=\"117\" target=\"113\" label=\"link\"></edge> <edge id=\"11013\" source=\"118\" target=\"115\" label=\"link\"></edge> <edge id=\"12000\" source=\"103\" target=\"1000\" label=\"host\"></edge> <edge id=\"12001\" source=\"103\" target=\"1001\" label=\"host\"></edge> <edge id=\"12002\" source=\"110\" target=\"1002\" label=\"host\"></edge> <edge id=\"12003\" source=\"116\" target=\"1003\" label=\"host\"></edge> <edge id=\"12004\" source=\"106\" target=\"1004\" label=\"host\"></edge> <edge id=\"12005\" source=\"119\" target=\"1005\" label=\"host\"></edge> </graph> </graphml>
diff --git a/titan/schema/test-network.xml b/titan/schema/test-network.xml
index a03a99c..5c63d90 100644
--- a/titan/schema/test-network.xml
+++ b/titan/schema/test-network.xml
@@ -234,4 +234,4 @@
<edge id="12004" source="106" target="1004" label="host"></edge>
<edge id="12005" source="119" target="1005" label="host"></edge>
</graph>
-</graphml>
\ No newline at end of file
+</graphml>