Asterisk - The Open Source Telephony Project  GIT-master-1f78ee9
Data Structures | Macros | Functions | Variables
test_http_media_cache.c File Reference

Tests for the HTTP media cache backend. More...

#include "asterisk.h"
#include <fcntl.h>
#include "asterisk/module.h"
#include "asterisk/http.h"
#include "asterisk/bucket.h"
#include "asterisk/test.h"

Go to the source code of this file.

Data Structures

struct  test_options
 

Macros

#define CATEGORY   "/res/http_media_cache/"
 
#define SET_OR_APPEND_CACHE_CONTROL(str)
 
#define TEST_URI   "test_media_cache"
 
#define VALIDATE_EXPIRES(test, bucket_file, expected, delta)
 
#define VALIDATE_STR_METADATA(test, bucket_file, key, expected)
 

Functions

static void __reg_module (void)
 
static void __unreg_module (void)
 
struct ast_moduleAST_MODULE_SELF_SYM (void)
 
 AST_TEST_DEFINE (retrieve_cache_control_directives)
 
 AST_TEST_DEFINE (retrieve_cache_control_age)
 
 AST_TEST_DEFINE (retrieve_etag_expired)
 
 AST_TEST_DEFINE (retrieve_expires)
 
 AST_TEST_DEFINE (retrieve_etag)
 
 AST_TEST_DEFINE (retrieve_nominal)
 
 AST_TEST_DEFINE (create_nominal)
 
static void bucket_file_cleanup (void *obj)
 
static int http_callback (struct ast_tcptls_session_instance *ser, const struct ast_http_uri *urih, const char *uri, enum ast_http_method method, struct ast_variable *get_params, struct ast_variable *headers)
 
static int load_module (void)
 
static int pre_test_cb (struct ast_test_info *info, struct ast_test *test)
 
static int process_config (int reload)
 
static int reload_module (void)
 
static int unload_module (void)
 

Variables

static struct ast_module_info __mod_info = { .name = AST_MODULE, .flags = AST_MODFLAG_DEFAULT , .description = "HTTP Media Cache Backend Tests" , .key = "This paragraph is copyright (c) 2006 by Digium, Inc. \In order for your module to load, it must return this \key via a function called \"key\". Any code which \includes this paragraph must be licensed under the GNU \General Public License version 2 or later (at your \option). In addition to Digium's general reservations \of rights, Digium expressly reserves the right to \allow other parties to license this paragraph under \different terms. Any use of Digium, Inc. trademarks or \logos (including \"Asterisk\" or \"Digium\") without \express written permission of Digium, Inc. is prohibited.\n" , .buildopt_sum = AST_BUILDOPT_SUM, .support_level = AST_MODULE_SUPPORT_CORE, .load = load_module, .reload = reload_module, .unload = unload_module, }
 
static const struct ast_module_infoast_module_info = &__mod_info
 
static struct test_options options
 
static char server_uri [512]
 
static struct ast_http_uri test_uri
 

Detailed Description

Tests for the HTTP media cache backend.

Author
Matt Jordan <mjordan@digium.com> 

Definition in file test_http_media_cache.c.

Macro Definition Documentation

◆ CATEGORY

#define CATEGORY   "/res/http_media_cache/"

Definition at line 44 of file test_http_media_cache.c.

Referenced by AST_TEST_DEFINE(), and load_module().

◆ SET_OR_APPEND_CACHE_CONTROL

#define SET_OR_APPEND_CACHE_CONTROL (   str)

Definition at line 83 of file test_http_media_cache.c.

Referenced by http_callback().

◆ TEST_URI

#define TEST_URI   "test_media_cache"

Definition at line 46 of file test_http_media_cache.c.

Referenced by process_config().

◆ VALIDATE_EXPIRES

#define VALIDATE_EXPIRES (   test,
  bucket_file,
  expected,
  delta 
)

Definition at line 66 of file test_http_media_cache.c.

Referenced by AST_TEST_DEFINE().

◆ VALIDATE_STR_METADATA

#define VALIDATE_STR_METADATA (   test,
  bucket_file,
  key,
  expected 
)
Value:
do { \
RAII_VAR(struct ast_bucket_metadata *, metadata, ast_bucket_file_metadata_get((bucket_file), (key)), ao2_cleanup); \
ast_test_validate(test, metadata != NULL); \
ast_test_validate(test, !strcmp(metadata->value, (expected))); \
} while (0)
struct ast_bucket_metadata * ast_bucket_file_metadata_get(struct ast_bucket_file *file, const char *name)
Retrieve a metadata attribute from a file.
Definition: bucket.c:358
#define NULL
Definition: resample.c:96
Bucket metadata structure, AO2 key value pair.
Definition: bucket.h:47
#define ao2_cleanup(obj)
Definition: astobj2.h:1958

Definition at line 77 of file test_http_media_cache.c.

Referenced by AST_TEST_DEFINE().

Function Documentation

◆ __reg_module()

static void __reg_module ( void  )
static

Definition at line 700 of file test_http_media_cache.c.

◆ __unreg_module()

static void __unreg_module ( void  )
static

Definition at line 700 of file test_http_media_cache.c.

◆ AST_MODULE_SELF_SYM()

struct ast_module* AST_MODULE_SELF_SYM ( void  )

Definition at line 700 of file test_http_media_cache.c.

◆ AST_TEST_DEFINE() [1/7]

AST_TEST_DEFINE ( retrieve_cache_control_directives  )

Definition at line 223 of file test_http_media_cache.c.

References ast_bucket_file_is_stale(), ast_bucket_file_retrieve(), AST_TEST_NOT_RUN, AST_TEST_PASS, ast_test_status_update, ast_tvnow(), bucket_file_cleanup(), test_options::cache_control, CATEGORY, test_options::etag, sip_to_pjsip::info(), test_options::maxage, test_options::must_revalidate, test_options::no_cache, NULL, options, RAII_VAR, test_options::send_file, server_uri, test_options::status_code, test_options::status_text, TEST_EXECUTE, TEST_INIT, and VALIDATE_EXPIRES.

