1148 Commits

Author SHA1 Message Date
Azat Khuzhin
ad52602ffd test/regress_be: basic coverage bufferevent_flush() for pair/sock layers
Refs #266
2015-10-30 18:55:34 +03:00
Azat Khuzhin
f8081afc5e test/regress_be: socket_filter_inactive: check bufferevent after creation
Fixes:
../test/regress_bufferevent.c: In function ‘test_bufferevent_socket_filter_inactive’:
../test/regress_bufferevent.c:1180:1: warning: label ‘end’ defined but not used [-Wunused-label]
 end:
2015-10-30 18:38:09 +03:00
Azat Khuzhin
337684b8e8 test/regress_be: cover finalizers from inactive to active queue
Right now this will fail with the next assertion:
$ regress --no-fork --verbose bufferevent/bufferevent_socket_filter_inactive
bufferevent/bufferevent_socket_filter_inactive: [err] ../event.c:862: Assertion TAILQ_EMPTY(&base->activequeues[i]) failed in event_base_free_
Aborted
2015-10-30 14:45:20 +03:00
Azat Khuzhin
d8fd4c0742 test/regress_buffer: fix clang compilation warnings
../test/regress_buffer.c:201:12: warning: logical not is only applied to the left hand side of this comparison [-Wlogical-not-parentheses]
          tt_assert(!memcmp((char*)EVBUFFER_DATA(evb), "1/hello", 7) != 0);
2015-10-09 01:55:54 +03:00
Azat Khuzhin
cd422e0927 test/regress_http: fix compilation warnings (-Wmissing-field-initializers) 2015-10-09 01:50:05 +03:00
Azat Khuzhin
f55db9856e test/regress_dns: fix compilation warnings (-Wmissing-field-initializers/for)
I don't have an error for loop because gcc5 have --std=gnu11 by default.
We need some options-consistency for all versions/compilers and build systems
to avoid such patches.

Fixes: https://travis-ci.org/libevent/libevent/jobs/84403473
Fixes: https://travis-ci.org/libevent/libevent/builds/84403463
2015-10-09 01:47:44 +03:00
Azat Khuzhin
1e8bfbc6bc tests/regress_dns: cover that randomize-case works case-insensitive
Regression-for: #288
2015-10-09 01:12:12 +03:00
Thomas Bernard
9f02a44513 make test/regress_ssl.c compile without warnings 2015-10-05 12:37:41 +02:00
Azat Khuzhin
8240379a3c test/regress_be: drop debug __asm__(int3) to fix arm build
Closes #284
2015-10-04 03:19:12 +03:00
Azat Khuzhin
3f749e93db test: fix bufferevent/bufferevent_pair_release_lock in debug mode
After this test had been fixed for freebsd the debug build was broken because
we can't call evthread_set_lock_callbacks() when something already initialized,
and we can't call event_base_free() (in kqueue case) when it is initialized,
because of "held_by", but this only playing role during freeing lock profiler
so reset lock callbacks there before and this will fix both.

