Test transformation on PreInInterface->PostInVrfSession edge
@@ -292,6 +292,31 @@ public final class SessionInstrumentationTest {
mapsBackward(ONE, sessionHeaders))))));
}
+ @Test
+ public void testFibLookupSessionEdges_transformation() {
+ BDD sessionHeaders = PKT.getDstIp().value(10L);
+ BDD poolBdd = PKT.getSrcIp().value(10L);
+ Transition nat = Transitions.eraseAndSet(PKT.getSrcIp(), poolBdd);
+ BDDFirewallSessionTraceInfo sessionInfo =
+ new BDDFirewallSessionTraceInfo(
+ FW, ImmutableSet.of(FW_I1), FibLookup.INSTANCE, sessionHeaders, nat);
+
+ assertThat(
+ fibLookupSessionEdges(sessionInfo),
+ contains(
+ allOf(
+ hasPreState(new PreInInterface(FW, FW_I1)),
+ hasPostState(new PostInVrfSession(FW, FW_VRF)),
+ hasTransition(
+ allOf(
+ mapsForward(
+ ONE,
+ sessionHeaders
+ .and(poolBdd)
+ .and(_fwSrcMgr.getSourceInterfaceBDD(FW_I1))),
+ mapsBackward(ONE, sessionHeaders))))));
+ }
+
@Test
public void testFibLookupSessionEdges_inboundSession() {
BDD sessionHeaders = PKT.getDstIp().value(10L);