224 {
225  RAII_VAR(struct ast_bucket_file *, bucket_file, NULL, bucket_file_cleanup);
226  struct timeval now = ast_tvnow();
227  char uri[1024];
228 
229  switch (cmd) {
230  case TEST_INIT:
231  info->name = __func__;
232  info->category = CATEGORY;
233  info->summary = "Test retrieval of a resource with Cache-Control directives that affect staleness";
234  info->description =
235  "This test covers retrieval of a resource with the Cache-Control header,\n"
236  "which specifies no-cache and/or must-revalidate.";
237  return AST_TEST_NOT_RUN;
238  case TEST_EXECUTE:
239  break;
240  }
241 
242  snprintf(uri, sizeof(uri), "%s/%s", server_uri, "foo.wav");
243 
244  options.send_file = 1;
245  options.status_code = 200;
246  options.status_text = "OK";
247 
248  ast_test_status_update(test, "Testing no-cache...\n");
250  bucket_file = ast_bucket_file_retrieve(uri);
251  ast_test_validate(test, bucket_file != NULL);
252  ast_test_validate(test, ast_bucket_file_is_stale(bucket_file) == 1);
253  bucket_file_cleanup(bucket_file);
254 
255  ast_test_status_update(test, "Testing no-cache with ETag...\n");
257  options.etag = "123456789";
258  bucket_file = ast_bucket_file_retrieve(uri);
259  ast_test_validate(test, bucket_file != NULL);
260  ast_test_validate(test, ast_bucket_file_is_stale(bucket_file) == 0);
261  bucket_file_cleanup(bucket_file);
262 
263  options.etag = NULL;
264 
265  ast_test_status_update(test, "Testing no-cache with max-age...\n");
268  bucket_file = ast_bucket_file_retrieve(uri);
269  ast_test_validate(test, bucket_file != NULL);
270  VALIDATE_EXPIRES(test, bucket_file, now.tv_sec + 300, 3);
271  ast_test_validate(test, ast_bucket_file_is_stale(bucket_file) == 1);
272  bucket_file_cleanup(bucket_file);
273 
276 
277  ast_test_status_update(test, "Testing must-revalidate...\n");
279  bucket_file = ast_bucket_file_retrieve(uri);
280  ast_test_validate(test, bucket_file != NULL);
281  ast_test_validate(test, ast_bucket_file_is_stale(bucket_file) == 1);
282  bucket_file_cleanup(bucket_file);
283 
284  ast_test_status_update(test, "Testing must-revalidate with ETag...\n");
286  options.etag = "123456789";
287  bucket_file = ast_bucket_file_retrieve(uri);
288  ast_test_validate(test, bucket_file != NULL);
289  ast_test_validate(test, ast_bucket_file_is_stale(bucket_file) == 0);
290  bucket_file_cleanup(bucket_file);
291 
292  options.etag = NULL;
293 
294  ast_test_status_update(test, "Testing must-revalidate with max-age...\n");
297  bucket_file = ast_bucket_file_retrieve(uri);
298  ast_test_validate(test, bucket_file != NULL);
299  VALIDATE_EXPIRES(test, bucket_file, now.tv_sec + 300, 3);
300  ast_test_validate(test, ast_bucket_file_is_stale(bucket_file) == 1);
301 
302  return AST_TEST_PASS;
303 }
#define CATEGORY
struct ast_bucket_file * ast_bucket_file_retrieve(const char *uri)
Retrieve a bucket file.
Definition: bucket.c:814
struct timeval ast_tvnow(void)
Returns current timeval. Meant to replace calls to gettimeofday().
Definition: time.h:150
#define NULL
Definition: resample.c:96
struct test_options::@499 cache_control
static void bucket_file_cleanup(void *obj)
#define RAII_VAR(vartype, varname, initval, dtor)
Declare a variable that will call a destructor function when it goes out of scope.
Definition: utils.h:851
#define ast_test_status_update(a, b, c...)
Definition: test.h:129
int ast_bucket_file_is_stale(struct ast_bucket_file *file)
Retrieve whether or not the backing datastore views the bucket file as stale.
Definition: bucket.c:823
Bucket file structure, contains reference to file and information about it.
Definition: bucket.h:78
const char * status_text
def info(msg)
static char server_uri[512]
#define VALIDATE_EXPIRES(test, bucket_file, expected, delta)
static struct test_options options

◆ AST_TEST_DEFINE() [2/7]

AST_TEST_DEFINE ( retrieve_cache_control_age  )

Definition at line 305 of file test_http_media_cache.c.

References ast_bucket_file_is_stale(), ast_bucket_file_retrieve(), AST_TEST_NOT_RUN, AST_TEST_PASS, ast_test_status_update, ast_tvnow(), bucket_file_cleanup(), test_options::cache_control, CATEGORY, test_options::expires, sip_to_pjsip::info(), test_options::maxage, NULL, options, RAII_VAR, test_options::s_maxage, test_options::send_file, server_uri, test_options::status_code, test_options::status_text, TEST_EXECUTE, TEST_INIT, and VALIDATE_EXPIRES.

