Exemplo n.º 1
0
void
test_flowinfo_mpls_unicast_label_adddel(void) {
  size_t s;

  TEST_ASSERT_OBJECTS();
  /* The ptree should be clean. */
  for (s = 0; s < ARRAY_LEN(test_flow); s++) {
    TEST_ASSERT_FLOWINFO_NOLABEL(flowinfo, TEST_LABEL(s), MPLS_LABEL_BITLEN,
                                 __func__);
  }

  /* Add MPLS label matches. */
  for (s = 0; s < ARRAY_LEN(test_flow); s++) {
    FLOW_ADD_MPLS_LABEL_MATCH(test_flow[s], TEST_LABEL(s));
  }

  /* Run the sideeffect-prone scenario. */
  TEST_SCENARIO_FLOWINFO_SEP(flowinfo);

  /* Reset the matches.  Mind the prerequisite. */
  for (s = 0; s < ARRAY_LEN(test_flow); s++) {
    TAILQ_INIT(&test_flow[s]->match_list);
    FLOW_ADD_MPLS_UT_PREREQUISITE(test_flow[s]);
  }
}
Exemplo n.º 2
0
void
test_flowinfo_mpls_unicast_tc_adddel(void) {
  size_t s;

  TEST_ASSERT_OBJECTS();

  /* Add MPLS TC matches. */
  for (s = 0; s < ARRAY_LEN(test_flow); s++) {
    FLOW_ADD_MPLS_TC_MATCH(test_flow[s], TEST_TC(s));
  }

  /* Run the sideeffect-free scenario. */
  TEST_SCENARIO_FLOWINFO_SEF(flowinfo);

  /* Reset the matches.  Mind the prerequisite. */
  for (s = 0; s < ARRAY_LEN(test_flow); s++) {
    TAILQ_INIT(&test_flow[s]->match_list);
    FLOW_ADD_MPLS_UT_PREREQUISITE(test_flow[s]);
  }
}
Exemplo n.º 3
0
void
setUp(void) {
  size_t s;

  /* Make the root flowinfo. */
  TEST_ASSERT_NULL(flowinfo);
  flowinfo = new_flowinfo_vlan_vid();
  TEST_ASSERT_NOT_NULL(flowinfo);

  TEST_ASSERT_FLOWINFO_FLOW_NUM(flowinfo, 0, __func__);

  /*
   * Make the test flows.
   *
   * MPLS matches have prerequisite.
   */
  for (s = 0; s < ARRAY_LEN(test_flow); s++) {
    TEST_ASSERT_NULL(test_flow[s]);
    test_flow[s] = allocate_test_flow(10 * sizeof(struct match));
    TEST_ASSERT_NOT_NULL(test_flow[s]);
    test_flow[s]->priority = (int)s;
    FLOW_ADD_MPLS_UT_PREREQUISITE(test_flow[s]);
  }
}