Commit Graph

173 Commits

Author SHA1 Message Date
Simon Giesecke
ae558706bf Problem: test_hwm and test_router_mandatory not yet using unity
Solution: migrate to unity
2018-03-14 08:22:23 +01:00
Pontus.Skoeldstroem
7abb8388d6 Problem: Tests for different TIPC address types missing (#2956)
* Tests for different TIPC address types and code cleanup

* Adds tests for binding/connecting with different TIPC address types
  using Unity
* Adds error checking for address type misuse
2018-03-07 17:31:26 +00:00
Luca Boccassi
354491ddf2 Problem: no test for ZMQ_XPUB_VERBOSE(R)
Solution: add test_xpub_verbose to cover those APIs
2018-03-02 13:42:44 +01:00
Simon Giesecke
96fb17cb55 Problem: unittests not recognized by code coverage measurement
Solution: add CODE_COVERAGE_*FLAGS to unit tests build

Fixes #2949
2018-03-02 13:40:45 +01:00
Simon Giesecke
a9712c0bf2 Problem: no unittests for mtrie
Solution: made mtrie generic (to remove complex dependency on pipe_t),
and added some unit tests
2018-03-02 13:32:51 +01:00
Simon Giesecke
922053237f Problem: test_sockopt_hwm not using unity
Solution: migrate test_sockopt_hwm to unity
2018-02-13 18:38:23 +01:00
Luca Boccassi
1478fd0022 Problem: unittests not built with autotools
Solution: add them to Makefile.am, linking to the static libzmq.a
library and its dependencies
2018-02-11 17:33:13 +00:00
Luca Boccassi
f6f67cbf96 Problem: no autotools support for building with unity
Solution: add a noinst convenience static library and use it with the
tests that require it
2018-02-11 17:25:36 +00:00
Luca Boccassi
d832267e23 Problem: make format-check not implemented with autotools
Solution: port implementation from zproject
2018-02-10 17:35:12 +00:00
Min RK
35c4b68a09 fix inclusion of cmake modules in dist 2018-01-13 13:15:51 -08:00
Min RK
f8da0ac721 move cmake ZeroMQConfig.cmake.in to builds/cmake 2018-01-13 13:14:53 -08:00
gouarin
084568bdf9 add ZeroMQConfig.cmake.in in EXTRA_DIST 2017-12-13 20:15:38 +01:00
Luca Boccassi
78cdff3a3e Problem: autoconf does not use pkgconfig for NORM
Solution: use the pkgconfig macro as the first step and then fallback
to manual checks
2017-10-16 23:23:32 +01:00
Ilya Kulakov
656cdb959a Problem: Race condition in IPC sockets
Solution: Don't unlink file on close

File may not belong to the socket at that point.
2017-10-05 14:57:10 -07:00
Luca Boccassi
edb4ca1023 Problem: zmq_connect fails after disconnect due to RECONNECT_IVL == -1
Solution: when a connection breaks and ZMQ_RECONNECT_IVL is set to -1,
which means a reconnection will not be attempted, send a message from
the I/O thread to the application thread to make the socket call
term_endpoint, which is the equivalent of manually calling
zmq_disconnect.
This way subsequent zmq_connect call to the same endpoint will attempt
again to do a connection.
Otherwise, for some socket types like SUBs, those new connects will
fail as the endpoint is recorded, despite the connection having been
permanently closed.

Add test cases to exercise this corner case with TCP and IPC.
2017-09-19 14:05:43 +01:00
sigiesec
9a336622fb Problem: no tests for socket-related functions passing NULL as socket
Soluton: added tests
2017-08-22 16:22:38 +02:00
Luca Boccassi
b7346f8e00 Problem: gssapi search in autoconf does not use pkgconfig
Solution: use it before falling back to headers checks
2017-08-18 16:24:53 +01:00
sigiesec
301f3c70c2 Problem: code duplication between curve_client_t and curve_server_t decode and encode
Solution: extracted common base class curve_mechanism_base_t
2017-08-18 11:34:22 +02:00
Luca Boccassi
d52197d84f Merge pull request #2689 from sigiesec/remove-zap-client-duplication
Problem: ZAP client code duplicated across mechanisms with behaviour deviations
2017-08-17 13:24:36 +01:00
sigiesec
7f15e6c868 Problem: make-based builds broken
Solution: add testutil_security.hpp to Makefile.am
2017-08-17 12:34:49 +02:00
sigiesec
406af1ef67 Problem: ZAP tests are now generic but placed in test_security_curve.cpp
Solution: Move ZAP tests to own file test_security_zap.cpp, move common code to testutil_security.hpp
2017-08-17 11:45:18 +02:00
sigiesec
6e8a0b31be Problem: ZAP client code is duplicated in all mechanisms
Solution: created a zap_client_t class, extracted first function send_zap_request from curve_server_t
2017-08-16 18:04:30 +02:00
Luca Boccassi
97e532e7db Problem: missing flags break build of test_security_curve
Solution: add all the required compiler flags since the test includes
source code from the library directly
2017-08-16 15:19:09 +01:00
Simon Giesecke
d5e4319edc [WIP, do not merge] Problem: insufficient tests for ZMTP-CURVE protocol errors (#2680)
* Extracted connect_vanilla_socket function

* Problem: no tests for ZMTP-CURVE protocol errors

Solution: added two test cases with erroneous HELLO commands

* Problem: insufficient tests for ZMTP-CURVE protocol errors

Solution: added two test cases with erroneous HELLO command version

* Problem: test HELLO message is invalid apart from deliberate errors

Solution: create cryptographically correct HELLO message
add tweetnacl.c to test_security_curve

* Problem: nonce is incorrect, build fails with GCC

Solution: use correct non prefix

* Problem: make builds are failing

Solution: transfer CMake changes to (auto)make files

* Problem: nonce is incorrect, build fails with GCC

Solution: use correct non prefix

* Problem: make builds are failing

Solution: transfer CMake changes to (auto)make files

* Problem: no test with INITIATE command with invalid length

Solution: added test case

* Problem: code duplication between test_security_curve.cpp and curve_client.cpp

Solution: extracted parts of zmq::curve_client_t::produce_hello into reusable function

* Problem: code duplication between test_security_curve.cpp and curve_client.cpp

Solution: extracted further parts of zmq::curve_client_t into reusable functions
added missing file

* Problem: mechanism_t::add_property can be declared static

Solution: declare mechanism_t::add_property static

* Problem: intermediate crypto data needs to be passed between static function calls to curve_client_tools_t

Solution: add non-static member functions

* Problem: msg_t instance may be closed twice

Solution: remove offending close

* Problem: prepare_hello uses static curve_client_tools_t::produce_hello

Solution: Use non-static curve_client_tools_t::produce_hello

* Problem: no test with invalid command name where INITIATE command is expected

Solution: added test case

* Problem: make builds are failing due to curve_client_tools.hpp not being found

Solution: add curve_client_tools.hpp to list of source files

* Problem: wrong initializer order in zmq::curve_client_t

Solution: reorder

* Problem: under non-Windows systems, test fails because random_open was not called

Solution: call random_open/random_close within test

* Problem: conflict between custom function htonll and macro definition on Darwin

Solution: define htonll function only if not defined as a macro

* Problem: nullptr not defined on all platforms

Solution: replace nullptr by NULL

* Problem: libsodium builds not working

Solution: adapt compile and link file sets for libsodium builds

* Problem: Makefile.am broken

Solution: Fix syntax

* Problem: no tests for garbage encrypted cookie or content in INITIATE

Solution: added test cases

* Problem: test cases accidentally excluded from build

Solution: remove #if/#endif

* Solution: some error cases are unreachable

Problem: for the time being, added some comments without changing the code

* Added comments on hard-to-test cases
2017-08-15 15:28:24 +01:00
Luca Boccassi
6d76106cde Problem: test_many_sockets is flacky on OSX
Solution: mark it as XFAIL. We tried many times to tweak the system
settings from the CI script but it still fails.
2017-05-01 22:57:05 +01:00
Jim Garlick
edd6b0ad01 gssapi: add a basic test for GSSAPI security
Problem: there is no test coverage for GSSAPI.

Solution: add a test structured like the CURVE test.

The test is not built if libzmq is not configured with
--with-libgssapi_krb5. It will report SKIPPED status
if the required environment is missing (see below).

Environment:  KRB5_KTNAME and KRB5_CLIENT_KTNAME
environment variables must point to a keytab file
containing creds for a host-based test principal
(see comment at top of source for details).
Kerberos must be configured and a KDC containing the
test principal must be running, otherwise the test
will fail/hang.

N.B. For now, the test must use the same principal for
both client and server roles because it seems impossible
to set them to different principals when they are
threads in the same process.  Once one principal is
cached in credential cache, attempts to acquire creds
for a different "desired name" seem to be ignored and
the cached principal is used instead.
2017-04-26 09:31:21 -07:00
Sylvain Corlay
33dccd2bf1 Include FindSodium.cmake in dist tarball 2017-02-07 14:12:43 +01:00
Luca Boccassi
272d340c1f Problem: no mixed FD and zmq socket zmq_poll test
Solution: add one
2016-12-15 12:03:48 +00:00
Luca Boccassi
25402335fd Problem: no bind-after-connect TCP test
Solution: add one to increase coverage
2016-09-24 18:27:19 +01:00
Laughing
45286fa1fe add pollset poller in AIX
add a new poller named pollset which will get benefit of performance in AIX platform.
2016-09-20 10:50:50 +08:00
Luca Boccassi
a4ae43e036 Problem: CMake build from dist tarball broken
Solution: include src/version.rc.in and tests/CMakeLists.txt in the
make dist tarball by adding them to makefile.am EXTRA_DIST list.
2016-09-01 13:15:02 +01:00
Luca Boccassi
0372e5ce22 Problem: spec file needs version before build on OBS
Solution: stop autogenerating it and hard code version so that the
OBS build service can extract it and use it to build packages
automatically
2016-07-31 17:10:33 +01:00
evoskuil
c050d95fcd Problem: no unit tests for base85 or public curve functions. 2016-05-19 03:46:15 -07:00
Bitiquinho
a7399fab51 Fix Makefile.am 2016-05-15 15:37:33 -03:00
Bitiquinho
da14bb4bc2 Added ZMQ_DGRAM tests to build (Makefile.am and CMakeLists.txt) 2016-05-15 15:37:33 -03:00
Bitiquinho
365c8eda72 Add dgram_t class (based on stream socket and udp engine) 2016-05-15 15:35:35 -03:00
evoskuil
8474dc3c53 Problem: precompiled.cpp/hpp required but excluded from non-msvc builds. 2016-05-14 03:29:11 -07:00
evoskuil
5939debe41 Problem: incorrect file extension (.hpp) for zmq_draft.h in Makefile.am. 2016-05-13 20:55:17 -07:00
evoskuil
2b798e486a Problem: name conflicts from windows.h, draft API declared in pch. 2016-05-13 20:41:26 -07:00
hitstergtd
206771afd2 Problem: Not all ancillary API methods tested
Solution:
- Add file for testing ancillary API methods and any misc internal machinery
- Add tests for zmq_version(3) and zmq_strerror(3)
- Add test file into gitignore, Autotools and CMake build files
- Increase test coverage

Note:
MSVC solution files have not been updated.
2016-05-08 18:25:03 +01:00
Luca Boccassi
8045e9ae24 Problem: no backtrace is printed on assert
Solution: add an optional dependency on libunwind, and if present
use it to print the backtrace when zmq_abort is called.
2016-05-06 21:34:25 +01:00
hitstergtd
6ae2ff6446 Problem: MAINTAINERS file has no purpose anymore
Solution:
Remove until such time that a new and appropriate file can replace it should
it be deemed necessary.
2016-05-04 16:06:33 +01:00
Luca Boccassi
6de24c190a Problem: scatter/gather are not yet stable APIs
Solution: mark them as DRAFT APIs
2016-05-02 21:47:05 +01:00
Luca Boccassi
caaf66c32c Problem: radio/dish are not yet stable APIs
Solution: mark them as DRAFT APIs
2016-05-02 21:47:05 +01:00
Luca Boccassi
32a1ef85a8 Problem: zmq_timers* are not yet stable APIs
Solution: mark them as DRAFT APIs
2016-05-02 21:47:05 +01:00
Luca Boccassi
738968082b Problem: zmq_poller* are not yet stable APIs
Solution: mark them as DRAFT APIs
2016-05-02 21:47:05 +01:00
Luca Boccassi
7e700f1e73 Problem: client/server are not yet stable APIs
Solution: mark them as DRAFT APIs
2016-05-02 21:47:05 +01:00
Luca Boccassi
064cd1fbfb Problem: no support for DRAFT API in build systems
Solution: add support for --enable-drafts/ENABLE_DRAFTS=ON in
Autools and CMake.
2016-05-02 21:47:05 +01:00
hitstergtd
876ee5d6b4 Problem: test_pub_invert_matching missing in autotools build
Solution:
- add it to Makefile.am
2016-04-26 16:29:06 +01:00
Luca Boccassi
5178251587 Problem: test_ipc_wildcard is ran on Windows
Solution: move it to the unix-only section of Makefile.am and
tests/CMakeLists.txt since it uses Unix IPC sockets.
2016-04-21 14:17:10 +01:00