306 {
307  RAII_VAR(struct ast_bucket_file *, bucket_file, NULL, bucket_file_cleanup);
308  struct timeval now = ast_tvnow();
309  char uri[1024];
310 
311  switch (cmd) {
312  case TEST_INIT:
313  info->name = __func__;
314  info->category = CATEGORY;
315  info->summary = "Test retrieval of a resource with age specifiers in Cache-Control";
316  info->description =
317  "This test covers retrieval of a resource with the Cache-Control header,\n"
318  "which specifies max-age and/or s-maxage. The test verifies proper precedence\n"
319  "ordering of the header attributes, along with its relation if the Expires\n"
320  "header is present.";
321  return AST_TEST_NOT_RUN;
322  case TEST_EXECUTE:
323  break;
324  }
325 
326  snprintf(uri, sizeof(uri), "%s/%s", server_uri, "foo.wav");
327 
328  options.send_file = 1;
329  options.status_code = 200;
330  options.status_text = "OK";
331 
332  ast_test_status_update(test, "Testing max-age...\n");
334  bucket_file = ast_bucket_file_retrieve(uri);
335  ast_test_validate(test, bucket_file != NULL);
336  VALIDATE_EXPIRES(test, bucket_file, now.tv_sec + 300, 3);
337  ast_test_validate(test, ast_bucket_file_is_stale(bucket_file) == 0);
338  bucket_file_cleanup(bucket_file);
339 
340  ast_test_status_update(test, "Testing s-maxage...\n");
341  now = ast_tvnow();
344  bucket_file = ast_bucket_file_retrieve(uri);
345  ast_test_validate(test, bucket_file != NULL);
346  VALIDATE_EXPIRES(test, bucket_file, now.tv_sec + 300, 3);
347  ast_test_validate(test, ast_bucket_file_is_stale(bucket_file) == 0);
348  bucket_file_cleanup(bucket_file);
349 
350  ast_test_status_update(test, "Testing max-age and s-maxage...\n");
351  now = ast_tvnow();
354  bucket_file = ast_bucket_file_retrieve(uri);
355  ast_test_validate(test, bucket_file != NULL);
356  VALIDATE_EXPIRES(test, bucket_file, now.tv_sec + 600, 3);
357  ast_test_validate(test, ast_bucket_file_is_stale(bucket_file) == 0);
358  bucket_file_cleanup(bucket_file);
359 
360  ast_test_status_update(test, "Testing max-age and Expires...\n");
361  now = ast_tvnow();
364  options.expires.tv_sec = now.tv_sec + 3000;
365  bucket_file = ast_bucket_file_retrieve(uri);
366  ast_test_validate(test, bucket_file != NULL);
367  VALIDATE_EXPIRES(test, bucket_file, now.tv_sec + 300, 3);
368  ast_test_validate(test, ast_bucket_file_is_stale(bucket_file) == 0);
369  bucket_file_cleanup(bucket_file);
370 
371  ast_test_status_update(test, "Testing s-maxage and Expires...\n");
372  now = ast_tvnow();
375  options.expires.tv_sec = now.tv_sec + 3000;
376  bucket_file = ast_bucket_file_retrieve(uri);
377  ast_test_validate(test, bucket_file != NULL);
378  VALIDATE_EXPIRES(test, bucket_file, now.tv_sec + 300, 3);
379  ast_test_validate(test, ast_bucket_file_is_stale(bucket_file) == 0);
380  bucket_file_cleanup(bucket_file);
381 
382  ast_test_status_update(test, "Testing s-maxage and Expires...\n");
383  now = ast_tvnow();
386  options.expires.tv_sec = now.tv_sec + 3000;
387  bucket_file = ast_bucket_file_retrieve(uri);
388  ast_test_validate(test, bucket_file != NULL);
389  VALIDATE_EXPIRES(test, bucket_file, now.tv_sec + 300, 3);
390  ast_test_validate(test, ast_bucket_file_is_stale(bucket_file) == 0);
391  bucket_file_cleanup(bucket_file);
392 
393  ast_test_status_update(test, "Testing max-age, s-maxage, and Expires...\n");
394  now = ast_tvnow();
397  options.expires.tv_sec = now.tv_sec + 3000;
398  bucket_file = ast_bucket_file_retrieve(uri);
399  ast_test_validate(test, bucket_file != NULL);
400  VALIDATE_EXPIRES(test, bucket_file, now.tv_sec + 600, 3);
401  ast_test_validate(test, ast_bucket_file_is_stale(bucket_file) == 0);
402 
403  return AST_TEST_PASS;
404 }
#define CATEGORY
struct ast_bucket_file * ast_bucket_file_retrieve(const char *uri)
Retrieve a bucket file.
Definition: bucket.c:814
struct timeval ast_tvnow(void)
Returns current timeval. Meant to replace calls to gettimeofday().
Definition: time.h:150
#define NULL
Definition: resample.c:96
struct test_options::@499 cache_control
static void bucket_file_cleanup(void *obj)
#define RAII_VAR(vartype, varname, initval, dtor)
Declare a variable that will call a destructor function when it goes out of scope.
Definition: utils.h:851
#define ast_test_status_update(a, b, c...)
Definition: test.h:129
int ast_bucket_file_is_stale(struct ast_bucket_file *file)
Retrieve whether or not the backing datastore views the bucket file as stale.
Definition: bucket.c:823
Bucket file structure, contains reference to file and information about it.
Definition: bucket.h:78
struct timeval expires
const char * status_text
def info(msg)
static char server_uri[512]
#define VALIDATE_EXPIRES(test, bucket_file, expected, delta)
static struct test_options options

◆ AST_TEST_DEFINE() [3/7]

AST_TEST_DEFINE ( retrieve_etag_expired  )

Definition at line 406 of file test_http_media_cache.c.

References ast_bucket_file_is_stale(), ast_bucket_file_retrieve(), ast_sorcery_object_get_id(), ast_strlen_zero, AST_TEST_NOT_RUN, AST_TEST_PASS, ast_tvnow(), bucket_file_cleanup(), CATEGORY, test_options::etag, test_options::expires, sip_to_pjsip::info(), NULL, options, RAII_VAR, test_options::send_file, server_uri, test_options::status_code, test_options::status_text, TEST_EXECUTE, TEST_INIT, VALIDATE_EXPIRES, and VALIDATE_STR_METADATA.

407 {
408  RAII_VAR(struct ast_bucket_file *, bucket_file, NULL, bucket_file_cleanup);
409  struct timeval now = ast_tvnow();
410  char uri[1024];
411 
412  switch (cmd) {
413  case TEST_INIT:
414  info->name = __func__;
415  info->category = CATEGORY;
416  info->summary = "Test retrieval of an expired resource with an ETag";
417  info->description =
418  "This test covers a staleness check of a resource with an ETag\n"
419  "that has also expired. It guarantees that even if a resource\n"
420  "is expired, we will still not consider it stale if the resource\n"
421  "has not changed per the ETag value.";
422  return AST_TEST_NOT_RUN;
423  case TEST_EXECUTE:
424  break;
425  }
426 
427  options.send_file = 1;
428  options.status_code = 200;
429  options.status_text = "OK";
430  options.etag = "123456789";
431  options.expires.tv_sec = now.tv_sec - 1;
432 
433  snprintf(uri, sizeof(uri), "%s/%s", server_uri, "foo.wav");
434 
435  bucket_file = ast_bucket_file_retrieve(uri);
436  ast_test_validate(test, bucket_file != NULL);
437  ast_test_validate(test, !strcmp(uri, ast_sorcery_object_get_id(bucket_file)));
438  ast_test_validate(test, !ast_strlen_zero(bucket_file->path));
439  VALIDATE_STR_METADATA(test, bucket_file, "etag", options.etag);
440  VALIDATE_EXPIRES(test, bucket_file, now.tv_sec - 1, 3);
441 
442  ast_test_validate(test, ast_bucket_file_is_stale(bucket_file) == 0);
443 
444  return AST_TEST_PASS;
445 }
#define CATEGORY
struct ast_bucket_file * ast_bucket_file_retrieve(const char *uri)
Retrieve a bucket file.
Definition: bucket.c:814
struct timeval ast_tvnow(void)
Returns current timeval. Meant to replace calls to gettimeofday().
Definition: time.h:150
#define NULL
Definition: resample.c:96
static void bucket_file_cleanup(void *obj)
#define VALIDATE_STR_METADATA(test, bucket_file, key, expected)
#define RAII_VAR(vartype, varname, initval, dtor)
Declare a variable that will call a destructor function when it goes out of scope.
Definition: utils.h:851
int ast_bucket_file_is_stale(struct ast_bucket_file *file)
Retrieve whether or not the backing datastore views the bucket file as stale.
Definition: bucket.c:823
const char * ast_sorcery_object_get_id(const void *object)
Get the unique identifier of a sorcery object.
Definition: sorcery.c:2309
Bucket file structure, contains reference to file and information about it.
Definition: bucket.h:78
struct timeval expires
const char * status_text
def info(msg)
#define ast_strlen_zero(a)
Definition: muted.c:73
static char server_uri[512]
#define VALIDATE_EXPIRES(test, bucket_file, expected, delta)
static struct test_options options

