Search in sources :

Example 6 with DomainPointToPointIntent

use of org.onosproject.net.domain.DomainPointToPointIntent in project onos by opennetworkinglab.

the class LinkCollectionIntentCompilerDomainP2PTest method testCompilationSingleDeviceDomainP2P.

/**
 * We test the proper compilation of one domain device.
 */
@Test
public void testCompilationSingleDeviceDomainP2P() {
    intent = LinkCollectionIntent.builder().appId(APP_ID).selector(selector).treatment(treatment).applyTreatmentOnEgress(true).links(p2pLinks).filteredIngressPoints(ImmutableSet.of(new FilteredConnectPoint(d1p10))).filteredEgressPoints(ImmutableSet.of(new FilteredConnectPoint(d3p10))).constraints(domainConstraint).build();
    sut.activate();
    List<Intent> compiled = sut.compile(intent, Collections.emptyList());
    assertThat(compiled, hasSize(2));
    DomainPointToPointIntent domainIntent = ((DomainPointToPointIntent) compiled.get(0));
    ConnectPoint ingress = domainIntent.filteredIngressPoints().iterator().next().connectPoint();
    assertThat(ingress, equalTo(d2p0));
    ConnectPoint egress = domainIntent.filteredEgressPoints().iterator().next().connectPoint();
    assertThat(egress, equalTo(d2p1));
    assertThat(domainIntent.links(), hasSize(0));
    Collection<FlowRule> rules = ((FlowRuleIntent) compiled.get(1)).flowRules();
    assertThat(rules, hasSize(2));
    sut.deactivate();
}
Also used : DomainPointToPointIntent(org.onosproject.net.domain.DomainPointToPointIntent) DomainPointToPointIntent(org.onosproject.net.domain.DomainPointToPointIntent) Intent(org.onosproject.net.intent.Intent) FlowRuleIntent(org.onosproject.net.intent.FlowRuleIntent) LinkCollectionIntent(org.onosproject.net.intent.LinkCollectionIntent) FlowRule(org.onosproject.net.flow.FlowRule) ConnectPoint(org.onosproject.net.ConnectPoint) FilteredConnectPoint(org.onosproject.net.FilteredConnectPoint) FilteredConnectPoint(org.onosproject.net.FilteredConnectPoint) FlowRuleIntent(org.onosproject.net.intent.FlowRuleIntent) Test(org.junit.Test)

Example 7 with DomainPointToPointIntent

use of org.onosproject.net.domain.DomainPointToPointIntent in project onos by opennetworkinglab.

the class DomainIntentInstallerTest method createAnotherDomainIntents.

/**
 * Create another domain Intents.
 *
 * @return the domain Intents
 */
private List<Intent> createAnotherDomainIntents() {
    FilteredConnectPoint ingress = new FilteredConnectPoint(CP1);
    FilteredConnectPoint egress = new FilteredConnectPoint(CP3);
    DomainPointToPointIntent intent = DomainPointToPointIntent.builder().appId(APP_ID).key(KEY1).priority(DEFAULT_PRIORITY).filteredIngressPoint(ingress).filteredEgressPoint(egress).links(ImmutableList.of()).build();
    return ImmutableList.of(intent);
}
Also used : DomainPointToPointIntent(org.onosproject.net.domain.DomainPointToPointIntent) FilteredConnectPoint(org.onosproject.net.FilteredConnectPoint)

Aggregations

FilteredConnectPoint (org.onosproject.net.FilteredConnectPoint)7 DomainPointToPointIntent (org.onosproject.net.domain.DomainPointToPointIntent)7 Test (org.junit.Test)5 ConnectPoint (org.onosproject.net.ConnectPoint)5 FlowRuleIntent (org.onosproject.net.intent.FlowRuleIntent)5 Intent (org.onosproject.net.intent.Intent)5 LinkCollectionIntent (org.onosproject.net.intent.LinkCollectionIntent)5 FlowRule (org.onosproject.net.flow.FlowRule)4