summaryrefslogtreecommitdiff
path: root/tests
AgeCommit message (Collapse)Author
2010-07-13FILE() now supports line-mode and writing (altering) files.Tilghman Lesher
(closes issue #16461) Reported by: skyman Patches: 20100622__issue16461.diff.txt uploaded by tilghman (license 14) Tested by: tilghman Review: https://reviewboard.asterisk.org/r/737/ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@276114 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-07-09Kill some startup warnings and errors and make some messages more helpful in ↵Tilghman Lesher
tracking down the source. git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@275105 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-06-10Fix an off by one error that caused a unit test to occasionally crash.Russell Bryant
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@269711 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-06-02Generic Advice of Charge.Richard Mudgett
Asterisk Generic AOC Representation - Generic AOC encode/decode routines. (Generic AOC must be encoded to be passed on the wire in the AST_CONTROL_AOC frame) - AST_CONTROL_AOC frame type to represent generic encoded AOC data - Manager events for AOC-S, AOC-D, and AOC-E messages Asterisk App Support - app_dial AOC-S pass-through support on call setup - app_queue AOC-S pass-through support on call setup AOC Unit Tests - AOC Unit Tests for encode/decode routines - AOC Unit Test for manager event representation. SIP AOC Support - Pass-through of generic AOC-D and AOC-E messages to snom phones via the snom AOC specification. - Creation of chan_sip page3 flags for the addition of the new 'snom_aoc_enabled' sip.conf option. IAX AOC Support - Natively supports AOC pass-through through the use of the new AST_CONTROL_AOC frame type DAHDI AOC Support - ETSI PRI full AOC Pass-through support - 'aoc_enable' chan_dahdi.conf option for independently enabling pass-through of AOC-S, AOC-D, AOC-E. - 'aoce_delayhangup' option for retrieving AOC-E on disconnect. - DAHDI A() dial string option for requesting AOC services. example usage: ;requests AOC-S, AOC-D, and AOC-E on call setup exten=>1111,1,Dial(DAHDI/g1/1112/A(s,d,e)) Review: https://reviewboard.asterisk.org/r/552/ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@267096 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-06-01Support setting locale per-mailbox (changes date/time languages for email, ↵Tilghman Lesher
pager messages). (closes issue #14333) Reported by: klaus3000 Patches: 20090515__issue14333.diff.txt uploaded by tilghman (license 14) app_voicemail.c-svn-trunk-rev211675-patch.txt uploaded by klaus3000 (license 65) Tested by: klaus3000 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@266828 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-05-13Add kqueue(2) implementation to Asterisk in various places.Tilghman Lesher
This will save a considerable amount of CPU on the BSDs, including Mac OS X, as it eliminates several places in the code that we previously used a busy loop. Additionally, this adds a res_timing interface, using kqueue timers. Review: https://reviewboard.asterisk.org/r/543/ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@262852 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-05-06Add test case for removing random elements from a heap.Russell Bryant
I modified the original patch for trunk to use the unit test API. (issue #17277) Reported by: cappucinoking Patches: test_heap.diff uploaded by cappucinoking (license 1036) Tested by: cappucinoking, russell git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@261500 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-04-22Add ast_event subscription unit test and fix some ast_event API bugs.Russell Bryant
This patch introduces another test in test_event.c that exercises most of the subscription related ast_event API calls. I made some minor additions to the existing event allocation test to increase API coverage by the test code. Finally, I made a list in a comment of API calls not yet touched by the test module as a to-do list for future test development. During the development of this test code, I discovered a number of bugs in the event API. 1) subscriptions to AST_EVENT_ALL were not handled appropriately in a couple of different places. The API allows a subscription to all event types, but with IE parameters, just as if it was a subscription to a specific event type. However, the parameters were being ignored. This affected ast_event_check_subscriber() and event distribution to subscribers. 2) Some of the logic in ast_event_check_subscriber() for checking subscriptions against query parameters was wrong. Review: https://reviewboard.asterisk.org/r/617/ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@258632 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-04-15Merged revisions 257544 via svnmerge from Tilghman Lesher
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r257544 | tilghman | 2010-04-15 16:23:24 -0500 (Thu, 15 Apr 2010) | 6 lines Allow application options with arguments to contain parentheses, through a variety of escaping techniques. Fixes SWP-1194 (ABE-2143). Review: https://reviewboard.asterisk.org/r/604/ ........ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@257560 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-04-12test_substitution expects func_curl to be present to work.Russell Bryant
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@256783 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-04-11Add ASTERISK_FILE_VERSION() macroRussell Bryant
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@256745 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-04-09Fix some compiler errors that popped up after the CCSS merge.Mark Michelson
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@256529 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-03-25Add unit test for testing ACL functionality.Mark Michelson
There are two unit tests contained here. 1. "Invalid ACL" This attempts to read a bunch of badly formatted ACL entries and add them to a host access rule. The goal of this test is to be sure that all invalid entries are rejected as they should be. 2. "ACL" This sets up four ACLs. One is a permit all, one is a deny all, and the other two have specific rules about which subnets are allowed and which are not. Then a set of test addresses is used to determine whether we would allow those addresses to access us when each ACL is applied. This test, by the way, was what resulted in AST-2010-003's creation. Review: https://reviewboard.asterisk.org/r/532 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@254557 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-03-23Change the name of the category 'TEST' to match the name of the subdirTzafrir Cohen
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@254001 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-03-17Switch to using intptr_t, as suggested by Kevin Fleming on the -dev listTilghman Lesher
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@253113 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-03-17Argh.Tilghman Lesher
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@253004 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-03-17Fix bamboo compile error by calculating an integer with the same size as a ↵Tilghman Lesher
pointer. git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@252980 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-03-16Mask out previous arguments on each nested invocation of Gosub.Tilghman Lesher
(closes issue #16758) Reported by: wdoekes Patches: 20100316__issue16758.diff.txt uploaded by tilghman (license 14) Review: https://reviewboard.asterisk.org/r/561/ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@252976 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-03-16Re-enable test_time on non-Linux.Russell Bryant
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@252849 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-03-16Fix test_time on Mac OS X (and other platforms without inotify)Tilghman Lesher
Reviewboard: https://reviewboard.asterisk.org/r/554/ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@252846 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-03-16Disable this test on non-Linux for now.Russell Bryant
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@252759 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-03-13Resolve compiler warning by paying attention to system() return value.Russell Bryant
This resolves the last compile failure on bamboo. git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@252229 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-03-12Test script to verify that timezone cache is properly removed on zonefile ↵Tilghman Lesher
alteration. git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@252133 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-03-11Fix tests on 32-bit systems.Tilghman Lesher
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@251881 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-03-10Add new unit test for stringfields.Jeff Peeler
(Copied from reviewboard) Tests the following: 1. Basic allocation and setting of string fields. 2. Shrinking a string field and re-expanding it. 3. Growing the last allocation in a string field pool. 4. Setting a string to a large value such that a new string field pool must be allocated. In each part, we make sure that the string field is accurate (has the correct value in it), make sure that the 2 bytes before the string field has the correct capacity for the field, and for tests 2-4, we make sure that the string field is where we expect it to be in memory. Also tested: 5. Shrinking a string field and partially re-expanding it. 6. Setting strings in such a way as to create three separate string field pools and then removing the middle pool. There is a bug fix in the init function, which ensures the embedded_pool is set to NULL which is important for stack allocated structures. Review: https://reviewboard.asterisk.org/r/185/ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@251736 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-03-10It's amazing what writing a test will find.Tilghman Lesher
(issue #16900) Reported by: bluecrow76 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@251677 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-03-02base64 unit testDavid Vossel
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@250235 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-02-24Add ASTERISK_FILE_VERSION macro.Russell Bryant
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@248533 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-02-23Unit test for ast_str API.Mark Michelson
Review: https://reviewboard.asterisk.org/r/517 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@248489 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-02-22Tweak copyright and author lines.Russell Bryant
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@248225 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-02-17Add support for GROUP_MATCH_COUNT regex matching on categoryJeff Peeler
Current support for regex matching was previously only available on the group. Also, error reporting for regex failures has been added. In addition to this feature enhancement a unit test has been written to check the regular expression logic to ensure the count operation is working as expected. (closes issue #16642) Reported by: kobaz Patches: groupmatch2.patch uploaded by kobaz (license 834) Review: https://reviewboard.asterisk.org/r/503/ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@247295 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-02-17modified device2extension_test's categoryDavid Vossel
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@247282 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-02-17unit test for combined device state mapping and device to exten state mappingDavid Vossel
Review: https://reviewboard.asterisk.org/r/516/ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@247262 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-02-16Add unit test for dialplan pattern matching.Mark Michelson
This test works by reading input from arrays to build a sample dialplan. From there, patterns are attempted to be matched against said dialplan, with the expected match given. We then search in our example dialplan to see if we find a match and if what we find matches what we expected it to match. (closes issue #16809) Reported by: lmadsen Tested by: mmichelson Review: https://reviewboard.asterisk.org/r/504/ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@246942 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-02-11fixes some test description formatting inconsistencies so log file looks niceDavid Vossel
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@246338 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-02-11astobj2 unit test and bug fixDavid Vossel
A bug was discovered during the creation of the astobj2 unit test. When OBJ_MULTIPLE | OBJ_UNLINK is used, the objects being returned had a ref count issue. This patch resolves that. Review: https://reviewboard.asterisk.org/r/496/ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@246299 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-02-10Add a test module for the event API, test_event.c.Russell Bryant
This module includes a single test so far that creates events using two different methods and does some verification on the result to make sure the correct data can be retrieved from the event that was created. One bug was found in the event API while developing this test, which makes me happy. :-) Review: https://reviewboard.asterisk.org/r/495/ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@246260 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-02-09Various updates to the unit test API.Russell Bryant
1) It occurred to me that the difference in usage between the error ast_str and the ast_test_update_status() usage has turned out to be a bit ambiguous in practice. In a lot of cases, the same message was being sent to both. In other cases, it was only sent to one or the other. My opinion now is that in every case, I think it makes sense to do both; we should output it to the CLI as well as save it off for logging purposes. This change results in most of the changes in this diff, since it required changes to all existing unit tests. It also allowed for some simplifications of unit test API implementation code. 2) Update ast_test_status_update() to include the file, function, and line number for the code providing the update. 3) There are some formatting tweaks here and there. Hopefully they aren't too distracting for code review purposes. Reviewboard's diff viewer seems to do a pretty good job of pointing out when something is a whitespace change. 4) I moved the md5_test and sha1_test into the test_utils module. It seemed like a better approach since these tests are so tiny. 5) I changed the number of nodes used in heap_test_2 from 1 million to 100 thousand. The only reason for this was to reduce the time it took for this test to run. 6) Remove an unused function prototype that was at the bottom of utils.h. 7) Simplify test_insert() using the LIST_INSERT_SORTALPHA() macro. The one minor difference in behavior is that it no longer checks for a test registered with the same name. 8) Expand the code in test_alloc() to provide specific error messages for each failure case, to clearly inform developers if they forget to set the name, summary, description, etc. 9) Tweak the output of the "test show registered" CLI command. I swapped the name and category to have the category first. It seemed more natural since that is the sort key. 10) Don't output the status ast_str in the "test show results" CLI command. This is going to tend to be pretty verbose, so just leave that for the detailed test logs (test generate results). Review: https://reviewboard.asterisk.org/r/493/ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@245864 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-02-08UNREGISTER instead of REGISTER in unload_module().Russell Bryant
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@245623 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-02-08Add a SHA1 test module.Russell Bryant
Review: https://reviewboard.asterisk.org/r/492/ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@245345 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-02-08Remove unnecessary include, ast_md5_hash() comes from utils.h.Russell Bryant
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@245344 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-02-07Add an MD5 test module.Russell Bryant
Review: https://reviewboard.asterisk.org/r/491/ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@245307 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-02-07Fix a couple of spelling errors, and add format module dependencies.Russell Bryant
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@245306 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-02-05Merge tests that verify the same thing. (Oops.)Tilghman Lesher
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@245046 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-01-26RFC compliant uri and display-name encode/decodeDavid Vossel
1. URI Encoding This patch changes ast_uri_encode()'s behavior when doreserved is enabled. Previously when doreserved was enabled only a small set of reserved characters were encoded. This set was comprised primarily of the reserved characters defined in RFC3261 section 25.1, but contained other characters as well. Rather than only escaping the reserved set, doreserved now escapes all characters not within the unreserved set as defined by RFC 3261 and RFC 2396. Also, the 'doreserved' variable has been renamed to 'do_special_char' in attempts to avoid confusion. When doreserve is not enabled, the previous logic of only encoding the characters <= 0X1F and > 0X7f remains, except for the '%' character, which must always be encoded as it signifies a HEX escaped character during the decode process. 2. URI Decoding: Break up URI before decode. In chan_sip.c ast_uri_decode is called on the entire URI instead of it's individual parts after it is parsed. This is not good as ast_uri_decode can introduce special characters back into the URI which can mess up parsing. This patch resolves this by not decoding a URI until parsing is completely done. There are many instances where we check to see if pedantic checking is enabled before we decode a URI. In these cases a new macro, SIP_PEDANTIC_DECODE, is used on the individual parsed segments of the URI rather than constantly putting if (pedantic) { decode() } checks everywhere in the code. In the areas where ast_uri_decode is not dependent upon pedantic checking this macro is not used, but decoding is still moved to each individual part of the URI. The only behavior that should change from this patch is the time at which decoding occurs. Since I had to look over every place URI parsing occurs to create this patch, I found several places where we use duplicate code for parsing. To consolidate the code, those areas have updated to use the parse_uri() function where possible. 3. SIP display-name decoding according to RFC3261 section 25. To properly decode the display-name portion of a FROM header, chan_sip's get_calleridname() function required a complete re-write. More information about this change can be found in the comments at the beginning of this function. 4. Unit Tests. Unit tests for ast_uri_encode, ast_uri_decode, and get_calleridname() have been written. This involved the addition of the test_utils.c file for testing the utils api. (closes issue #16299) Reported by: wdoekes Patches: astsvn-16299-get_calleridname.diff uploaded by wdoekes (license 717) get_calleridname_rewrite.diff uploaded by dvossel (license 671) Tested by: wdoekes, dvossel, Nick_Lewis Review: https://reviewboard.asterisk.org/r/469/ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@243200 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-01-26Log the variable name being tested.Russell Bryant
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@243158 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-01-26Update test_substitution to show failures in the test log.Russell Bryant
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@243157 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-01-26Fixing last errors in the conversion, though it appears that the AES_* ↵Tilghman Lesher
functions are still broken. git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@243077 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-01-26Using a dummy channel causes CDR() testing to fail.Tilghman Lesher
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@243076 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-01-26Wish I had gotten to the review before this got submitted, because there's ↵Tilghman Lesher
failures we need to address. git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@243075 65c4cc65-6c06-0410-ace0-fbb531ad65f3