◆ AST_TEST_DEFINE() [4/7]

AST_TEST_DEFINE ( retrieve_expires  )

Definition at line 447 of file test_http_media_cache.c.

References ast_bucket_file_is_stale(), ast_bucket_file_retrieve(), ast_sorcery_object_get_id(), ast_strlen_zero, AST_TEST_NOT_RUN, AST_TEST_PASS, ast_tvnow(), bucket_file_cleanup(), CATEGORY, test_options::expires, sip_to_pjsip::info(), NULL, options, RAII_VAR, test_options::send_file, server_uri, test_options::status_code, test_options::status_text, TEST_EXECUTE, TEST_INIT, and VALIDATE_EXPIRES.

448 {
449  RAII_VAR(struct ast_bucket_file *, bucket_file, NULL, bucket_file_cleanup);
450  struct timeval now = ast_tvnow();
451  char uri[1024];
452 
453  switch (cmd) {
454  case TEST_INIT:
455  info->name = __func__;
456  info->category = CATEGORY;
457  info->summary = "Test retrieval with explicit expiration";
458  info->description =
459  "This test covers retrieving a resource that has an Expires.\n"
460  "After retrieval of the resource, staleness is checked. With\n"
461  "a non-expired resource, we expect the resource to not be stale.\n"
462  "When the expiration has occurred, we expect the staleness check\n"
463  "to fail.";
464  return AST_TEST_NOT_RUN;
465  case TEST_EXECUTE:
466  break;
467  }
468 
469  options.send_file = 1;
470  options.status_code = 200;
471  options.status_text = "OK";
472  options.expires.tv_sec = now.tv_sec + 3000;
473 
474  snprintf(uri, sizeof(uri), "%s/%s", server_uri, "foo.wav");
475 
476  bucket_file = ast_bucket_file_retrieve(uri);
477  ast_test_validate(test, bucket_file != NULL);
478  ast_test_validate(test, !strcmp(uri, ast_sorcery_object_get_id(bucket_file)));
479  ast_test_validate(test, !ast_strlen_zero(bucket_file->path));
480  VALIDATE_EXPIRES(test, bucket_file, now.tv_sec + 3000, 3);
481 
482  ast_test_validate(test, ast_bucket_file_is_stale(bucket_file) == 0);
483 
484  /* Clean up previous result */
485  bucket_file_cleanup(bucket_file);
486 
487  options.expires.tv_sec = now.tv_sec - 1;
488  bucket_file = ast_bucket_file_retrieve(uri);
489  ast_test_validate(test, bucket_file != NULL);
490  VALIDATE_EXPIRES(test, bucket_file, now.tv_sec - 1, 3);
491 
492  ast_test_validate(test, ast_bucket_file_is_stale(bucket_file) == 1);
493 
494  return AST_TEST_PASS;
495 }
#define CATEGORY
struct ast_bucket_file * ast_bucket_file_retrieve(const char *uri)
Retrieve a bucket file.
Definition: bucket.c:814
struct timeval ast_tvnow(void)
Returns current timeval. Meant to replace calls to gettimeofday().
Definition: time.h:150
#define NULL
Definition: resample.c:96
static void bucket_file_cleanup(void *obj)
#define RAII_VAR(vartype, varname, initval, dtor)
Declare a variable that will call a destructor function when it goes out of scope.
Definition: utils.h:851
int ast_bucket_file_is_stale(struct ast_bucket_file *file)
Retrieve whether or not the backing datastore views the bucket file as stale.
Definition: bucket.c:823
const char * ast_sorcery_object_get_id(const void *object)
Get the unique identifier of a sorcery object.
Definition: sorcery.c:2309
Bucket file structure, contains reference to file and information about it.
Definition: bucket.h:78
struct timeval expires
const char * status_text
def info(msg)
#define ast_strlen_zero(a)
Definition: muted.c:73
static char server_uri[512]
#define VALIDATE_EXPIRES(test, bucket_file, expected, delta)
static struct test_options options

◆ AST_TEST_DEFINE() [5/7]

AST_TEST_DEFINE ( retrieve_etag  )

Definition at line 497 of file test_http_media_cache.c.

References ast_bucket_file_is_stale(), ast_bucket_file_retrieve(), ast_sorcery_object_get_id(), ast_strlen_zero, AST_TEST_NOT_RUN, AST_TEST_PASS, ast_tvnow(), bucket_file_cleanup(), CATEGORY, test_options::etag, sip_to_pjsip::info(), NULL, options, RAII_VAR, test_options::send_file, server_uri, test_options::status_code, test_options::status_text, TEST_EXECUTE, TEST_INIT, VALIDATE_EXPIRES, and VALIDATE_STR_METADATA.

