Commit Graph

79 Commits

Author SHA1 Message Date
Simon Giesecke
99e53698c5
Merge pull request #3456 from bluca/test_fd_port
Problem: TCP and UDP test sockets use hard-coded port
2019-03-19 17:57:09 +01:00
Luca Boccassi
98875a9ddc Problem: TCP and UDP test sockets use hard-coded port
Solution: move ephemeral port code to header and use it in both
tests
2019-03-18 23:27:01 +00:00
Andreas Hasenack
d81f3ec21c Problem: test_filter_with_supplemental_process_owner_gid fails
Solution: only set supgroup to a valid gid
2019-03-18 13:21:44 -03:00
Simon Giesecke
61e476ec89 Problem: MAX_SOCKET_STRING is too short for ipc wildcard binds
Solution: increase size to 256
2019-02-06 09:09:14 -05:00
Simon Giesecke
779d120fa3 Problem: tests do not follow naming style
Solution: apply naming style
2018-05-27 13:24:08 +02:00
Simon Giesecke
dd1c87f9d9 Problem: type mismatch errors/warnings in Windows build
Solution: fix types
2018-05-15 14:53:40 +02:00
Simon Giesecke
3ee65906af Problem: various warnings regarding SOCKET vs. int in test_security_curve
Solution: Use fd_t
2018-05-14 21:09:56 +02:00
Lionel Flandrin
4cd2c2ebf8 Problem: address parsing code is tied to the TCP code
Solution: Factor the code into a different file with a well defined API and add
unit tests.
2018-05-02 18:06:01 +02:00
Luca Boccassi
19060345e4 Problem: TIPC availability check is too strict (#2977)
* Problem: TIPC availability check is too strict

Solution: at build time only check if the API is available. In the tests
do a first check and a skip if the functionality is not available.

TIPC needs an in-tree but not loaded by default kernel module, tipc.ko
to be loaded, which requires root, so it is unlikely to be available on
any build system by default.
This will allow most distributions to ship with TIPC support built in,
and to avoid tests failure if the module is not there.

* Problem: no Travis tests for TIPC

Solution: mark one job with sudo: required and load the kernel module

* Problem: CMake fails when test returns 77 (skip)

Solution: set property to let it mark the test as skipped as intended
2018-03-09 17:47:42 +01:00
Stefan Kaes
fcbd2a5710 Problem: enormous memory increase due to zero copy decoding
The zero copy decoding strategy implemented for 4.2.0 can lead to a large
increase of main memory usage in some cases (I have seen one program go up to
40G from 10G after upgrading from 4.1.4). This commit adds a new option to
contexts, called ZMQ_ZERO_COPY_RECV, which allows one to switch to the old
decoding strategy.
2018-03-05 18:13:28 +01:00
sigiesec
41f459e1dc Problem: formatting inconsistent
Solution: applied clang-format
2018-02-02 15:47:43 +01:00
sigiesec
8ae91fdf9a Problem: no test cases for zmq_poller_add*, zmq_poller_modify*, zmq_poller_remove* corner cases
Solution: added test cases
2017-08-22 20:22:39 +02:00
Luca Boccassi
90b6c102bb Problem: various unused variables warnings
Solution: use LIBZMQ_UNUSED where necessary
2017-08-19 12:18:51 +01:00
Luca Boccassi
5934919f3e Problem: tests bind to hardcoded TCP ports
Solution: use ZMQ_LAST_ENDPOINT in most places. This alllows running
tests in paralle, and on over-booked shared machines where many of
the ports would be already in use.
Keep 3 tests with an hardcoded port, as there are some code paths that
require it (eg: connect before bind), but list those ports in
tests/testutil.hpp as macros so that they do not overlap and still
allow parallel runs.

These changes were inspired by a patch uploaded to Ubuntu by the
package maintainer, Steve Langasek <steve.langasek@ubuntu.com>.
Thank you Steve!
2017-05-01 22:57:05 +01:00
Luca Boccassi
dcec022358 Problem: test_stream_exceeds_buffer does not build on AIX
Solution: add missing includes
2016-12-06 20:34:10 +00:00
Luca Boccassi
a9343dbbc3 Problem: testutil.hpp fails to build on Windows XP
Solution: ifdef is_ipv6_available to always return false if building
on Windows XP, as it doesn't support the needed standard libc
functions
2016-08-27 16:48:38 +01:00
Luca Boccassi
f486176741 Revert "is_ipv6_available: Create a fake zmq context on windows"
This reverts commit 9adf20aaeb.
2016-08-23 21:46:43 +01:00
Thomas Braun
9adf20aaeb is_ipv6_available: Create a fake zmq context on windows
This is required as zmq_ctx_new calls WSAStartup. Without that the IPV6
socket creation always fails.
2016-08-23 21:52:16 +02:00
Giuseppe Corbelli
7fdb167732 [tests/testutil.hpp] Problem: wrong windows.hpp path
Solution: correct path is ../src/windows.hpp. Also added automatic linking
of iphlpapi library if required and using MSVC
2016-07-12 15:58:17 +02:00
Luca Boccassi
c293618ae8 Problem: testutil.hpp includes platform.hpp last
Solution: before including internal headers, include platform.hpp
so that the build time options are correctly applied to the included
headers.
2016-05-02 20:00:53 +01:00
Luca Boccassi
ac0e97e5dc Problem: can't test if IPv6 is available in tests
Solution: add helper function is_ipv6_available to testutil.hpp to
test if IPv6 is available on the building platform.
This function will try to open and bind a socket to ::1:*, as it's
the ultimate way of knowing if, at least on the loopback, IPv6 is
enabled.
2016-04-18 18:43:36 +01:00
Luca Boccassi
facb512105 Problem: SETTLE_TIME is too short on slow systems
Solution: increase SETTLE_TIME from 50ms to 300ms to avoid failing on
slower environments like through Valgrind on slow VMs.
2016-02-13 18:17:36 +00:00
Luca Boccassi
706c3b7c4b Problem: test_shutdown_stress_tipc broken on OSX/Cmake
Solution: include pthread.h in testutil.hpp, removed from
test_shutdown_stress_tipc in an earlier commit
2016-02-13 18:01:03 +00:00
Pieter Hintjens
8230c0d396 Problem: gyp does not build tests
Solution: it's a lot of work to define the tests in project.gyp
so I did this using gsl to generate the JSON, from a small XML
list of the test cases.

To keep this, and the hundreds of .mk files, away from the root
directory, I've moved the gyp files into builds/gyp, where you
would run them.

It all seems to work now. Next up, OS/X and Windows :)
2016-02-12 11:31:38 +01:00
Constantin Rack
a539b0c6e8 Problem: copyright year is still 2015
Solution: update to 2016
2016-01-28 15:07:31 +01:00
Richard Newton
3f4f3c1137 Fix windows cmake build 2015-09-14 13:21:20 +01:00
Pieter Hintjens
d416ffcec5 Problem: cannot build single test case in tests
This is due to the mangled include of platform.h, which was to make
CMake happy.

