예제 #1
0
void
test_interface_destroy(void) {
  lagopus_result_t rv;

  rv = dp_interface_create("test");
  TEST_ASSERT_EQUAL_MESSAGE(rv, LAGOPUS_RESULT_OK,
                            "dp_interface_create error");
  rv = dp_interface_destroy("test2");
  TEST_ASSERT_EQUAL_MESSAGE(rv, LAGOPUS_RESULT_NOT_FOUND,
                            "dp_interface_destroy error");
  rv = dp_interface_destroy("test");
  TEST_ASSERT_EQUAL_MESSAGE(rv, LAGOPUS_RESULT_OK,
                            "dp_interface_destroy error");
}
예제 #2
0
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();
}
예제 #3
0
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();

}
예제 #4
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();
}
예제 #5
0
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;
  }
}
예제 #6
0
void
tearDown(void) {
  TEST_ASSERT_EQUAL(dp_port_destroy("port1"), LAGOPUS_RESULT_OK);
  TEST_ASSERT_EQUAL(dp_interface_destroy("if1"), LAGOPUS_RESULT_OK);
  dp_api_fini();
}