498 {
499  RAII_VAR(struct ast_bucket_file *, bucket_file, NULL, bucket_file_cleanup);
500  struct timeval now = ast_tvnow();
501  char uri[1024];
502 
503  switch (cmd) {
504  case TEST_INIT:
505  info->name = __func__;
506  info->category = CATEGORY;
507  info->summary = "Test retrieval with an ETag";
508  info->description =
509  "This test covers retrieving a resource that has an ETag.\n"
510  "After retrieval of the resource, staleness is checked. With\n"
511  "matching ETags, we expect the resource to not be stale. When\n"
512  "the ETag does not match, we expect the resource to be stale.";
513  return AST_TEST_NOT_RUN;
514  case TEST_EXECUTE:
515  break;
516  }
517 
518  options.send_file = 1;
519  options.status_code = 200;
520  options.status_text = "OK";
521  options.etag = "123456789";
522 
523  snprintf(uri, sizeof(uri), "%s/%s", server_uri, "foo.wav");
524 
525  bucket_file = ast_bucket_file_retrieve(uri);
526  ast_test_validate(test, bucket_file != NULL);
527  ast_test_validate(test, !strcmp(uri, ast_sorcery_object_get_id(bucket_file)));
528  ast_test_validate(test, !ast_strlen_zero(bucket_file->path));
529  VALIDATE_STR_METADATA(test, bucket_file, "etag", options.etag);
530  VALIDATE_EXPIRES(test, bucket_file, now.tv_sec, 3);
531 
532  ast_test_validate(test, ast_bucket_file_is_stale(bucket_file) == 0);
533 
534  options.etag = "99999999";
535  ast_test_validate(test, ast_bucket_file_is_stale(bucket_file) == 1);
536 
537  return AST_TEST_PASS;
538 }
#define CATEGORY
struct ast_bucket_file * ast_bucket_file_retrieve(const char *uri)
Retrieve a bucket file.
Definition: bucket.c:814
struct timeval ast_tvnow(void)
Returns current timeval. Meant to replace calls to gettimeofday().
Definition: time.h:150
#define NULL
Definition: resample.c:96
static void bucket_file_cleanup(void *obj)
#define VALIDATE_STR_METADATA(test, bucket_file, key, expected)
#define RAII_VAR(vartype, varname, initval, dtor)
Declare a variable that will call a destructor function when it goes out of scope.
Definition: utils.h:851
int ast_bucket_file_is_stale(struct ast_bucket_file *file)
Retrieve whether or not the backing datastore views the bucket file as stale.
Definition: bucket.c:823
const char * ast_sorcery_object_get_id(const void *object)
Get the unique identifier of a sorcery object.
Definition: sorcery.c:2309
Bucket file structure, contains reference to file and information about it.
Definition: bucket.h:78
const char * status_text
def info(msg)
#define ast_strlen_zero(a)
Definition: muted.c:73
static char server_uri[512]
#define VALIDATE_EXPIRES(test, bucket_file, expected, delta)
static struct test_options options

◆ AST_TEST_DEFINE() [6/7]

AST_TEST_DEFINE ( retrieve_nominal  )

Definition at line 540 of file test_http_media_cache.c.

References ast_bucket_file_retrieve(), ast_sorcery_object_get_id(), ast_strlen_zero, AST_TEST_NOT_RUN, AST_TEST_PASS, ast_tvnow(), bucket_file_cleanup(), CATEGORY, sip_to_pjsip::info(), NULL, options, RAII_VAR, test_options::send_file, server_uri, test_options::status_code, test_options::status_text, TEST_EXECUTE, TEST_INIT, and VALIDATE_EXPIRES.

541 {
542  RAII_VAR(struct ast_bucket_file *, bucket_file, NULL, bucket_file_cleanup);
543  struct timeval now = ast_tvnow();
544  char uri[1024];
545 
546  switch (cmd) {
547  case TEST_INIT:
548  info->name = __func__;
549  info->category = CATEGORY;
550  info->summary = "Test nominal retrieval";
551  info->description =
552  "Test nominal retrieval of a resource.";
553  return AST_TEST_NOT_RUN;
554  case TEST_EXECUTE:
555  break;
556  }
557 
558  options.send_file = 1;
559  options.status_code = 200;
560  options.status_text = "OK";
561 
562  snprintf(uri, sizeof(uri), "%s/%s", server_uri, "foo.wav");
563 
564  bucket_file = ast_bucket_file_retrieve(uri);
565  ast_test_validate(test, bucket_file != NULL);
566  ast_test_validate(test, !strcmp(uri, ast_sorcery_object_get_id(bucket_file)));
567  ast_test_validate(test, !ast_strlen_zero(bucket_file->path));
568  VALIDATE_EXPIRES(test, bucket_file, now.tv_sec, 3);
569 
570  return AST_TEST_PASS;
571 }
#define CATEGORY
struct ast_bucket_file * ast_bucket_file_retrieve(const char *uri)
Retrieve a bucket file.
Definition: bucket.c:814
struct timeval ast_tvnow(void)
Returns current timeval. Meant to replace calls to gettimeofday().
Definition: time.h:150
#define NULL
Definition: resample.c:96
static void bucket_file_cleanup(void *obj)
#define RAII_VAR(vartype, varname, initval, dtor)
Declare a variable that will call a destructor function when it goes out of scope.
Definition: utils.h:851
const char * ast_sorcery_object_get_id(const void *object)
Get the unique identifier of a sorcery object.
Definition: sorcery.c:2309
Bucket file structure, contains reference to file and information about it.
Definition: bucket.h:78
const char * status_text
def info(msg)
#define ast_strlen_zero(a)
Definition: muted.c:73
static char server_uri[512]
#define VALIDATE_EXPIRES(test, bucket_file, expected, delta)
static struct test_options options

◆ AST_TEST_DEFINE() [7/7]

AST_TEST_DEFINE ( create_nominal  )

Definition at line 573 of file test_http_media_cache.c.

References ast_bucket_file_alloc(), ast_bucket_file_create(), ast_bucket_file_temporary_create(), AST_TEST_NOT_RUN, AST_TEST_PASS, ast_tvnow(), bucket_file_cleanup(), CATEGORY, sip_to_pjsip::info(), NULL, options, RAII_VAR, test_options::send_file, server_uri, test_options::status_code, test_options::status_text, TEST_EXECUTE, TEST_INIT, and VALIDATE_EXPIRES.