Solution: in CMakeLists.txt, define USING_CMAKE and then look for
platform.h in current directory if that is defined, else look in
../src/ as one would expect.
2015-09-11 16:42:26 -04:00
Pieter Hintjens
fd9bd1b2a5 Problem: broke Cmake build 2015-08-11 19:35:48 +02:00
Pieter Hintjens
92c4decb69 Problem: lack test case for large stream messages
Solution: added to test_stream.cpp
2015-08-11 19:34:25 +02:00
Brian Silverman
cb0491ca18 Add a way to disable libzmq's internal test timeout.
It's nice to be able to disable libzmq's internal timeout when there's
another timeout in the test runner being used which gives nicer error
messages.
2015-07-28 13:47:19 -07:00
Pieter Hintjens
8620c3e032 Problem: source file headers are somewhat confusing about LGPLv3
Of course people still "can" distributed the sources under the
LGPLv3. However we provide COPYING.LESSER with additional grants.

Solution: specify these grants in the header of each source file.
2015-06-02 22:33:55 +02:00
Pieter Hintjens
a7a512ab3d Problem: test cases are failing on slower PCs (eee PC)
Solution: raise timeouts from 100-150 msec to 250 msec
2015-01-30 11:57:31 +01:00
Richard Newton
415b49ba0d Fix Windows build 2015-01-26 09:12:07 +00:00
Pieter Hintjens
6ced7027a0 Problem: commit afb24b53 broke ZMQ_STREAM contract
Symptom is that ZMQ_STREAM sockets in 4.1.0 and 4.1.1 generate zero
sized messages on each new connection, unlike 4.0.x which did not do
this.

