test


Log

Author Commit Date CI Message
Christopher Davis 62b429af 2010-10-07T13:41:39 Make iocp/listener/error work; don't accept again if lev is disabled.
Nick Mathewson 127d4f21 2010-09-23T16:49:58 Add a LEV_OPT_THREADSAFE option for threadsafe evconnlisteners
Nick Mathewson 5b7a3706 2010-10-05T14:29:48 Fix warnings on mingw with gcc 4.5
Nick Mathewson d49b5e33 2010-09-27T15:12:55 Do not search outside of the system directory for windows DLLs Hardens against some attacks.
Nick Mathewson 045eef4c 2010-09-23T14:23:45 Unit tests for listener error callbacks
Nick Mathewson 4858b794 2010-09-15T01:54:51 Remove the now-useless evsig_caught and evsig_process
Nick Mathewson 720bd933 2010-09-15T01:08:39 Warn when using the error-prone EV_SIGNAL interface in an error-prone way. Also, fix a couple of race conditions in signal.c When using the signal.c signal backend, Libevent currently only allows one event_base to actually receive signals at a time. (This has been the behavior since at least 1.4 and probably much earlier.) Now, we detect and warn if you're likely to be racing about which signal goes to which thread. We also add a lock to control modifications of the evsig_base field, to avoid race conditions like those found by Jason Toffaletti. Also, more comments. Comments are good.
Nick Mathewson f0bd83ea 2010-09-09T16:13:09 Bump to the latest version of tinytest This lets us do without libevent-specific code in tinytest.c, and lets us add a feature to skip individual tests from the command line.
Nick Mathewson a5ce9ad4 2010-09-09T16:01:42 Make SSL tests cover enabling/disabling EV_READ. I want my 80% coverage.
Nick Mathewson 2756a10c 2010-09-09T13:43:31 Add a missing time.h include to test/regress_thread.c
Nick Mathewson fb36f9a7 2010-09-09T13:00:54 Fix an uninitialized-variable warning on windows
Christopher Davis 3ec65d69 2010-09-08T19:55:13 Fix a few Windows compile warnings.
Nick Mathewson 25b6a74b 2010-09-08T14:53:57 Merge branch 'tests'
Nick Mathewson de412948 2010-09-08T14:52:24 Add a missing header for regress_thread.c
Sebastian Hahn 911e0db8 2010-09-08T20:29:39 Fix a compile warning in regress_thread.c
Nick Mathewson 3658b169 2010-09-08T14:12:12 Merge remote branch 'chrisd/iocp-fixes4' Conflicts: test/regress_thread.c
Nick Mathewson 9580e282 2010-09-08T14:00:45 Merge branch 'th_notify_fd_reinit'
Nick Mathewson ce85280b 2010-09-08T13:29:06 Improve testing of when thread-notification occurs
Christopher Davis 17a14f1a 2010-09-01T11:04:57 Only process up to MAX_DEFERRED deferred_cbs at a time. If threads queue callbacks while event_process_deferred_callbacks is running, the loop may spin long enough to significantly skew timers. A unit test stressing this behavior is also in this commit.
Christopher Davis 2447fe88 2010-08-28T04:07:48 Add event_config_set_num_cpus_hint for tuning thread pools, etc.
Christopher Davis 499452f4 2010-08-28T02:44:11 IOCP-related unit test tweaks
Christopher Davis d844242f 2010-08-28T02:08:27 Stop IOCP when freeing the event_base.
Nick Mathewson 1115366e 2010-09-07T10:28:15 Fix a few memory leaks in the tests
Nick Mathewson 42090072 2010-09-06T15:47:07 Move the "function to getsockname() on a listener" to regress_testutils This reverts commit fab50488fcb741884ccdfa7b83643eac3e5c9cbf. The function was, on reflection, not important enough to break the feature freeze, since it's trivial to build on your own.
Shuo Chen b0f284cb 2010-09-06T10:10:17 Fix event_del(0) instance in bench.c
Nick Mathewson b5dd8064 2010-09-03T22:00:25 Fix uninitialized port var in http_delete_test. Last one, I hope.
Nick Mathewson 3b3fb743 2010-09-03T21:03:25 Fix uninitialized variables in http_bad_request_test. (oops)
Nick Mathewson a97320ac 2010-09-03T18:48:31 Allow more than one copy of regression tests to run at once Mostly this was a matter of just removing all the hardwired ports in the test code. The http/connection_retry test is still a little screwy, though.
Nick Mathewson 041989fb 2010-08-17T14:44:12 Rename regress_pthread.c to regress_thread.c
Nick Mathewson 743f8665 2010-08-23T11:48:46 Honor NDEBUG; build without warnings with NDEBUG; make NDEBUG always-off in unit test code
Nick Mathewson 5fb10958 2010-08-16T22:55:45 Add a unit test for conditions
Nick Mathewson d74ae381 2010-08-16T12:38:22 Make the regress_pthread.c tests work on windows with current test APIs
Nick Mathewson 4022b287 2010-08-13T11:34:39 Change include order in Makefile.nmake If there is an event-config.h in include/event2 (either because we screwed up packaging like in 2.0.6-rc or because we previously tried building with mingw and we didn't make distclean in the middle), we want MSVC to find the one one in WIN32-Code/include/event2 first. Found by Gilad Benjamini.
Nick Mathewson 0bffe43a 2010-08-09T12:08:40 Fix a nasty dangling-event bug when using rate-limiting groups When we freed a bufferevent that was in a rate-limiting group and blocked on IO, the process of freeing it caused it to get removed from the group. But removing the bufferevent from the group made its limits get removed, which could make it get un-suspended and in turn cause its events to get re-added. Since we would then immediately _free_ the events, this would result in dangling pointers. Fixes bug 3041007.
Nick Mathewson ec347b92 2010-07-07T16:45:03 Move event-config.h to include/event2 This change means that all required include files are in event2, and all files not in event2/* are optional.
Nick Mathewson 28f31a4f 2010-08-06T16:36:23 Fix unit tests with -DUSE_DEBUG enabled If you were to enable USE_DEBUG and slog through all 700+ MB of debugging output, you'd find that one of the unit tests failed, since it tested the debug logging code, but the string it expected and the string it logged differed by a tab vs 2 spaces.
Nick Mathewson ea1ea3d6 2010-08-06T13:34:51 Make test-changelist count cpu usage right on win32
Nick Mathewson 9b602096 2010-08-06T13:03:17 Use AF_INET socketpair to test sendfile on Solaris
Nick Mathewson 170ffd2b 2010-08-05T15:57:30 Increase the tolerance in our unit tests for sloppy clocks. (Apparently openbsd in virtualbox just doesn't keep very accurate time.)
Nick Mathewson e996b3d4 2010-08-05T15:51:16 Make tests quieter on local dns resolver failure
Nick Mathewson b2c6202d 2010-08-04T15:52:32 Fix an assertion bug in test-ratelim If the rate limit was low enough, then the echo_conns wouldn't finish inside the 300 msec we allowed for them to close. Instead, count the number of connections we have, and keep waiting until they are all closed.
Nick Mathewson 42f6b624 2010-08-04T15:51:14 Add option to test-ratelim to test min_share
Nick Mathewson 42a8c711 2010-07-31T17:10:04 Build more cleanly with NetBSDs that dislike toupper(char) To be fair, when char can be signed, if toupper doesn't take negative characters, toupper(char) is a very bad idea. So let's just use the nice safe EVUTIL_TOUPPER instead. (It explicitly only upcases ASCII, but we only use it for identifiers that we know to be ASCII anyway).
Joachim Bauch 840a72fb 2010-07-29T20:32:40 Fix badly-behaved subtest of dns/bufferevent_connect_hostname The bufferevent_connect_hostname test was specifying AF_INET, but the gethostbyname test we were using to see what error to expect was using PF_UNSPEC, leading to possible divergence of results.
Nick Mathewson 7c926916 2010-07-19T15:14:10 Make test/test.sh call test-changelist Eventually test-changelist should expand to try more cases, maybe query the status of the actual changelist somehow, and integrate it with the rest of the unit tests. Also, add test-changelist to gitignore.
Nick Mathewson cb927a51 2010-07-19T15:03:43 Fix whitespace.
Nick Mathewson b00d4c04 2010-07-19T14:58:08 Remove unused variables in test/test-changelist.c
Mike Smellie cf249e7d 2010-07-19T13:44:56 Possible fix to 100% cpu usage with epoll and openssl I'm running a fairly simple bit of test code using libevent2 with epoll and openssl bufferevents and I've run into a 100% cpu usage problem. Looking into it 100% usage was caused by epoll_wait constantly returning write events on the openssl socket when it shouldn't really have been looking for write events at all (N_ACTIVE_CALLBACKS() was returning 0 also). Looking a bit deeper eventbuffer_openssl socket seems to be requesting that the EV_WRITE event be removed when it should, but the event isn't actually being removed from epoll. Continuing to follow this I think I've found a bug in event_changelist_del. For evpoll event_del calls event_changelist_del which caches the change which is then actioned later when evpoll_dispatch is called. In event_changlist_del there is a check so that if the currently changed action is an add then the cached action is changed to a no-op rather than a delete (which makes sense). The problem arises if there are more than two add or delete operations between calls to dispatch, in this case it's possible that the delete is turned into a no-op when it shouldn't have been. For example starting with the event on, a delete followed by an add and then another delete results in a no-op when it should have been a delete (I added a fair bit of debug output that seems to confirm this behaviour). I've applied a small change that checks the original old_event stored with the change and only converts the delete to a no-op if the event isn't on in old_event. This seems to have fixed my problem.
Nick Mathewson 7510aac3 2010-06-21T12:23:32 Unit test for event_get_struct_event_size()
Nick Mathewson 17a8e2d7 2010-06-07T12:06:43 Add a function to retrieve the other side of a bufferevent pair
Nick Mathewson 44d57eee 2010-06-03T11:25:54 Add test for behavior on remote socket close On all the backends on this little mac laptop, that behavior is to report a remote socket close as both EV_READ and EV_WRITE. Historically, we had problem for some of these behaviors on some backends, so let's make sure that such behaviors don't come back.
Nick Mathewson 3689bd2d 2010-05-26T13:32:32 Have the unit tests report errors from test.sh The default behavior of test.sh was to suppress all output from test/regress, and say nothing but OKAY or FAILED. This wasn't so good for getting bugs reported, since lots of people didn't know to set TEST_OUTPUT_FILE, or re-run ./test/regress on its own. Now, when you don't specify an output file for test.sh, it runs regress with the --quiet option. This option makes the unit tests only print output on failure, which is what we probably wanted.
Nick Mathewson faf2a04f 2010-05-26T13:31:41 Make test.sh exit with nonzero status if tests fail This behavior makes "make verify" actually fail when the tests fail, which is what it's supposed to do.
Nick Mathewson 8bc1e3d6 2010-05-26T13:19:08 Remove all non-error prints from test/regress.c Now, running ./test/regress --quiet will indeed only inform you about errors. Previously, it would also spew extra output.
Nick Mathewson e73f1d79 2010-05-26T13:18:30 Remove the now-obsolete setup_test() and cleanup_test() functions
Nick Mathewson bda21e7f 2010-05-17T11:58:07 Avoid close of uninitialized socket in evbuffer unit test Attempts to fix a crash bug found by Brodie Thiesfield.
Nick Mathewson 75701e89 2010-05-14T14:30:09 Add some missing includes to fix Linux build again
Nick Mathewson b5bfc44d 2010-05-13T15:38:39 Make test-ratelim clean up after itself better.
Nick Mathewson 2b44dcca 2010-05-13T12:01:30 Add options to test-ratelim.c to check its results The new options let you specify a maximum deviation of bandwidth used from expected bandwidth used, and make test-ratelim.c exit with a nonzero status when those deviations are violated. This patch also adds a test-ratelim.sh script to run test-ratelim with a few sensible options for testing.
Nick Mathewson 33bbbed9 2010-05-13T10:57:30 Mark the event_err() functions as __attribute__((noreturn)) This attribute tells gcc (and anything else that understands gcc attributes) that the functions will never return control, and helps the optimizer a little. With luck, it will also tell less-than-full-program dataflow analysis tools that they don't need to worry about any code path that involves calling one of these functions and then returning. This patch also forces event_exit() to always exit, no matter what the user-supplied fatal_callback does. This means that the old unit tests for the event_err* functions don't work any more, since they assume it is safe to call event_err* if you've given it a bogus fatal_callback that doesn't exit. Instead, we have to make the unit tests fork before calling event_err(), and have the main unit test process wait for the event_err() test to exit with a sane exit code. On unix, that's trivial. On windows, let's not bother and just assume that event_err* works.
Nick Mathewson dfb75ab2 2010-05-12T15:38:28 Test the unlocked-deferred callback case of bufferevents
Nick Mathewson 3d9e05b1 2010-05-08T19:56:25 Fix test.sh on freebsd It turns out that in all conformant shells, "unset FOO" removes FOO both from the shell's variables and from the exported environment. (I've tested this on msys, opensolaris, linux, osx, and freebsd.) And in nearly every shell I can find, "unset FOO; export FOO" does the same as unset FOO... except in my FreeBSD VM, where the "export FOO" sets the exported value of FOO equal to "". This broke test.sh for us. The fix is simple: remove the needless exports!
Nick Mathewson 0ee6f6ce 2010-05-08T18:00:26 Make test.sh support mingw/msys on win32 This required: - Adding another WIN32 section in test.sh - not running "touch /dev/null" - calling WSAStartup in all the test binaries - Fixing a dumb windows-only bug in test-time.c
Nick Mathewson f89168e7 2010-05-08T19:11:50 Make test for bufferevent_connect_hostname system-neutral Previously, the be5_outcome field for the dns error would be set to something dependent on our system resolver. It turns out that you can't rely on nameservers to really give you an NEXIST answer for xyz.example.com nowadays: too many of them are annoyingly broken and like to redirect you to their locked-in portals. This patch changes the bufferevent_connect_hostname test so that it makes sure that the dns_error of be5_outcome is "whatever you would get from resolving the target hostname"
Nick Mathewson 88a543fc 2010-05-08T19:09:09 Make unit test for add_file able to tell "error" from "done" Importantly, we don't actually want to call evbuffer_write() when the buffer is empty. This makes it an error to ever get a -1 return value from evbuffer_add_file(), which makes it safe for us to test the return value.
Nick Mathewson 384d1245 2010-05-08T17:15:52 Fix bench_http build on win32.
Nick Mathewson 05de45d6 2010-05-08T16:47:07 add more (currently skipped) add_file tests on win32
Nick Mathewson dcdae6b7 2010-05-08T16:34:18 Make evbuffer_add_file() work on windows Right now only the add_file() mode is supported, when it would be nicer to have mmap support. Perhaps for Libevent 2.1.x.
Nick Mathewson b4f12a17 2010-05-08T14:49:59 Implement regress_make_tempfile on win32 to test evbuffer_add_file (Conclusion: evbuffer_add_file is broken on win32, since it uses recv on a file.)
Nick Mathewson f37cd4c2 2010-04-21T12:25:29 Detect broken unsetenv at unit-test runtime If we have an unsetenv function that doesn't work, we can't run the main/base_environ unit test, so we should skip it.
Nick Mathewson a62c8433 2010-05-06T14:16:50 Merge commit 'chrisd/connect-hostname-report-err'
Nick Mathewson c16e6844 2010-05-04T13:27:36 Rename current_base symbol to event_global_current_base_ The "current_base" symbol was never actually declared in an exported header; it's hideously deprecated, and it was the one remaining exported symbol (fwict) that was prefixed with neither ev nor bufferevent nor _ev nor _bufferevent. codesearch.google.com turns up no actual attempts to use our current_base from outside libevent.
Nick Mathewson cb670740 2010-04-28T11:51:56 Make debug mode catch mixed ET and non-ET events on an fd Of the backends that support edge-triggered IO, most (all?) do not support attempts to mix edge-triggered and level-triggered IO on the same FD. With debugging mode enabled, we now detect and refuse attempts to add a level-triggered IO event to an fd that already has an edge-triggered IO event, and vice versa.
Christopher Davis 0ef40706 2010-04-24T00:06:38 Report DNS error when lookup fails during bufferevent_socket_connect_hostname.
Nick Mathewson 96730d31 2010-04-23T23:13:26 Make http_base_test stop leaking an event_base.
Nick Mathewson b1c79500 2010-04-23T14:42:25 Make evdns logging threadsafe The old logging code was littered with places where we stored messages in static char[] fields. This is fine in a single-threaded program, but if you ever tried to log evdns messages from two threads at once, you'd hit a race. This patch also refactors evdns's debug_ntop function into a more useful evutil_sockaddr_port_format() function, with unit tests.
Christopher Davis 39b870b8 2010-04-22T21:49:05 Add dns/search_cancel unit test.
Sebastian Sjöberg 899c1dcc 2010-04-14T15:42:57 Replace EVUTIL_CLOSESOCKET macro with a function The EVUTIL_CLOSESOCKET() macro required you to include unistd.h in your source for POSIX. We might as well turn it into a function: an extra function call is going to be cheap in comparison with the system call. We retain the EVUTIL_CLOSESOCKET() macro as an alias for the new evutil_closesocket() function. (commit message from email by Nick and Sebastian)
Giuseppe Scrivano 10c4c904 2010-04-12T12:50:17 Do not inhibit automake dependencies generation It fixes make parallel builds.
Nick Mathewson 1234b95a 2010-04-09T17:19:39 Test another case of evbuffer_prepend
Nick Mathewson 8c83e995 2010-04-09T16:40:53 Add more unit tests for evbuffer_expand
Nick Mathewson 06a4443a 2010-04-09T15:28:26 Unit-test every evbuffer_add_file() implementation. Previously, we'd only test the default one, even if the others were still compiled in.
Nick Mathewson d5ebcf37 2010-03-30T16:47:37 Rewrite evbuffer_expand and its users The previous evbuffer_expand was not only incorrect; it was inefficient too. On all questions of time vs memory tradeoffs, it chose to burn time in order to avoid wasting memory. The new code tries to be a little more balanced: it only resizes an existing chain when doing so doesn't require too much copying, and when failing to do so would waste a lot of the chain's space. This patch also rewrites evbuffer_chain_insert to work properly with last_with_datap, and adds a few convenience functions to buffer.c.
Nick Mathewson b7442f8e 2010-03-26T23:18:40 Replace last_with_data with a slightly smarter version To implement evbuffer_expand() properly, you need to be able to replace the last chunk that has data, which means that we need to keep track of the the next pointer pointing to the last_with_data chunk, not the last_with_data chunk itself.
Nick Mathewson 7960af51 2010-03-22T13:37:39 Merge branch 'build'
Nick Mathewson b557b175 2010-03-21T13:28:48 Detect and refuse reentrant event_base_loop() calls Calling event_base_loop on a base from inside a callback invoked by that same base, or from two threads at once, has long been a way to get exceedingly hard-to-diagnose errors. This patch adds code to detect such reentrant invocatinos, and exit quickly with a warning that should explain what went wrong.
Nick Mathewson 33874b05 2010-03-16T13:37:15 Make 'main/many_events' test 70 fds, not 64. This is mainly intended to ensure that we don't get hung up on the 64-handle limit that lots of O(n) Windows functions (but FWICT not select) like to enforce.
Nick Mathewson 274a7bd9 2010-03-13T00:55:39 Fix some memory leaks in the unit tests These don't matter except inasmuch as they give real memory leaks a place to hide. Found with valgrind
Nick Mathewson 68dc742b 2010-03-12T20:38:25 Fix a write of uninitialized RAM in regression tests Not actually harmful, but not something we should be doing. Found by valgrind.
Nick Mathewson 0d047c3f 2010-03-13T00:29:15 Fix an obnoxious typo in the bufferevent_timeout_filter test We were using the same bufferevent as the child of two filtering parents, orphaning another. This made one get freed twice, and the other not at all. Possible fix for bug 2963306 spotted by Doug Cuthbertson.
Nick Mathewson b660edf9 2010-03-12T13:22:47 Remove redundant stuff from EXTRA_DIST To a first approximation, sources that are mentioned anywhere in an automake file don't need to get mentioned in EXTRA_DIST.
Nick Mathewson 426c8fbe 2010-03-12T13:09:28 Support the standard 'make check' target in place of 'make verify' Based on patch 2816088 from Zack Weinberg
Nick Mathewson 17da042d 2010-03-11T15:39:44 Add some glass-box tests for the last_with_data code.
Nick Mathewson 6f47bd12 2010-03-10T23:28:51 Remove previous_to_last from evbuffer
Nick Mathewson c8ac57f1 2010-03-10T23:24:14 Use last_with_data in place of previous_to_last This actually makes some of the code a lot simpler. The only ones that actually used previous_to_last for anything were reserving and committing space.
Nick Mathewson 2a6d2a1e 2010-03-10T22:16:14 Revise evbuffer to add last_with_data This is the first patch in a series to replace previous_to_last with last_with_data. Currently, we can only use two partially empty chains at the end of an evbuffer, so if we have one with 511 bytes free, and another with 512 bytes free, and we try to do a 1024 byte read, we can't just stick another chain on the end: we need to reallocate the last one. That's stupid and inefficient. Instead, this patch adds a last_with_data pointer to eventually replace previous_to_last. Instead of pointing to the penultimated chain (if any) as previous_to_last does, last_with_data points to the last chain that has any data in it, if any. If all chains are empty, last_with_data points to the first chain. If there are no chains, last_with_data is NULL. The next step is to start using last_with_data everywhere that we currently use previous_to_last. When that's done, we can remove previous_to_last and the code that maintains it.
Nick Mathewson 2c2618d8 2010-03-05T13:00:15 more whitespace normalization
Nick Mathewson c7cf6f00 2010-03-05T12:47:46 Replace users of "int fd" with "evutil_socket_t fd" in portable code Remeber, win32 has a socket type that's actually a handle, so if there's a chance that code is run on win32, we can't use "int" as the socket type. This isn't a blind search-and-replace: sometimes an fd is really in fact for a file, and not a socket at all.
Nick Mathewson 17efc1cd 2010-03-04T01:25:51 Update all our copyright notices to say "2010"
Christopher Davis 1273d2f5 2010-03-02T15:16:28 VC has no getopt(), so do without in bench_http.