574 {
575  RAII_VAR(struct ast_bucket_file *, bucket_file, NULL, bucket_file_cleanup);
576  struct timeval now = ast_tvnow();
577  char uri[1024];
578 
579  switch (cmd) {
580  case TEST_INIT:
581  info->name = __func__;
582  info->category = CATEGORY;
583  info->summary = "Test nominal creation";
584  info->description =
585  "Test nominal creation of a resource.";
586  return AST_TEST_NOT_RUN;
587  case TEST_EXECUTE:
588  break;
589  }
590 
591  options.send_file = 1;
592  options.status_code = 200;
593  options.status_text = "OK";
594 
595  snprintf(uri, sizeof(uri), "%s/%s", server_uri, "foo.wav");
596 
597  bucket_file = ast_bucket_file_alloc(uri);
598  ast_test_validate(test, bucket_file != NULL);
599  ast_test_validate(test, ast_bucket_file_temporary_create(bucket_file) == 0);
600  ast_test_validate(test, ast_bucket_file_create(bucket_file) == 0);
601  VALIDATE_EXPIRES(test, bucket_file, now.tv_sec, 3);
602 
603  return AST_TEST_PASS;
604 }
#define CATEGORY
struct timeval ast_tvnow(void)
Returns current timeval. Meant to replace calls to gettimeofday().
Definition: time.h:150
#define NULL
Definition: resample.c:96
struct ast_bucket_file * ast_bucket_file_alloc(const char *uri)
Allocate a new bucket file.
Definition: bucket.c:662
static void bucket_file_cleanup(void *obj)
#define RAII_VAR(vartype, varname, initval, dtor)
Declare a variable that will call a destructor function when it goes out of scope.
Definition: utils.h:851
Bucket file structure, contains reference to file and information about it.
Definition: bucket.h:78
const char * status_text
def info(msg)
static char server_uri[512]
int ast_bucket_file_temporary_create(struct ast_bucket_file *file)
Common file snapshot creation callback for creating a temporary file.
Definition: bucket.c:898
#define VALIDATE_EXPIRES(test, bucket_file, expected, delta)
static struct test_options options
int ast_bucket_file_create(struct ast_bucket_file *file)
Create a new bucket file in backend storage.
Definition: bucket.c:724

◆ bucket_file_cleanup()

static void bucket_file_cleanup ( void *  obj)
static

Definition at line 213 of file test_http_media_cache.c.

References ao2_ref, and ast_bucket_file_delete().

Referenced by AST_TEST_DEFINE().

214 {
215  struct ast_bucket_file *bucket_file = obj;
216 
217  if (bucket_file) {
218  ast_bucket_file_delete(bucket_file);
219  ao2_ref(bucket_file, -1);
220  }
221 }
#define ao2_ref(o, delta)
Definition: astobj2.h:464
int ast_bucket_file_delete(struct ast_bucket_file *file)
Delete a bucket file from backend storage.
Definition: bucket.c:843
Bucket file structure, contains reference to file and information about it.
Definition: bucket.h:78

◆ http_callback()

static int http_callback ( struct ast_tcptls_session_instance ser,
const struct ast_http_uri urih,
const char *  uri,
enum ast_http_method  method,
struct ast_variable get_params,
struct ast_variable headers 
)
static

Definition at line 91 of file test_http_media_cache.c.

References ast_free, ast_http_error(), AST_HTTP_GET, ast_http_request_close_on_completion(), ast_http_send(), ast_localtime(), ast_log, ast_str_append(), ast_str_buffer(), ast_str_create, ast_str_strlen(), ast_strftime(), ast_strlen_zero, buf, test_options::cache_control, errno, error(), test_options::etag, test_options::expires, LOG_ERROR, test_options::maxage, test_options::must_revalidate, ast_variable::name, ast_variable::next, test_options::no_cache, NULL, options, test_options::s_maxage, test_options::send_file, SET_OR_APPEND_CACHE_CONTROL, test_options::status_code, test_options::status_text, and ast_variable::value.

92 {
93  char file_name[64] = "/tmp/test-media-cache-XXXXXX";
94  struct ast_str *http_header = ast_str_create(128);
95  struct ast_str *cache_control = ast_str_create(128);
96  int fd = -1;
97  int unmodified = 0;
98  int send_file = options.send_file && method == AST_HTTP_GET;
99 
100  if (!http_header) {
101  goto error;
102  }
103 
104  if (send_file) {
105  char buf[1024];
106 
107  fd = mkstemp(file_name);
108  if (fd == -1) {
109  ast_log(LOG_ERROR, "Unable to open temp file for testing: %s (%d)", strerror(errno), errno);
110  goto error;
111  }
112 
113  memset(buf, 1, sizeof(buf));
114  if (write(fd, buf, sizeof(buf)) != sizeof(buf)) {
115  ast_log(LOG_ERROR, "Failed to write expected number of bytes to pipe\n");
116  close(fd);
117  goto error;
118  }
119  close(fd);
120 
121  fd = open(file_name, 0);
122  if (fd == -1) {
123  ast_log(LOG_ERROR, "Unable to open temp file for testing: %s (%d)", strerror(errno), errno);
124  goto error;
125  }
126  }
127 
129  SET_OR_APPEND_CACHE_CONTROL(cache_control);
130  ast_str_append(&cache_control, 0, "max-age=%d", options.cache_control.maxage);
131  }
132 
134  SET_OR_APPEND_CACHE_CONTROL(cache_control);
135  ast_str_append(&cache_control, 0, "s-maxage=%d", options.cache_control.s_maxage);
136  }
137 
139  SET_OR_APPEND_CACHE_CONTROL(cache_control);
140  ast_str_append(&cache_control, 0, "%s", "no-cache");
141  }
142 
144  SET_OR_APPEND_CACHE_CONTROL(cache_control);
145  ast_str_append(&cache_control, 0, "%s", "must-revalidate");
146  }
147 
148  if (ast_str_strlen(cache_control)) {
149  ast_str_append(&http_header, 0, "%s\r\n", ast_str_buffer(cache_control));
150  }
151 
152  if (options.expires.tv_sec) {
153  struct ast_tm now_time;
154  char tmbuf[64];
155 
156  ast_localtime(&options.expires, &now_time, NULL);
157  ast_strftime(tmbuf, sizeof(tmbuf), "%a, %d %b %Y %T %z", &now_time);
158  ast_str_append(&http_header, 0, "Expires: %s\r\n", tmbuf);
159  }
160 
161  if (!ast_strlen_zero(options.etag)) {
162  struct ast_variable *v;
163 
164  ast_str_append(&http_header, 0, "ETag: %s\r\n", options.etag);
165  for (v = headers; v; v = v->next) {
166  if (!strcasecmp(v->name, "If-None-Match") && !strcasecmp(v->value, options.etag)) {
167  unmodified = 1;
168  break;
169  }
170  }
171  }
172 
173  if (!unmodified) {
174  ast_http_send(ser, method, options.status_code, options.status_text, http_header, NULL, send_file ? fd : 0, 1);
175  } else {
176  ast_http_send(ser, method, 304, "Not Modified", http_header, NULL, 0, 1);
177  }
178 
179  if (send_file) {
180  close(fd);
181  unlink(file_name);
182  }
183 
184  ast_free(cache_control);
185 
186  return 0;
187 
188 error:
189  ast_free(http_header);
190  ast_free(cache_control);
192  ast_http_error(ser, 418, "I'm a Teapot", "Please don't ask me to brew coffee.");
193 
194  return 0;
195 }
struct ast_variable * next
#define SET_OR_APPEND_CACHE_CONTROL(str)
void ast_http_error(struct ast_tcptls_session_instance *ser, int status, const char *title, const char *text)
Send HTTP error message and close socket.
Definition: http.c:648
char buf[BUFSIZE]
Definition: eagi_proxy.c:66
char * ast_str_buffer(const struct ast_str *buf)
Returns the string buffer within the ast_str buf.
Definition: strings.h:714
struct ast_tm * ast_localtime(const struct timeval *timep, struct ast_tm *p_tm, const char *zone)
Timezone-independent version of localtime_r(3).
Definition: localtime.c:1739
Structure for variables, used for configurations and for channel variables.
int ast_str_append(struct ast_str **buf, ssize_t max_len, const char *fmt,...)
Append to a thread local dynamic string.
Definition: strings.h:1091
#define NULL
Definition: resample.c:96
struct test_options::@499 cache_control
void ast_http_send(struct ast_tcptls_session_instance *ser, enum ast_http_method method, int status_code, const char *status_title, struct ast_str *http_header, struct ast_str *out, int fd, unsigned int static_content)
Generic function for sending HTTP/1.1 response.
Definition: http.c:456
#define ast_log
Definition: astobj2.c:42
const char * method
Definition: res_pjsip.c:4180
struct timeval expires
#define LOG_ERROR
Definition: logger.h:285
const char * status_text
The descriptor of a dynamic string XXX storage will be optimized later if needed We use the ts field ...
Definition: strings.h:584
int errno
#define ast_strlen_zero(a)
Definition: muted.c:73
#define ast_free(a)
Definition: astmm.h:182
int ast_strftime(char *buf, size_t len, const char *format, const struct ast_tm *tm)
Special version of strftime(3) that handles fractions of a second. Takes the same arguments as strfti...
Definition: localtime.c:2524
size_t ast_str_strlen(const struct ast_str *buf)
Returns the current length of the string stored within buf.
Definition: strings.h:688
int error(const char *format,...)
Definition: utils/frame.c:999
static struct test_options options
void ast_http_request_close_on_completion(struct ast_tcptls_session_instance *ser)
Request the HTTP connection be closed after this HTTP request.
Definition: http.c:836
#define ast_str_create(init_len)
Create a malloc&#39;ed dynamic length string.
Definition: strings.h:620