Person who made this commit also changed test cases so that contract
breakage did not show. Same person was later banned for persistently
poor form in CZMQ contributions.

Solution: enable connect notifications on ZMQ_STREAM sockets using a
new ZMQ_STREAM_NOTIFY setting. By default, socket does not deliver
notifications, and behaves as in 4.0.x.

Fixes #1316
2015-01-23 15:25:40 +01:00
Pieter Hintjens
94d9a4ffdf Problem: copyright statements are out of date
Solution: update for 2015

Fixes #1320
2015-01-22 10:32:37 +01:00
DaiyuHurst
5d084cdfdd Implement a definitive cygwin target for libzmq. 2014-12-29 17:39:19 -05:00
Pieter Hintjens
eacd4d9cba Problem: test cases were sporadically failing
Solution: increase settle time for bind/unbind tests
2014-12-23 15:21:22 +01:00
Ewen McNeill
fc80e8cda1 z/OS: signal(SIGPIPE, SIG_IGN) for tests
Updated:
   tests/testutil.hpp: Add signal(SIGPIPE, SIG_IGN) to
        setup_test_environment(), on z/OS (__MVS__)
2014-07-23 13:39:45 +12:00
Pieter Hintjens
a087ce55ea Problem: two header files for a single library
Users who need e.g. zmq_curve_keypair() have to remember to include
zmq_utils.h, which is counter-intuitive. The whole library should be
represented by a single include file.

Solution: merge all contents of zmq_utils.h into zmq.h, and deprecate
zmq_utils.h. Existing apps can continue unchanged. New apps can ignore
zmq_utils.h completely.
2014-06-27 15:58:18 +02:00
Pieter Hintjens
11175a33f1 Problem: security tests block on zmq_send
The expect_bounce_fail () helper assumed that messages could always
be sent. However in some cases zmq_send() blocks, due to there not
being any outgoing pipe. This changed in 77f5f7, where previously
there would be a pipe that kept trying to reconnect forever.

Solution: use a send timeout and check for EAGAIN if sending failed.
2014-05-20 15:42:35 +02:00
Pieter Hintjens
155feccb3f Merge pull request #1047 from mrvn/pull-testutil-expect_bounce_fail-send-timeout
Add a send timeout in expect_bounce_fail()
2014-05-19 17:52:27 +02:00
Goswin von Brederlow
2ba5af6d83 Set an alarm(60) in setup_test_environment() when not on windows so tests
will not block too long if they go wrong.
2014-05-19 17:03:41 +02:00
Goswin von Brederlow
0ebf94e429 Add a send timeout in expect_bounce_fail() so tests for authentication
failures don't block.
2014-05-19 17:03:24 +02:00
Pieter Hintjens
d190325e4d Revert "Enlarge the race window for some test cases"
This reverts commit 2a84d25974.

Broke regression test on test_hwm.cpp.
2014-05-02 16:49:03 +02:00
Pieter Hintjens
0bc669b106 Merge pull request #1000 from daveab/feature/divide_by_zero_investigation
Feature/divide by zero investigation
2014-05-02 16:31:48 +02:00
dave b
2a84d25974 Enlarge the race window for some test cases
These changes cause an assertion in lb_sendpipe() when executing the test_security_plain testcase.
2014-05-02 14:32:14 +01:00
Pieter Hintjens
9753de8566 Problem: zmq_socket_monitor code is dirty
Specifically:

* zmq_event_t should not be used internally in libzmq, it was
  meant to be an outward facing structure.

* In 4.x, zmq_event_t does not correspond to monitor events, so
  I removed the structure entirely.

* man page for zmq_socket_monitor is incomplete and the example
  code was particularly nasty.

* test_monitor.cpp needed rewriting, it was not clean.
2014-04-28 11:30:49 +02:00
Ivan Pechorin
1d7a07d919 Fix compilation of tests on MSVC 2008 2014-01-20 20:55:32 +13:00
Pieter Hintjens
b3b9e046ee Updated copyright statements for 2014 2014-01-02 12:00:57 +01:00
Pieter Hintjens
5b60540ed0 Removed over-long pauses in tests
- used msleep (10) in most places instead of zmq_sleep (1)
- may cause failures on slower machines
- to change, modify SETTLE_TIME in testutil.h
- tested down to 1 msec on fast boxes
2013-11-06 13:42:57 +01:00