"currentHelper": "normal",
"helperAttributes": {},
"time": 1454572576470,
- "name": "Add a QpS entry to a qos-entries list",
+ "name": "Add a QoS entry to a qos-entries list",
"description": "This restconf request will create or update a Qos entry for the ovsdb node 'HOST1'.",
"collectionId": "b96ed27e-7aee-47e1-daa6-e3dbe3f176af",
"responses": [],
"responses": [],
"rawModeData": "\r\n {\r\n \"node\": [\r\n {\r\n \"node-id\": \"ovsdb:HOST1\",\r\n \"connection-info\": {\r\n \"ovsdb:remote-ip\": \"{{HYPERVISOR-IP}}\",\r\n \"ovsdb:remote-port\": \"{{HYPERVISOR-OVSDB-PORT}}\"\r\n }\r\n }\r\n ]\r\n }\r\n"
},
- {
- "id": "4298de9f-d2e0-a7c0-da4b-71ce9ecc7260",
- "headers": "Authorization: Basic YWRtaW46YWRtaW4=\nContent-Type: application/json\nAccept: application/json\n",
- "url": "http://{{CONTROLLER-IP}}:8181/restconf/config/network-topology:network-topology/topology/ovsdb:1/node/ovsdb:HOST1%2Fbridge%2Fbr-test/termination-point/testport/",
- "preRequestScript": "",
- "pathVariables": {},
- "method": "PUT",
- "data": [],
- "dataMode": "raw",
- "version": 2,
- "tests": "",
- "currentHelper": "normal",
- "helperAttributes": {},
- "time": 1454572769501,
- "name": "Add existing QoS UUID to existing termination point (deprecated)",
- "description": "This restconf request will specify the UUID of a Qos entry to associate with a port.\n\nThe Qos UUID is the actual operational value of a Qos entry.\n\nNote: The QoS model also has a QoS ID. The preferred method for associating a QoS entry to a termination point is to use the QoS ID.",
- "collectionId": "b96ed27e-7aee-47e1-daa6-e3dbe3f176af",
- "responses": [],
- "rawModeData": "{\n \"network-topology:termination-point\": [\n \t{\n \t \t\t\"ovsdb:name\": \"testport\",\n \t\t\t\"tp-id\": \"testport\",\n \t\t\t\"qos\": \"4126e461-020d-497d-97b7-c8f409d1c9b9\"\n \t\t}\n ]\n}"
- },
{
"id": "479d3281-ac30-3b30-d727-80b0b8505140",
"headers": "Authorization: Basic YWRtaW46YWRtaW4=\nContent-Type: application/json\n",
"helperAttributes": {},
"rawModeData": "{\n \"network-topology:termination-point\": [\n \t{\n\t \t\t\"ovsdb:name\": \"testport\",\n \t\t\t\"tp-id\": \"testport\",\n \"ovsdb:ingress-policing-rate\": 1000,\n \"ovsdb:ingress-policing-burst\": 2000\n\t\t}\n ]\n}"
},
- {
- "id": "8ff38d91-00ee-e7c6-ef1a-e3d236f59641",
- "headers": "Authorization: Basic YWRtaW46YWRtaW4=\nContent-Type: application/json\nAccept: application/json\n",
- "url": "http://{{CONTROLLER-IP}}:8181/restconf/config/network-topology:network-topology/topology/ovsdb:1/node/ovsdb:HOST1%2Fbridge%2Fbr-test/termination-point/testport/",
- "preRequestScript": "",
- "pathVariables": {},
- "method": "PUT",
- "data": [],
- "dataMode": "raw",
- "version": 2,
- "tests": "",
- "currentHelper": "normal",
- "helperAttributes": {},
- "time": 1454572787173,
- "name": "Delete a QoS UUID from a termination point (deprecated)",
- "description": "This restconf request will delete a Qos entry from a port (termination point).\n\nNote - this is done by doing a PUT operation on the termination port with the Qos\nentry cleared.\n\nNote - The model now provides a QoS entry list (max number of one entry) as part of the termination point model. This allows perfroaming a DELETE operation on the list entry instead of doing a PUT on the termination point.",
- "collectionId": "b96ed27e-7aee-47e1-daa6-e3dbe3f176af",
- "responses": [],
- "rawModeData": "{\n \"network-topology:termination-point\": [\n \t{\n \t \t\t\"ovsdb:name\": \"testport\",\n \t\t\t\"tp-id\": \"testport\"\n \t\t}\n ]\n}"
- },
{
"id": "9aa6926b-70db-1d22-dc30-db269e424bec",
"headers": "Authorization: Basic YWRtaW46YWRtaW4=\n",
import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType;
import org.opendaylight.controller.mdsal.it.base.AbstractMdsalTestBase;
import org.opendaylight.ovsdb.lib.notation.Version;
+import org.opendaylight.ovsdb.schema.openvswitch.Queue;
import org.opendaylight.ovsdb.southbound.SouthboundConstants;
import org.opendaylight.ovsdb.southbound.SouthboundMapper;
import org.opendaylight.ovsdb.southbound.SouthboundUtil;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.rev150105.OvsdbFailModeBase;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.rev150105.OvsdbNodeAugmentation;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.rev150105.OvsdbNodeRef;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.rev150105.OvsdbQueueRef;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.rev150105.OvsdbPortInterfaceAttributes.VlanMode;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.rev150105.OvsdbTerminationPointAugmentation;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.rev150105.OvsdbTerminationPointAugmentationBuilder;
private static final NotifyingDataChangeListener OPERATIONAL_LISTENER =
new NotifyingDataChangeListener(LogicalDatastoreType.OPERATIONAL);
+
private static class NotifyingDataChangeListener implements DataChangeListener {
private final LogicalDatastoreType type;
private final Set<InstanceIdentifier<?>> createdIids = new HashSet<>();
private static class TestQueue implements AutoCloseable {
private final ConnectionInfo connectionInfo;
private final Uri queueId;
+ private final InstanceIdentifier<Queues> qIid;
/**
* Creates a test queue entry which can be automatically removed when no longer necessary.
.setQueuesExternalIds(externalIds)
.setQueuesOtherConfig(otherConfigs)
.build();
- InstanceIdentifier<Queues> qIid = SouthboundUtils.createInstanceIdentifier(connectionInfo)
+ qIid = SouthboundUtils.createInstanceIdentifier(connectionInfo)
.augmentation(OvsdbNodeAugmentation.class)
.child(Queues.class, queue.getKey());
final NotifyingDataChangeListener queueOperationalListener =
}
}
+ public InstanceIdentifier<Queues> getInstanceIdentifier() {
+ return qIid;
+ }
@Override
public void close() {
InstanceIdentifier<Queues> qIid = SouthboundUtils.createInstanceIdentifier(connectionInfo)
createGenericOvsdbTerminationPointAugmentationBuilder();
String portName = "testTerminationPointQos";
ovsdbTerminationBuilder.setName(portName);
- ovsdbTerminationBuilder.setQos(qosUuid);
Assert.assertTrue(addTerminationPoint(nodeId, portName, ovsdbTerminationBuilder));
- // READ and check that qos uuid has been added to the port
+
+ // READ and check that qos uuid has been added to the port
InstanceIdentifier<TerminationPoint> tpEntryIid = getTpIid(connectionInfo, bridge)
.child(TerminationPoint.class, new TerminationPointKey(new TpId(portName)));
TerminationPoint terminationPoint = mdsalUtils.read(LogicalDatastoreType.OPERATIONAL, tpEntryIid);
Assert.assertNotNull(terminationPoint);
- OvsdbTerminationPointAugmentation ovsdbTerminationPointAugmentation =
- terminationPoint.getAugmentation(OvsdbTerminationPointAugmentation.class);
- Assert.assertEquals(ovsdbTerminationPointAugmentation.getQos(), qosUuid);
// UPDATE - remove the qos entry from the port
OvsdbTerminationPointAugmentationBuilder tpUpdateAugmentationBuilder =
// READ and verify that qos uuid has been removed from port
TerminationPoint terminationPointUpdate = mdsalUtils.read(LogicalDatastoreType.OPERATIONAL, tpEntryIid);
Assert.assertNotNull(terminationPointUpdate);
- OvsdbTerminationPointAugmentation ovsdbTerminationPointAugmentationUpdate =
- terminationPointUpdate.getAugmentation(OvsdbTerminationPointAugmentation.class);
- Assert.assertNull(ovsdbTerminationPointAugmentationUpdate.getQos());
// DELETE handled by TestBridge
}
// configuration of the Qos row.
OvsdbNodeAugmentation ovsdbNodeAugmentation = getOvsdbNode(connectionInfo,
LogicalDatastoreType.OPERATIONAL);
+
Queues operQueue1 = getQueue(new Uri("queue1"), ovsdbNodeAugmentation);
+
Assert.assertNotNull(operQueue1);
- Uuid queue1Uuid = new Uuid(operQueue1.getQueueUuid().getValue());
+
+ InstanceIdentifier<Queues> queue1Iid = testQueue1.getInstanceIdentifier();
+ OvsdbQueueRef queue1Ref = new OvsdbQueueRef(queue1Iid);
+
Queues operQueue2 = getQueue(new Uri("queue2"), ovsdbNodeAugmentation);
Assert.assertNotNull(operQueue2);
- Uuid queue2Uuid = new Uuid(operQueue2.getQueueUuid().getValue());
+ InstanceIdentifier<Queues> queue2Iid = testQueue2.getInstanceIdentifier();
+ OvsdbQueueRef queue2Ref = new OvsdbQueueRef(queue2Iid);
List<QueueList> queueList = new ArrayList<>();
- queueList.add(new QueueListBuilder().setQueueNumber(new Long("0"))
- .setQueueUuid(queue1Uuid).build());
- queueList.add(new QueueListBuilder().setQueueNumber(new Long("1"))
- .setQueueUuid(queue2Uuid).build());
+ queueList.add(new QueueListBuilder().setQueueNumber(new Long("1")).setQueueRef(queue1Ref).build());
+ queueList.add(new QueueListBuilder().setQueueNumber(new Long("2")).setQueueRef(queue2Ref).build());
+
qosBuilder.setQueueList(queueList);
Assert.assertTrue(mdsalUtils.merge(LogicalDatastoreType.CONFIGURATION,
// DELETE one queue from queue list and check that one remains
KeyedInstanceIdentifier<QueueList, QueueListKey> qosQueueIid = qosIid
- .child(QueueList.class, new QueueListKey(new Long("0")));
+ .child(QueueList.class, new QueueListKey(new Long("1")));
Assert.assertTrue(mdsalUtils.delete(LogicalDatastoreType.CONFIGURATION, qosQueueIid));
qosOperationalListener.waitForUpdate(OVSDB_UPDATE_TIMEOUT);
Assert.assertNotNull(operQos);
operQueueList = operQos.getQueueList();
Assert.assertNotNull(operQueueList);
+
for (QueueList queueEntry : queueList) {
- if (queueEntry.getQueueUuid().equals(queue2Uuid)) {
+ if (queueEntry.getQueueRef().equals(queue2Ref)) {
Assert.assertTrue(isQueueInList(operQueueList, queueEntry));
- } else if (queueEntry.getQueueUuid().equals(queue1Uuid)) {
+ } else if (queueEntry.getQueueRef().equals(queue1Ref)) {
Assert.assertFalse(isQueueInList(operQueueList, queueEntry));
} else {
Assert.assertTrue("Unknown queue entry in qos queue list", false);
}
}
+
+
private Boolean isQueueInList(List<QueueList> queueList, QueueList queue) {
for (QueueList queueEntry : queueList) {
- if (queueEntry.getQueueNumber().equals(queue.getQueueNumber())
- && queueEntry.getQueueUuid().equals(queue.getQueueUuid())) {
+ if (queueEntry.getQueueNumber().equals(queue.getQueueNumber())&& queueEntry.getQueueRef().equals(queue.getQueueRef())) {
return true;
}
}