use of org.onosproject.incubator.net.virtual.provider.VirtualGroupProviderService in project onos by opennetworkinglab.
the class VirtualNetworkGroupManagerTest method testAuditWithExtraneousMissingGroups.
// Test AUDIT process with extraneous groups and missing groups
private void testAuditWithExtraneousMissingGroups(NetworkId networkId, DeviceId deviceId) {
VirtualNetworkGroupManager groupManager;
VirtualGroupProviderService providerService;
if (networkId.id() == 1) {
groupManager = groupManager1;
providerService = providerService1;
} else {
groupManager = groupManager2;
providerService = providerService2;
}
PortNumber[] ports1 = { PortNumber.portNumber(31), PortNumber.portNumber(32) };
PortNumber[] ports2 = { PortNumber.portNumber(41), PortNumber.portNumber(42) };
GroupId gId1 = new GroupId(1);
Group group1 = createSouthboundGroupEntry(gId1, Arrays.asList(ports1), 0, deviceId);
GroupId gId2 = new GroupId(2);
Group group2 = createSouthboundGroupEntry(gId2, Arrays.asList(ports2), 0, deviceId);
List<Group> groupEntries = Arrays.asList(group1, group2);
providerService.pushGroupMetrics(deviceId, groupEntries);
GroupKey key = new DefaultGroupKey("group1BeforeAudit".getBytes());
Group createdGroup = groupManager.getGroup(deviceId, key);
List<GroupOperation> expectedGroupOps = Arrays.asList(GroupOperation.createDeleteGroupOperation(gId1, Group.Type.SELECT), GroupOperation.createDeleteGroupOperation(gId2, Group.Type.SELECT), GroupOperation.createAddGroupOperation(createdGroup.id(), Group.Type.SELECT, createdGroup.buckets()));
if (deviceId.equals(VDID1)) {
provider.validate(networkId, deviceId, expectedGroupOps);
}
}
Aggregations