summaryrefslogtreecommitdiff
path: root/tests
AgeCommit message (Collapse)Author
2010-07-29Merged revisions 280446 via svnmerge from Paul Belanger
https://origsvn.digium.com/svn/asterisk/branches/1.8 ........ r280446 | pabelanger | 2010-07-29 14:37:32 -0400 (Thu, 29 Jul 2010) | 2 lines Remove res_crypto dependency. ........ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@280447 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-07-29Merged revisions 280414 via svnmerge from Paul Belanger
https://origsvn.digium.com/svn/asterisk/branches/1.8 ........ r280414 | pabelanger | 2010-07-29 12:44:22 -0400 (Thu, 29 Jul 2010) | 2 lines crypto_loaded_test depends on res_crypto, else test will fail. ........ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@280415 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-07-25Merged revisions 279442 via svnmerge from Paul Belanger
https://origsvn.digium.com/svn/asterisk/branches/1.8 ........ r279442 | pabelanger | 2010-07-25 17:26:42 -0400 (Sun, 25 Jul 2010) | 2 lines Add trailing backslash to silence warning message. ........ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@279443 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-07-21make func_file unit test's category consistent with other testsDavid Vossel
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@278539 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-07-19Remove the fe80:1234::1234 test case from test_acl.cMark Michelson
The ACL test was failing on Mac OS X because it would convert the above invalid link-local address into fe80::1234 while reporting no error from getaddrinfo(). Linux does not do this. git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@277872 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-07-19Make ACLs IPv6-capable.Mark Michelson
ACLs can now be configured to match IPv6 networks. This is only relevant for ACLs in chan_sip for now since other channel drivers do not support IPv6 addressing. However, once those channel drivers are outfitted to support IPv6 addressing, the ACLs will already be ready for IPv6 support. https://reviewboard.asterisk.org/r/791 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@277814 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-07-16updated devicestate test for device state changesMatthew Nicholson
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@277409 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-07-16Fix trunk build for Mac OS X 10.6Tilghman Lesher
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@276870 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-07-14Remove the old stub files, preferring the optional_api method.Tilghman Lesher
(closes issue #17475) Reported by: tilghman Review: https://reviewboard.asterisk.org/r/695/ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@276490 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-07-14ast_callerid restructuringRichard Mudgett
The purpose of this patch is to eliminate struct ast_callerid since it has turned into a miscellaneous collection of various party information. Eliminate struct ast_callerid and replace it with the following struct organization: struct ast_party_name { char *str; int char_set; int presentation; unsigned char valid; }; struct ast_party_number { char *str; int plan; int presentation; unsigned char valid; }; struct ast_party_subaddress { char *str; int type; unsigned char odd_even_indicator; unsigned char valid; }; struct ast_party_id { struct ast_party_name name; struct ast_party_number number; struct ast_party_subaddress subaddress; char *tag; }; struct ast_party_dialed { struct { char *str; int plan; } number; struct ast_party_subaddress subaddress; int transit_network_select; }; struct ast_party_caller { struct ast_party_id id; char *ani; int ani2; }; The new organization adds some new information as well. * The party name and number now have their own presentation value that can be manipulated independently. ISDN supplies the presentation value for the name and number at different times with the possibility that they could be different. * The party name and number now have a valid flag. Before this change the name or number string could be empty if the presentation were restricted. Most channel drivers assume that the name or number is then simply not available instead of indicating that the name or number was restricted. * The party name now has a character set value. SIP and Q.SIG have the ability to indicate what character set a name string is using so it could be presented properly. * The dialed party now has a numbering plan value that could be useful to have available. The various channel drivers will need to be updated to support the new core features as needed. They have simply been converted to supply current functionality at this time. The following items of note were either corrected or enhanced: * The CONNECTEDLINE() and REDIRECTING() dialplan functions were consolidated into func_callerid.c to share party id handling code. * CALLERPRES() is now deprecated because the name and number have their own presentation values. * Fixed app_alarmreceiver.c write_metadata(). The workstring[] could contain garbage. It also can only contain the caller id number so using ast_callerid_parse() on it is silly. There was also a typo in the CALLERNAME if test. * Fixed app_rpt.c using ast_callerid_parse() on the channel's caller id number string. ast_callerid_parse() alters the given buffer which in this case is the channel's caller id number string. Then using ast_shrink_phone_number() could alter it even more. * Fixed caller ID name and number memory leak in chan_usbradio.c. * Fixed uninitialized char arrays cid_num[] and cid_name[] in sig_analog.c. * Protected access to a caller channel with lock in chan_sip.c. * Clarified intent of code in app_meetme.c sla_ring_station() and dial_trunk(). Also made save all caller ID data instead of just the name and number strings. * Simplified cdr.c set_one_cid(). It hand coded the ast_callerid_merge() function. * Corrected some weirdness with app_privacy.c's use of caller presentation. Review: https://reviewboard.asterisk.org/r/702/ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@276347 65c4cc65-6c06-0410-ace0-fbb531ad65f3
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