◆ load_module()

static int load_module ( void  )
static

Definition at line 655 of file test_http_media_cache.c.

References ast_http_uri_link(), AST_MODULE_LOAD_DECLINE, AST_MODULE_LOAD_SUCCESS, AST_TEST_REGISTER, CATEGORY, pre_test_cb(), and process_config().

Referenced by unload_module().

656 {
657  if (process_config(0)) {
659  }
660 
661  if (ast_http_uri_link(&test_uri)) {
663  }
664 
665  AST_TEST_REGISTER(create_nominal);
666 
667  AST_TEST_REGISTER(retrieve_nominal);
668  AST_TEST_REGISTER(retrieve_etag);
669  AST_TEST_REGISTER(retrieve_expires);
670  AST_TEST_REGISTER(retrieve_etag_expired);
671  AST_TEST_REGISTER(retrieve_cache_control_age);
672  AST_TEST_REGISTER(retrieve_cache_control_directives);
673 
674  ast_test_register_init(CATEGORY, pre_test_cb);
675 
677 }
#define CATEGORY
int ast_http_uri_link(struct ast_http_uri *urihandler)
Register a URI handler.
Definition: http.c:673
#define AST_TEST_REGISTER(cb)
Definition: test.h:127
static int process_config(int reload)
static int pre_test_cb(struct ast_test_info *info, struct ast_test *test)
Module has failed to load, may be in an inconsistent state.
Definition: module.h:78
static struct ast_http_uri test_uri

◆ pre_test_cb()

static int pre_test_cb ( struct ast_test_info info,
struct ast_test *  test 
)
static

Definition at line 206 of file test_http_media_cache.c.

References options.

Referenced by load_module().

207 {
208  memset(&options, 0, sizeof(options));
209 
210  return 0;
211 }
static struct test_options options

◆ process_config()

static int process_config ( int  reload)
static

Definition at line 607 of file test_http_media_cache.c.

References ast_config_destroy(), ast_config_load, ast_config_option(), ast_false(), bindaddr, config, CONFIG_FLAG_FILEUNCHANGED, CONFIG_STATUS_FILEINVALID, CONFIG_STATUS_FILEUNCHANGED, enabled, prefix, S_OR, server_uri, and TEST_URI.

Referenced by load_module(), and reload_module().

608 {
609  struct ast_config *config;
610  struct ast_flags config_flags = { reload ? CONFIG_FLAG_FILEUNCHANGED : 0 };
611  const char *bindaddr;
612  const char *bindport;
613  const char *prefix;
614  const char *enabled;
615 
616  config = ast_config_load("http.conf", config_flags);
617  if (!config || config == CONFIG_STATUS_FILEINVALID) {
618  return -1;
619  } else if (config == CONFIG_STATUS_FILEUNCHANGED) {
620  return 0;
621  }
622 
623  enabled = ast_config_option(config, "general", "enabled");
624  if (!enabled || ast_false(enabled)) {
625  ast_config_destroy(config);
626  return -1;
627  }
628 
629  /* Construct our Server URI */
630  bindaddr = ast_config_option(config, "general", "bindaddr");
631  if (!bindaddr) {
632  ast_config_destroy(config);
633  return -1;
634  }
635 
636  bindport = ast_config_option(config, "general", "bindport");
637  if (!bindport) {
638  bindport = "8088";
639  }
640 
641  prefix = ast_config_option(config, "general", "prefix");
642 
643  snprintf(server_uri, sizeof(server_uri), "http://%s:%s%s/%s", bindaddr, bindport, S_OR(prefix, ""), TEST_URI);
644 
645  ast_config_destroy(config);
646 
647  return 0;
648 }
char * config
Definition: conf2ael.c:66
#define CONFIG_STATUS_FILEINVALID
#define ast_config_load(filename, flags)
Load a config file.
void ast_config_destroy(struct ast_config *config)
Destroys a config.
Definition: extconf.c:1290
#define CONFIG_STATUS_FILEUNCHANGED
#define TEST_URI
static char server_uri[512]
static int reload(void)
Definition: cdr_mysql.c:741
Structure used to handle boolean flags.
Definition: utils.h:199
#define S_OR(a, b)
returns the equivalent of logic or for strings: first one if not empty, otherwise second one...
Definition: strings.h:79
int attribute_pure ast_false(const char *val)
Make sure something is false. Determine if a string containing a boolean value is "false"...
Definition: main/utils.c:1838
const char * ast_config_option(struct ast_config *cfg, const char *cat, const char *var)
Retrieve a configuration variable within the configuration set.
Definition: main/config.c:684
struct ast_sockaddr bindaddr
Definition: chan_ooh323.c:353
static char prefix[MAX_PREFIX]
Definition: http.c:141
static int enabled
Definition: dnsmgr.c:91

