Commit Graph

109 Commits

Author SHA1 Message Date
Luca Boccassi
bfa8cf3089 Problem: test_pair_tcp_cap_net_admin requires sudo but is enabled by default in CMake
Solution: add an option to enable it, and default to false. Enable it in
the CI so we don't lose coverage, as it works on Travis.

Fixes #3725
2019-10-31 09:37:22 +00:00
Simon Giesecke
66d0f3511f Problem: ipc transport not supported under Windows
Solution: implement support
2019-10-29 23:04:54 +01:00
imkcy9
2f98f7034b Support XPub socket send last value caching to last subscription pipe with ZMQ_XPUB_MANUAL_LAST_VALUE. (#3511)
* Add ZMQ_XPUB_MANUAL_LAST_VALUE

* Surpport xpub send last value caching to one pipe with ZMQ_XPUB_MANUAL_LAST_VALUE

* Add test_xpubub_manual_last_value

* Add relicense and doc
2019-05-17 22:12:32 +01:00
Iwan Paolucci
e1a895917c Problem: libzmq does not build on QNX 6.6 using CMake #3479
Solution: libm and libsocket have to be linked explicitely
2019-04-18 13:23:36 +02:00
Simon Giesecke
1450830611 Problem: unused include directives
Solution: remove and add where needed
2019-03-23 09:46:37 -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
9528983d95 Problem: tests without test framework
Solution: migrate to Unity
2019-03-22 12:36:24 -04:00
Simon Giesecke
223ef516b6 Problem: test_security_null not using a test framework
Solution: migrate to Unity and separate test_security_no_zap_handler
2019-03-16 17:20:19 +01:00
Luca Boccassi
e5a7f2eb56
Merge pull request #3402 from sigiesec/revert-64-bit-assertions
Revert 64 bit assertions
2019-02-07 15:58:38 +00:00
Simon Giesecke
31ff05d156 Revert "Problem: test build fails on 32 bit systems"
This reverts commit ac19d5f41c.
2019-02-07 10:42:32 -05:00
Simon Giesecke
ec4ecb01ff Problem: no test for ZMQ_BINDTODEVICE
Solution: add test case run with cap_net_admin
Fixes #3397
2019-02-07 09:39:02 -05:00
Simon Giesecke
ac19d5f41c Problem: test build fails on 32 bit systems
Solution: define UNITY_SUPPORT_64 to force 64 bit support
2019-02-07 12:13:11 +01:00
Simon Giesecke
30e0cbbcdc Problem: test_monitor depends on testutil_security
Solution: move general monitoring test utilities to new testutil_monitoring
2019-02-02 15:33:27 +01:00
Francesco Montorsi
eb3e63e22f Hwm tests and docs (#3242)
Add new HWM tests and more detailed documentation
2018-09-13 22:14:06 +01:00
Christoph Schulz
a21228b664 Conform to cmakelint --filter=-linelength
- Lowercase all commands
- Unify indent to 2 spaces
- Remove spaces around brackets
- Remove repitition of condition in else(...) and endif(...)

Note: (re-)running CMake did not change the content of the generated files
2018-09-10 00:12:07 +02:00
Simon Giesecke
d668925bca Problem: extensive duplication between test_use_fd_tcp and test_use_fd_ipc
Solution: merge into a single test_use_fd and reduce code duplication by extracting common functions
2018-08-23 18:00:52 +02:00
Luca Boccassi
fe82c643ed
Merge pull request #3220 from sigiesec/code-improvements
Various refactorings
2018-08-16 16:29:17 +01:00
Simon Giesecke
987e75b887 Problem: test program test_unbind_inproc is redundant, the same is already tested in test_inproc_connect
Solution: remove test_unbind_inproc
2018-08-16 12:37:06 +02:00
Simon Giesecke
6824c167ad
Merge pull request #3217 from WenbinHou/patch-1
Update unittests/CMakeLists.txt: use ZeroMQ_SOURCE_DIR, ZeroMQ_BINARY_DIR
2018-08-16 11:15:44 +02:00
Wenbin Hou
0507ae877d
Update tests/CMakeLists.txt: use ZeroMQ_SOURCE_DIR, ZeroMQ_BINARY_DIR
Use ZeroMQ_SOURCE_DIR, ZeroMQ_BINARY_DIR instead of CMAKE_SOURCE_DIR, CMAKE_BINARY_DIR in tests/CMakeLists.txt
Similar reason to change unittests/CMakeLists.txt
2018-08-16 13:17:44 +08:00
Szekely Gyorgy
2cdad3d0ce Add ZMQ_ROUTER_NOTIFY draft socket option (#3213)
* Add ZMQ_ROUTER_NOTIFY draft socket option
2018-08-15 08:54:08 +01:00
Luca Boccassi
d70714e877 Problem: can't process ZMTP 3.1 cancel/subscribe commands
Solution: add some msg helpers to parse commands, and check for
subscribe or cancel commands and process them accordingly in the xpub
and xsub classes.
2018-06-23 17:16:10 +01:00
Simon Giesecke
fa8bc17ef3 Problem: CMake error on Win32 with DRAFTS disabled
Solution: guard CMake statement properly
2018-06-01 18:20:11 +02:00
Simon Giesecke
7b686900f9 Problem: VS2008 build fails due to unavailable stdint.h
Solution: specify not to use stdint.h for VS<=2008, fixes #3025
2018-05-24 15:56:08 +02:00
Simon Giesecke
1e89a51734 Problem: broken indentation
Solution: fix indentation
2018-05-24 15:56:08 +02:00
Simon Giesecke
9df851225a Problem: test_radio_dish takes time near timeout
Solution: increase timeout
2018-05-23 16:31:05 +02:00
Simon Giesecke
2bdf86d6c2 Problem: timeout on test_many_sockets with epoll
Solution: increase timeout, remove timeout settings for unsupported poll poller
2018-05-23 16:26:52 +02:00
Luca Boccassi
4a4c6c27e4 Problem: heartbeat tests only cover ROUTER/DEALER
Solution: check more socket type to cover other session managers.
Increase timeout as the test now takes ~12 seconds.
2018-04-28 15:49:54 +01:00
Simon Giesecke
6d89635f9a Problem: test_udp not using unity
Solution: migrate to unity, merge into test_radio_dish, and split up test cases
2018-03-16 17:03:45 +01:00
Kachanovskiy
eb76ea06bd Fix for #2997 2018-03-16 12:48:00 +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
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
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
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
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
0458b85dec Problem: Some tests timeout on appveyor for POLLER=poll
Solution: Increase test timeouts for poll poller under Windows
2018-02-13 18:38:26 +01:00
sigiesec
61a28a26cc Problem: no test framework
Solution: add unity test framework, and integrate into cmake build
2018-02-11 17:25:36 +00:00
Luca Boccassi
0298d037d0 Problem: CMake rebuilds everything twice
Solution: build all the objects separately before the link step, to
avoid rebuilding when doing both static and shared builds
2017-11-20 15:55:35 +00:00
Luca Boccassi
5264d49eab Problem: duplicate definition in CMake tweetnacl builds
Solution: don't redefine preprocessor macro if it's already defined in
platform.hpp
2017-11-19 12:47:05 +00: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
Luca Boccassi
fab14a3cc1 Problem: support for CMake << 3.1 broken
Solution: remove redundant target_sources directive
2017-09-01 10:59:48 +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
Simon Giesecke
0aef54421d Problem: test_monitor is disabled on Windows
Solution: enable test
2017-08-21 12:20:37 +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
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
9c085381ee Problem: test_security_curve timeouts on CMake
Solution: bump timeout from 20 to 60 seconds
2017-08-04 16:25:59 +01:00