Commit Graph

84 Commits

Author SHA1 Message Date
Simon Giesecke
34999d5069 Problem: s_send(more) can be replaced by safer send_string_expect_success
Solution: remove s_send(more) and replace all uses
2019-03-24 13:34:13 -04:00
Simon Giesecke
1450830611 Problem: unused include directives
Solution: remove and add where needed
2019-03-23 09:46:37 -04:00
Simon Giesecke
d0c4402daf Problem: needless use of macros
Solution: convert streq/strneq into functions
2019-03-23 09:09:36 -04:00
Simon Giesecke
5d74eba64a Problem: remaining basic assertions
Solution: use unity assertions instead
2019-03-23 09:09:36 -04:00
Simon Giesecke
347708bcf2 Problem: test utilities are in headers and recompiled for every test
Solution: move test utilities to separate testutil library
2019-03-23 09:09:24 -04:00
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