◆ reload_module()

static int reload_module ( void  )
static

Definition at line 650 of file test_http_media_cache.c.

References process_config().

Referenced by unload_module().

651 {
652  return process_config(1);
653 }
static int process_config(int reload)

◆ unload_module()

static int unload_module ( void  )
static

Definition at line 679 of file test_http_media_cache.c.

References ast_http_uri_unlink(), AST_MODFLAG_DEFAULT, AST_MODULE_INFO(), AST_MODULE_SUPPORT_CORE, AST_TEST_UNREGISTER, ASTERISK_GPL_KEY, load_module(), reload(), and reload_module().

680 {
682 
683  AST_TEST_UNREGISTER(create_nominal);
684 
685  AST_TEST_UNREGISTER(retrieve_nominal);
686  AST_TEST_UNREGISTER(retrieve_etag);
687  AST_TEST_UNREGISTER(retrieve_expires);
688  AST_TEST_UNREGISTER(retrieve_etag_expired);
689  AST_TEST_UNREGISTER(retrieve_cache_control_age);
690  AST_TEST_UNREGISTER(retrieve_cache_control_directives);
691 
692  return 0;
693 }
void ast_http_uri_unlink(struct ast_http_uri *urihandler)
Unregister a URI handler.
Definition: http.c:705
#define AST_TEST_UNREGISTER(cb)
Definition: test.h:128
static struct ast_http_uri test_uri

Variable Documentation

◆ __mod_info

struct ast_module_info __mod_info = { .name = AST_MODULE, .flags = AST_MODFLAG_DEFAULT , .description = "HTTP Media Cache Backend Tests" , .key = "This paragraph is copyright (c) 2006 by Digium, Inc. \In order for your module to load, it must return this \key via a function called \"key\". Any code which \includes this paragraph must be licensed under the GNU \General Public License version 2 or later (at your \option). In addition to Digium's general reservations \of rights, Digium expressly reserves the right to \allow other parties to license this paragraph under \different terms. Any use of Digium, Inc. trademarks or \logos (including \"Asterisk\" or \"Digium\") without \express written permission of Digium, Inc. is prohibited.\n" , .buildopt_sum = AST_BUILDOPT_SUM, .support_level = AST_MODULE_SUPPORT_CORE, .load = load_module, .reload = reload_module, .unload = unload_module, }
static

Definition at line 700 of file test_http_media_cache.c.

◆ ast_module_info

const struct ast_module_info* ast_module_info = &__mod_info
static

Definition at line 700 of file test_http_media_cache.c.

◆ options

struct test_options options
static
Examples:
/tmp/asterisk-shallow/main/app.c.

Definition at line 62 of file test_http_media_cache.c.

Referenced by __ssl_setup(), agent_login_exec(), app_exec(), aqm_exec(), ast_ari_bridges_record(), ast_ari_channels_record(), AST_TEST_DEFINE(), audiosocket_request(), auth_exec(), bridge_exec(), bridgewait_exec(), cdr_prop_write_callback(), cdr_read_callback(), cdr_write(), cdr_write_callback(), chanavail_exec(), chanspy_exec(), conf_exec(), controlplayback_exec(), dial_exec_full(), directory_exec(), disa_exec(), dundi_query_read(), dundifunc_read(), enable_jack_hook(), extenspy_exec(), feature_automixmonitor(), feature_automonitor(), file_read(), file_write(), forkcdr_exec(), function_enum(), generate_rtpmap_attr(), get_codecs(), handle_cli_presencestate_change(), handle_cli_presencestate_list(), handle_request_subscribe(), handle_updates(), hash_ao2_container_init(), hash_ao2_insert_node(), hint_read(), http_callback(), manager_mixmonitor(), milliwatt_exec(), mixmonitor_exec(), multicast_rtp_request(), originate_exec(), ospauth_exec(), ospfinished_exec(), osplookup_exec(), ospnext_exec(), page_state_callback(), park_and_announce_app_exec(), park_app_parse_data(), pbx_builtin_background(), pbx_builtin_incomplete(), pbx_builtin_saycharacters_case(), pbx_builtin_saynumber(), pbx_builtin_waitexten(), pickupchan_exec(), playback_exec(), pqm_exec(), pre_session_setup(), pre_test_cb(), presence_read(), presence_write(), privacy_exec(), process_echocancel(), queue_exec(), rb_ao2_container_init(), rb_ao2_insert_node(), rcvfax_exec(), read_exec(), readexten_exec(), receivefax_exec(), record_exec(), say_digit_str_full(), sayunixtime_exec(), search_directory_sub(), sendfax_exec(), sendurl_exec(), set_general_options(), sip_parse_nat_option(), sla_add_trunk_to_station(), sla_trunk_exec(), smdi_msg_retrieve_read(), sms_exec(), sndfax_exec(), softhangup_exec(), sorcery_memory_cache_open(), start_monitor_exec(), stir_shaken_cli_show(), unicast_rtp_request(), upqm_exec(), vmauthenticate(), volume_write(), xmpp_pubsub_build_publish_skeleton(), xmpp_pubsub_subscribe(), and zapateller_exec().

◆ server_uri

char server_uri[512]
static

◆ test_uri

struct ast_http_uri test_uri
static

Definition at line 197 of file test_http_media_cache.c.