Simon Hunt

Oops! Fix updateLink() function in topology view.

(also add linkupdate scenario).

Change-Id: Ic0f6753745e43c5fc76a6cb180a0c8a66178c657
......@@ -230,7 +230,7 @@
d = result.ldata;
if (bad) {
//logicError(bad + ': ' + link.id);
$log.debug(bad + ': ' + link.id);
return;
}
......@@ -255,10 +255,10 @@
var result = tms.findLink(data, 'update'),
bad = result.badLogic;
if (bad) {
//logicError(bad + ': ' + link.id);
$log.debug(bad + ': ' + link.id);
return;
}
result.updateWith(link);
result.updateWith(data);
}
function removeLink(data) {
......
{
"event": "removeLink",
"payload": {
"id": "of:000000000000000a/1-of:000000000000000b/2",
"type": "direct",
"online": true,
"linkWidth": 1.2,
"src": "of:000000000000000a",
"srcPort": "1",
"dst": "of:000000000000000b",
"dstPort": "2"
}
}
{
"event": "removeLink",
"payload": {
"id": "of:000000000000000b/2-of:000000000000000a/1",
"type": "direct",
"online": true,
"linkWidth": 1.2,
"src": "of:000000000000000b",
"srcPort": "2",
"dst": "of:000000000000000a",
"dstPort": "1"
}
}
{
"event": "addInstance",
"payload": {
"id": "onos",
"ip": "192.168.56.101",
"online": true,
"uiAttached": true,
"switches": 2,
"labels": [
"onos",
"192.168.56.101"
]
}
}
{
"event": "addDevice",
"payload": {
"id": "of:000000000000000a",
"type": "switch",
"online": true,
"master": "onos",
"labels": [
"",
"sw-A",
"000000000000000a"
],
"metaUi": {
"x": 300,
"y": 300
}
}
}
{
"event": "addDevice",
"payload": {
"id": "of:000000000000000b",
"type": "switch",
"online": true,
"master": "onos",
"labels": [
"",
"sw-B",
"000000000000000b"
],
"metaUi": {
"x": 500,
"y": 310
}
}
}
{
"event": "addLink",
"payload": {
"id": "of:000000000000000a/1-of:000000000000000b/2",
"type": "direct",
"online": true,
"linkWidth": 1.2,
"src": "of:000000000000000a",
"srcPort": "1",
"dst": "of:000000000000000b",
"dstPort": "2"
}
}
{
"event": "addLink",
"payload": {
"id": "of:000000000000000b/2-of:000000000000000a/1",
"type": "direct",
"online": true,
"linkWidth": 1.2,
"src": "of:000000000000000b",
"srcPort": "2",
"dst": "of:000000000000000a",
"dstPort": "1"
}
}
{
"event": "updateLink",
"payload": {
"id": "of:000000000000000a/1-of:000000000000000b/2",
"type": "direct",
"online": false,
"linkWidth": 1.2,
"src": "of:000000000000000a",
"srcPort": "1",
"dst": "of:000000000000000b",
"dstPort": "2"
}
}
{
"event": "updateLink",
"payload": {
"id": "of:000000000000000b/2-of:000000000000000a/1",
"type": "direct",
"online": false,
"linkWidth": 1.2,
"src": "of:000000000000000b",
"srcPort": "2",
"dst": "of:000000000000000a",
"dstPort": "1"
}
}
{
"event": "updateLink",
"payload": {
"id": "of:000000000000000a/1-of:000000000000000b/2",
"type": "direct",
"online": true,
"linkWidth": 1.2,
"src": "of:000000000000000a",
"srcPort": "1",
"dst": "of:000000000000000b",
"dstPort": "2"
}
}
{
"event": "updateLink",
"payload": {
"id": "of:000000000000000b/2-of:000000000000000a/1",
"type": "direct",
"online": true,
"linkWidth": 1.2,
"src": "of:000000000000000b",
"srcPort": "2",
"dst": "of:000000000000000a",
"dstPort": "1"
}
}
{
"title": "Link Update scenario",
"description": [
"Add two devices and one link (auto).",
"Send a couple of updateLink events."
],
"params": {
"lastAuto": 5
}
}