Commit Graph

183 Commits

Author SHA1 Message Date
Simon Giesecke
6f8b604648 Problem: test_radio_dish not using unity
Solution: migrate to unity, and split test cases
2018-03-16 15:22:14 +01:00
Luca Boccassi
4cb15ec638
Merge pull request #2994 from sigiesec/migrate-to-unity
Migrate further tests to unity, and split up into individual test cases
2018-03-15 16:55:05 +00:00
Simon Giesecke
10dae6e830 Problem: test_poller not using unity
Solution: migrate to unity, and split test cases
2018-03-15 16:43:30 +01:00
Simon Giesecke
991b2336e4 Problem: test_thread_safe not using unity
Solution: migrate to unity, and split test cases
2018-03-15 16:43:27 +01:00
Simon Giesecke
5d32828bbf Problem: test_reconnect_ivl not using unity
Solution: migrate to unity, and reduce code duplication
2018-03-15 16:43:26 +01:00
Luca Boccassi
e388774737
Merge pull request #2981 from eponsko/master
Problem: no support for ZMTP 3.1 application metadata
2018-03-15 12:57:40 +00:00
Simon Giesecke
1e217ac063 Problem: unity built with unnecessary float but without command line argument support
Solution: add appropriate definitions to build
2018-03-15 11:28:50 +01:00
Simon Giesecke
f92cdf9470 Problem: test_ctx_destroy not using unity, and mixing test cases
Solution: migrate to unit and split up test cases
2018-03-15 10:58:56 +01:00
Simon Giesecke
fa89fb8639 Problem: Makefile.am missing unity dependencies
Solution: add unity dependencies/flags
2018-03-14 22:40:24 +01:00
Pontus Sköldström
dd5eec35be Support application metadata through ZMQ_METADATA
Lets the application set per-connection metadata.
Metadata is specified as "X-key:value" and set using zmq_setsockopt, eg:
zmq_setsockopt (s, ZMQ_METADATA, "X-key:value", 11);

The peer can then obtain the metadata from a received message:
char *data = zmq_msg_gets(msg, "X-key");
2018-03-14 12:56:15 +01:00
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