Beispiel #1
0
void
tearDown(void) {
  TEST_ASSERT_NOT_NULL(bridge);
  TEST_ASSERT_EQUAL(dp_bridge_destroy(bridge_name), LAGOPUS_RESULT_OK);
  dp_api_fini();
  bridge = NULL;
}
void
tearDown(void) {

  TEST_ASSERT_EQUAL(LAGOPUS_RESULT_OK,
                    dp_bridge_destroy(bridge_name));
  TEST_ASSERT_EQUAL(LAGOPUS_RESULT_OK,
                    dp_port_destroy(port_name));
  TEST_ASSERT_EQUAL(LAGOPUS_RESULT_OK,
                    dp_interface_destroy(interface_name));

  dp_api_fini();
}
void
tearDown(void) {
  struct table_features *f;
  struct table_property *p;
  struct next_table_id *n;
  struct oxm_id *o;
  struct experimenter_data *e;

  TEST_ASSERT_NOT_NULL(bridge);
  TEST_ASSERT_NOT_NULL(flowdb);

  /*
   * Inline expansion from outside dpmgr.
   *
   * Stolen form: src/agent/ofp_table_features_handler.c
   */
  while ((f = TAILQ_FIRST(&features_list)) != NULL) {
    while ((p = TAILQ_FIRST(&f->table_property_list)) != NULL) {
      instruction_list_entry_free(&p->instruction_list);

      /* next_table_id_list_entry_free(&p->next_table_id_list); */
      while ((n = TAILQ_FIRST(&p->next_table_id_list)) != NULL) {
        TAILQ_REMOVE(&p->next_table_id_list, n, entry);
        free(n);
      }

      action_list_entry_free(&p->action_list);

      /* oxm_id_list_entry_free(&p->oxm_id_list); */
      while ((o = TAILQ_FIRST(&p->oxm_id_list)) != NULL) {
        TAILQ_REMOVE(&p->oxm_id_list, o, entry);
        free(o);
      }

      /* experimenter_data_list_entry_free(&p->experimenter_data_list); */
      while ((e = TAILQ_FIRST(&p->experimenter_data_list)) != NULL) {
        TAILQ_REMOVE(&p->experimenter_data_list, e, entry);
        free(e);
      }

      TAILQ_REMOVE(&f->table_property_list, p, entry);
      free(p);
    }
    TAILQ_REMOVE(&features_list, f, entry);
    free(f);
  }
  TAILQ_INIT(&features_list);

  TEST_ASSERT_TRUE(LAGOPUS_RESULT_OK == dp_bridge_destroy(bridge_name));

  flowdb = NULL;
  bridge = NULL;
}
Beispiel #4
0
void
tearDown(void) {
  TEST_ASSERT_NOT_NULL(bridge);
  TEST_ASSERT_NOT_NULL(flowdb);
  TEST_ASSERT_NOT_NULL(ports);
  TEST_ASSERT_NOT_NULL(group_table);

  TEST_ASSERT_TRUE(LAGOPUS_RESULT_OK == dp_bridge_destroy(bridge_name));
  lagopus_hashmap_destroy(&ports, false);
  group_table_free(group_table);

  ports = NULL;
  group_table = NULL;
  flowdb = NULL;
  bridge = NULL;
}
static void
s_destroy_static_data(void) {

  if (s_is_init == true) {
    s_is_init = false;
    TEST_ASSERT_EQUAL(LAGOPUS_RESULT_OK,
                      dp_bridge_destroy(bridge_name));
    TEST_ASSERT_EQUAL(LAGOPUS_RESULT_OK,
                      ofp_bridgeq_mgr_clear());
    TEST_ASSERT_EQUAL(LAGOPUS_RESULT_OK,
                      dp_port_destroy(port_name));
    TEST_ASSERT_EQUAL(LAGOPUS_RESULT_OK,
                      dp_interface_destroy(interface_name));
  }

  dp_api_fini();

}
void
tearDown(void) {
  size_t s;

  for (s = 0; s < ARRAY_LEN(bridge); s++) {
    TEST_ASSERT_NOT_NULL(bridge[s]);
    TEST_ASSERT_NOT_NULL(flowdb[s]);
    TEST_ASSERT_NOT_NULL(bridge_name[s]);
  }

  for (s = 0; s < ARRAY_LEN(bridge); s++) {
    TEST_ASSERT_NULL(dp_port_lookup(TEST_PORT_IFINDEX(s)));
    TEST_ASSERT_TRUE(LAGOPUS_RESULT_OK == dp_bridge_destroy(bridge_name[s]));
    // Free the bridge names.
    free(port_name[s]);
    free(bridge_name[s]);
    flowdb[s] = NULL;
    bridge[s] = NULL;
    bridge_name[s] = NULL;
    port_name[s] = NULL;
  }
}
Beispiel #7
0
void
test_epilogue(void) {
  lagopus_result_t r;

  run = false;
  channel_mgr_finalize();
  r = global_state_request_shutdown(SHUTDOWN_GRACEFULLY);
  TEST_ASSERT_EQUAL(r, LAGOPUS_RESULT_OK);
  lagopus_mainloop_wait_thread();

  close(s4);
  close(s6);


  TEST_ASSERT_EQUAL(LAGOPUS_RESULT_OK,
                    dp_bridge_destroy(bridge_name));
  TEST_ASSERT_EQUAL(LAGOPUS_RESULT_OK,
                    dp_port_destroy(port_name));
  TEST_ASSERT_EQUAL(LAGOPUS_RESULT_OK,
                    dp_interface_destroy(interface_name));

  dp_api_fini();
}
static void
s_destroy_static_data(void) {
  channel_mgr_finalize();

  if (s_is_init == true) {
    s_is_init = false;
    TEST_ASSERT_EQUAL(LAGOPUS_RESULT_OK,
                      dp_bridge_destroy(bridge_name));
    TEST_ASSERT_EQUAL(LAGOPUS_RESULT_OK,
                      ofp_bridgeq_mgr_clear());
    TEST_ASSERT_EQUAL(LAGOPUS_RESULT_OK,
                      dp_port_destroy(port_name));
    free((void *)s_interface_info.eth_dpdk_phy.device);
    TEST_ASSERT_EQUAL(LAGOPUS_RESULT_OK,
                      dp_interface_destroy(interface_name));
  }

  dp_api_fini();

  if (s_event_manager != NULL) {
    event_manager_free(s_event_manager);
    s_event_manager = NULL;
  }
}
Beispiel #9
0
void
tearDown(void) {
  dp_bridge_destroy("br0");
  dp_api_fini();
}