Asterisk - The Open Source Telephony Project GIT-master-b023714
|
Test ARI API.
More...#include "asterisk.h"
#include "asterisk/module.h"
#include "asterisk/test.h"
#include "asterisk/ari.h"
Go to the source code of this file.
Functions | |
static void | __reg_module (void) |
static void | __unreg_module (void) |
struct ast_module * | AST_MODULE_SELF_SYM (void) |
AST_TEST_DEFINE (get_docs) | |
AST_TEST_DEFINE (get_docs_hackerz) | |
AST_TEST_DEFINE (get_docs_nohost) | |
AST_TEST_DEFINE (get_docs_notfound) | |
AST_TEST_DEFINE (invoke_bad_post) | |
AST_TEST_DEFINE (invoke_delete) | |
AST_TEST_DEFINE (invoke_get) | |
AST_TEST_DEFINE (invoke_not_found) | |
AST_TEST_DEFINE (invoke_post) | |
AST_TEST_DEFINE (invoke_wildcard) | |
static int | load_module (void) |
static struct ast_ari_response * | response_alloc (void) |
static void | response_free (struct ast_ari_response *resp) |
static void * | setup_invocation_test (void) |
static void | tear_down_invocation_test (void *ignore) |
static int | unload_module (void) |
Variables | |
static struct ast_module_info | __mod_info = { .name = AST_MODULE, .flags = AST_MODFLAG_DEFAULT , .description = "ARI testing" , .key = ASTERISK_GPL_KEY , .buildopt_sum = AST_BUILDOPT_SUM, .support_level = AST_MODULE_SUPPORT_CORE, .load = load_module, .unload = unload_module, .requires = "res_ari", } |
static const struct ast_module_info * | ast_module_info = &__mod_info |
static struct stasis_rest_handlers | bam |
static struct stasis_rest_handlers | bang |
static struct stasis_rest_handlers | bar |
static void | handler (const char *name, int response_code, struct ast_variable *get_params, struct ast_variable *path_vars, struct ast_variable *headers, struct ast_json *body, struct ast_ari_response *response) |
#define | HANDLER(name, response_code) |
static int | invocation_count |
static struct stasis_rest_handlers | test_root |
Test ARI API.
Definition in file test_ari.c.
#define HANDLER | ( | name, | |
response_code | |||
) |
Definition at line 97 of file test_ari.c.
|
static |
Definition at line 578 of file test_ari.c.
|
static |
Definition at line 578 of file test_ari.c.
struct ast_module * AST_MODULE_SELF_SYM | ( | void | ) |
Definition at line 578 of file test_ari.c.
AST_TEST_DEFINE | ( | get_docs | ) |
Definition at line 201 of file test_ari.c.
References ast_ari_get_docs(), ast_json_object_get(), ast_json_string_get(), AST_TEST_NOT_RUN, AST_TEST_PASS, ast_variable_new, ast_variables_destroy(), ast_ari_response::headers, NULL, RAII_VAR, response_alloc(), response_free(), TEST_EXECUTE, and TEST_INIT.
AST_TEST_DEFINE | ( | get_docs_hackerz | ) |
Definition at line 284 of file test_ari.c.
References ast_ari_get_docs(), AST_TEST_NOT_RUN, AST_TEST_PASS, NULL, RAII_VAR, response_alloc(), response_free(), TEST_EXECUTE, and TEST_INIT.
AST_TEST_DEFINE | ( | get_docs_nohost | ) |
Definition at line 233 of file test_ari.c.
References ast_ari_get_docs(), ast_json_object_get(), AST_TEST_NOT_RUN, AST_TEST_PASS, NULL, RAII_VAR, response_alloc(), response_free(), TEST_EXECUTE, and TEST_INIT.
AST_TEST_DEFINE | ( | get_docs_notfound | ) |
Definition at line 261 of file test_ari.c.
References ast_ari_get_docs(), AST_TEST_NOT_RUN, AST_TEST_PASS, NULL, RAII_VAR, response_alloc(), response_free(), TEST_EXECUTE, and TEST_INIT.
AST_TEST_DEFINE | ( | invoke_bad_post | ) |
Definition at line 485 of file test_ari.c.
References ARI_INVOKE_SOURCE_TEST, ast_ari_invoke(), AST_HTTP_POST, ast_json_null(), AST_TEST_NOT_RUN, AST_TEST_PASS, invocation_count, NULL, RAII_VAR, response_alloc(), response_free(), setup_invocation_test(), tear_down_invocation_test(), TEST_EXECUTE, and TEST_INIT.
AST_TEST_DEFINE | ( | invoke_delete | ) |
Definition at line 396 of file test_ari.c.
References ARI_INVOKE_SOURCE_TEST, ast_ari_invoke(), AST_HTTP_DELETE, ast_json_equal(), ast_json_null(), ast_json_pack(), ast_json_unref(), AST_TEST_NOT_RUN, AST_TEST_PASS, invocation_count, NULL, RAII_VAR, response_alloc(), response_free(), setup_invocation_test(), tear_down_invocation_test(), TEST_EXECUTE, and TEST_INIT.
AST_TEST_DEFINE | ( | invoke_get | ) |
Definition at line 307 of file test_ari.c.
References ARI_INVOKE_SOURCE_TEST, ast_ari_invoke(), ast_assert, AST_HTTP_GET, ast_json_equal(), ast_json_null(), ast_json_pack(), ast_json_unref(), AST_TEST_NOT_RUN, AST_TEST_PASS, ast_variable_new, invocation_count, ast_variable::next, NULL, RAII_VAR, response_alloc(), response_free(), setup_invocation_test(), tear_down_invocation_test(), TEST_EXECUTE, and TEST_INIT.
AST_TEST_DEFINE | ( | invoke_not_found | ) |
Definition at line 514 of file test_ari.c.
References ARI_INVOKE_SOURCE_TEST, ast_ari_invoke(), AST_HTTP_GET, ast_json_null(), AST_TEST_NOT_RUN, AST_TEST_PASS, invocation_count, NULL, RAII_VAR, response_alloc(), response_free(), setup_invocation_test(), tear_down_invocation_test(), TEST_EXECUTE, and TEST_INIT.
AST_TEST_DEFINE | ( | invoke_post | ) |
Definition at line 434 of file test_ari.c.
References ARI_INVOKE_SOURCE_TEST, ast_ari_invoke(), ast_assert, AST_HTTP_POST, ast_json_equal(), ast_json_null(), ast_json_pack(), ast_json_unref(), AST_TEST_NOT_RUN, AST_TEST_PASS, ast_variable_new, invocation_count, ast_variable::next, NULL, RAII_VAR, response_alloc(), response_free(), setup_invocation_test(), tear_down_invocation_test(), TEST_EXECUTE, and TEST_INIT.
AST_TEST_DEFINE | ( | invoke_wildcard | ) |
Definition at line 358 of file test_ari.c.
References ARI_INVOKE_SOURCE_TEST, ast_ari_invoke(), AST_HTTP_GET, ast_json_equal(), ast_json_null(), ast_json_pack(), ast_json_unref(), AST_TEST_NOT_RUN, AST_TEST_PASS, invocation_count, NULL, RAII_VAR, response_alloc(), response_free(), setup_invocation_test(), tear_down_invocation_test(), TEST_EXECUTE, and TEST_INIT.
|
static |
Definition at line 59 of file test_ari.c.
References ast_json_object_get(), ast_json_object_set(), ast_json_pack(), ast_json_string_create(), invocation_count, ast_ari_response::message, name, ast_variable::name, ast_variable::next, NULL, ast_ari_response::response_code, and ast_variable::value.
Referenced by __aco_option_register(), __stasis_app_register(), add_allow_header(), add_sdp_streams(), allocate_subscription(), app_create(), app_handle_subscriptions(), app_send(), app_update(), ast_ari_add_handler(), ast_ari_invoke(), ast_ari_remove_handler(), ast_msg_handler_register(), ast_msg_handler_unregister(), ast_msg_has_destination(), ast_mwi_state_callback_all(), ast_mwi_state_callback_subscribed(), ast_pbx_hangup_handler_push(), ast_sip_create_subscription(), ast_sip_register_event_publisher_handler(), ast_sip_register_publish_handler(), ast_sip_register_subscription_handler(), ast_sip_session_register_sdp_handler(), ast_sip_session_unregister_sdp_handler(), ast_sip_unregister_event_publisher_handler(), ast_sip_unregister_publish_handler(), ast_sip_unregister_subscription_handler(), build_node_children(), build_resource_tree(), channel_hangup_handler_cb(), create_subscription_tree(), create_virtual_subscriptions(), handle_conf_user_join(), handle_conf_user_leave(), handle_debug_or_trace(), handle_incoming_sdp(), handle_negotiated_sdp_session_media(), handle_options(), handle_stasis_state(), msg_q_cb(), publish_add_handler(), publish_hangup_handler_message(), publish_request_initial(), pubsub_on_rx_publish_request(), pubsub_on_rx_subscribe_request(), remove_handler(), root_handler_create(), sdp_requires_deferral(), session_media_set_handler(), session_outgoing_nat_hook(), sip_outbound_publish_synchronize(), stasis_app_register(), stasis_app_register_all(), stasis_state_callback_all(), stasis_state_callback_subscribed(), status_debug_verbose(), stop_publishing(), stream_destroy(), sub_add_handler(), sub_add_handler(), sub_persistence_recreate(), subscription_get_generator_from_rdata(), subscription_get_handler_from_rdata(), and xmpp_action_hook().
|
static |
Definition at line 558 of file test_ari.c.
References AST_MODULE_LOAD_SUCCESS, and AST_TEST_REGISTER.
|
static |
Definition at line 156 of file test_ari.c.
References ast_calloc, ast_str_create, and ast_ari_response::headers.
Referenced by AST_TEST_DEFINE(), AST_TEST_DEFINE(), AST_TEST_DEFINE(), AST_TEST_DEFINE(), AST_TEST_DEFINE(), AST_TEST_DEFINE(), AST_TEST_DEFINE(), AST_TEST_DEFINE(), AST_TEST_DEFINE(), and AST_TEST_DEFINE().
|
static |
Definition at line 167 of file test_ari.c.
References ast_free, ast_json_unref(), ast_ari_response::headers, and ast_ari_response::message.
Referenced by AST_TEST_DEFINE(), AST_TEST_DEFINE(), AST_TEST_DEFINE(), AST_TEST_DEFINE(), AST_TEST_DEFINE(), AST_TEST_DEFINE(), AST_TEST_DEFINE(), AST_TEST_DEFINE(), AST_TEST_DEFINE(), and AST_TEST_DEFINE().
|
static |
\ internal Setup test fixture for invocation tests.
Definition at line 181 of file test_ari.c.
References ast_ari_add_handler(), ast_assert, invocation_count, and test_root.
Referenced by AST_TEST_DEFINE(), AST_TEST_DEFINE(), AST_TEST_DEFINE(), AST_TEST_DEFINE(), AST_TEST_DEFINE(), and AST_TEST_DEFINE().
|
static |
\ internal Tear down test fixture for invocation tests.
Definition at line 193 of file test_ari.c.
References ast_ari_remove_handler(), and test_root.
Referenced by AST_TEST_DEFINE(), AST_TEST_DEFINE(), AST_TEST_DEFINE(), AST_TEST_DEFINE(), AST_TEST_DEFINE(), and AST_TEST_DEFINE().
|
static |
Definition at line 543 of file test_ari.c.
References AST_TEST_UNREGISTER.
|
static |
Definition at line 578 of file test_ari.c.
|
static |
Definition at line 578 of file test_ari.c.
|
static |
Definition at line 133 of file test_ari.c.
|
static |
Definition at line 116 of file test_ari.c.
|
static |
Definition at line 125 of file test_ari.c.
|
static |
Definition at line 53 of file test_ari.c.
Referenced by AST_TEST_DEFINE(), AST_TEST_DEFINE(), AST_TEST_DEFINE(), AST_TEST_DEFINE(), AST_TEST_DEFINE(), AST_TEST_DEFINE(), handler(), and setup_invocation_test().
|
static |
Definition at line 142 of file test_ari.c.
Referenced by setup_invocation_test(), and tear_down_invocation_test().