Fixes: 79f9ace4ae8a259a5cf1b4ff3869078b60ff16a1 ("test: fix
bufferevent/bufferevent_pair_release_lock for freebsd")

P.S. after this patch 'make verify' finishes without errors on freebsd.
2015-09-10 13:44:07 +03:00
Azat Khuzhin
79f9ace4ae test: fix bufferevent/bufferevent_pair_release_lock for freebsd
On FreeBSD with kqueue there is a call to evthread_debug_lock_mark_unlocked()
during event_base_free(), that will fail with an assert because of unmatched
"held_by", fix this by reseting lock callbacks to NULL before
event_base_free().

Trace:
  bufferevent/bufferevent_pair_release_lock: [warn] Trying to disable lock functions after they have been set up will probaby not work.
  [warn] Trying to disable lock functions after they have been set up will probaby not work.

    FAIL libevent/test/regress_bufferevent.c:259: lock: lock error[err] libevent/evthread.c:277: Assertion lock->held_by == me failed in evthread_debug_lock_mark_unlocked
  [New Thread 802006400 (LWP 100070/regress)]

  Program received signal SIGABRT, Aborted.
  [Switching to Thread 802006400 (LWP 100070/regress)]
  0x000000080167d6ca in thr_kill () from /lib/libc.so.7
  (gdb) bt
  #0  0x000000080167d6ca in thr_kill () from /lib/libc.so.7
  #1  0x0000000801752149 in abort () from /lib/libc.so.7
  #2  0x00000000004dff44 in event_exit (errcode=-559030611) at libevent/log.c:105
  #3  0x00000000004e053c in event_errx (eval=-559030611, fmt=0x5182cc "%s:%d: Assertion %s failed in %s") at libevent/log.c:162
  #4  0x00000000004d9954 in evthread_debug_lock_mark_unlocked (mode=0, lock=0x802017060) at libevent/evthread.c:277
  #5  0x00000000004d909a in debug_lock_unlock (mode=0, lock_=0x802017060) at libevent/evthread.c:290
  #6  0x00000000004e132c in evsig_dealloc_ (base=0x80201e300) at libevent/signal.c:434
  #7  0x00000000004e36c1 in kq_dealloc (base=0x80201e300) at libevent/kqueue.c:435
  #8  0x00000000004c9a44 in event_base_free_ (base=0x80201e300, run_finalizers=1) at libevent/event.c:855
  #9  0x00000000004c931a in event_base_free (base=0x0) at libevent/event.c:887
  #10 0x0000000000452657 in lock_unlock_free_thread_cbs () at libevent/test/regress_bufferevent.c:279
  #11 0x0000000000452621 in free_lock_unlock_profiler (data=0x8020170a0) at libevent/test/regress_bufferevent.c:317
  #12 0x000000000044bc8f in test_bufferevent_pair_release_lock (arg=0x8020170a0) at libevent/test/regress_bufferevent.c:334
  #13 0x00000000004b2288 in testcase_run_bare_ (testcase=0x737660) at libevent/test/tinytest.c:105
  #14 0x00000000004b1e72 in testcase_run_one (group=0x738c90, testcase=0x737660) at libevent/test/tinytest.c:252
  #15 0x00000000004b2930 in tinytest_main (c=3, v=0x7fffffffead0, groups=0x738c20) at libevent/test/tinytest.c:434
  #16 0x00000000004982fe in main (argc=3, argv=0x7fffffffead0) at libevent/test/regress_main.c:459
  (gdb) f 4
  #4  0x00000000004d9954 in evthread_debug_lock_mark_unlocked (mode=0, lock=0x802017060) at libevent/evthread.c:277
  277                     EVUTIL_ASSERT(lock->held_by == me);
  Current language:  auto; currently minimal
  (gdb) p lock
  $1 = (struct debug_lock *) 0x802017060
  (gdb) p lock->held_by
  $2 = 0
  (gdb) p me
  $3 = 34393318400
2015-09-10 12:39:20 +03:00
Azat Khuzhin
a0f308da99 test/regress_be: bufferevent_enable() shouldn't call eventcb by it's own
It must enter the event loop regardless BEV_OPT_DEFER_CALLBACKS, to avoid
potential errors with subsequent connect(), you will find more info in #43,
since this is a regression for it.
2015-09-10 11:19:08 +03:00
Azat Khuzhin
37dc9e0eca test/regress_be: introduce fake_listener_create() 2015-09-10 11:18:34 +03:00
Azat Khuzhin
6f6fa0d28a test/regress_http: cover evhttp_request_own() 2015-09-09 19:15:18 +03:00
Azat Khuzhin
3d15aeb4fd test/regress_http: cover write during read
This is the regression for evhttp_write_buffer() where we reset readcb to avoid
illegal state:
http/write_during_read: [err] evhttp_read_cb: illegal connection state 7

If you will comment that this test will fail.
2015-09-09 18:06:37 +03:00
Azat Khuzhin
4be6c70bb0 test/regress_http: verify that closecb will be called without multiple write
And now this works incorrect, i.e. http layer will not detect EOF until another
write.

Reported-in: #78
2015-09-08 16:43:05 +03:00
Azat Khuzhin
cf2cf2a01a test: run regress with EVENT_DEBUG_MODE=1 and without
This could show some bugs like "event_assign called on an already added event",
and some others that debugging mode could track.
2015-09-02 19:38:30 +03:00
Azat Khuzhin
6ea66554df test/regress: fix bufferevent_pair_release_lock with EVENT_DEBUG_MODE
Before this patch you will see next error:
$ EVENT_DEBUG_MODE= regress --no-fork bufferevent/bufferevent_pair_release_lock
bufferevent/bufferevent_pair_release_lock: [err] evthread initialization must be called BEFORE anything else!
2015-09-02 19:37:00 +03:00
Azat Khuzhin
cdafdf017e test/regress_ssl: check events fd/pending after timeout triggered
In this case client can't connect to server, and this bring to the front some
bugs with assigning on already added events (because of ```fd_is_set``` stuff),
for more info see #258, since this is the reproducible for it.
2015-09-02 19:15:27 +03:00
Azat Khuzhin
74845f1198 test/regress_ssl: cover case when server didn't up (failed with timeout) 2015-09-02 19:08:36 +03:00
Azat Khuzhin
df507afafd test/regress_ssl: covert that we can't change fd with underlying 2015-09-02 19:07:08 +03:00
Azat Khuzhin
762edb46a8 test/regress_ssl: cover that events (read/write) at finish not pending 2015-09-02 19:06:45 +03:00
Azat Khuzhin
b78a829752 test/regress_ssl: cover fd manipulations 2015-09-02 19:04:52 +03:00
Azat Khuzhin
46bba73103 test/regress_ssl: convert open_ssl_bufevs() to mask 2015-09-02 19:04:45 +03:00
Azat Khuzhin
34559913c0 test/regress_ssl: convert client/server to mask too 2015-09-02 19:04:39 +03:00
Azat Khuzhin
0430327364 test/regress_ssl: cover "allow_dirty_shutdown" 2015-09-02 19:04:11 +03:00
Azat Khuzhin
342e116ff6 test/regress_ssl: convert regress_bufferevent_openssl() to bitmask 2015-09-02 19:04:11 +03:00
Azat Khuzhin
25e56fdbc1 tests/regress_ssl: drop duplicated assert 2015-09-01 20:40:03 +03:00
Ed Schouten
fd36647af1 Don't use BSD u_* types.
These types are not part of POSIX. As we only use them in a small number
of places, we'd better replace them by C standard types. This makes a
larger part of the code build for CloudABI.
2015-08-25 19:15:50 +03:00
Azat Khuzhin
9f0bff3f68 test/regress_http: initialize "dns_base" to avoid reading trash
Even though it is very unlikely, but it will better to fix this.
2015-08-18 21:32:03 +03:00
Azat Khuzhin
a50f5f0ac0 http: reuse connected address only with EVHTTP_CON_REUSE_CONNECTED_ADDR 2015-08-18 20:06:53 +03:00
Azat Khuzhin
f4874d8c1f test/http: cover retrying with saved conn_address by shutting down dns server 2015-08-18 20:06:52 +03:00
Seungmo Koo
cb96931236 Update bench_httpclient.c
*fixed: socket_geterror instead of WSAGetLastError
2015-06-07 15:51:15 +09:00
zeliard
4e9325e8dc *fix: bench_httpclient to support win32 2015-06-05 16:39:26 +09:00
Mark Ellzey
e84e269b47 Commented out a WIN32 threading / timing test for now
- seems as if windows has some time scale issues which I am looking
  into. For now I am commenting out the regression test until it is
  fixed.
2015-05-11 22:53:05 -04:00
Thomas Bernard
0c7f21781a Fix mixed declarations and code (forbidden by ISO C90) 2015-02-16 23:42:54 +01:00
Thomas Bernard
746d2c502c Fix "function declaration isn’t a prototype"
add "void" to argument list
2015-02-16 23:41:53 +01:00
Nick Mathewson
a77a82a03f Merge remote-tracking branch 'azat/be-pair-fix-freeing-shared-lock-v5' 2015-02-04 08:37:32 -05:00
Nick Mathewson
51821e20b2 Merge pull request #207 from azat/avoid-leaking-of-event_debug_map_HT_GROW
Avoid leaking of event_debug_map_HT_GROW
2015-02-04 08:33:42 -05:00
Nick Mathewson
537177d315 New function to get address for nameserver. 2015-02-02 13:57:22 -05:00
Azat Khuzhin
a558fcdb43 be_pair/regress: cover use of shared lock (lock/unlock/free)
For more info look at 92a359ee3adf4636db508e6c6d7179d4d59eaafc
("be_pair: release shared lock with the latest of bufferevent_pair")
2015-01-26 00:40:09 +03:00
Azat Khuzhin
3540a193b5 regress_dns: drop hack for event_debug_map_HT_GROW in leak tests 2015-01-08 04:51:27 +03:00
John Ohl
f5b476570d Fix warnings when compiling with clang 3.5 2014-12-22 00:46:56 -05:00
Nick Mathewson
cb737041e2 Fix annoying heisenbug in test-time.c 2014-12-15 12:51:01 -05:00
Nick Mathewson
7fd4941465 Merge remote-tracking branch 'origin/pr/182' 2014-11-30 19:26:20 -05:00
Nick Mathewson
154006ad36 More evbuffer_peek() test cases 2014-11-30 11:09:28 -05:00
Azat Khuzhin
e2d139dd7e test/evbuffer_peek: add regress in case we have first buffer greater 2014-11-30 11:06:08 -05:00
John Ohl
b0e99244ce Add test for evhttp_connection_free_on_completion 2014-10-29 03:40:44 -04:00
Azat Khuzhin
3ca9d43d32 evdns: add retry/reissue tests for EVDNS_BASE_DISABLE_WHEN_INACTIVE 2014-09-30 01:39:51 +04:00
Nick Mathewson
89c1a3b7fe Fix several memory leaks in the unit tests.
Also add a comment to buffer.c about why we call
evbuffer_file_segment_free on failure to add the segment.
2014-09-18 12:40:38 -04:00