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");
* 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
* 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
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.
* 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
* Problem: no tests for ZAP protocol errors
Solution: added first test for a bogus version number in ZAP reply
* Problem: no tests for ZAP protocol errors
Solution: added more test cases
* Problem: cannot compile without ZMQ_BUILD_DRAFT_API
Solution: conditionally compile parts that depend on draft API
* Problem: test_security_curve times out in CI
Solution: Increase timeout for this test to 20 seconds
Solution: use lower case ws2_32.lib to enable cross compilation
from platforms with case-sensitive filesystems.
When cross compiling the tests with Mingw-w64, CMake cannot
locate Ws2_32.lib
Remove the `build/msvc` include path from the test project to fix a
problem with the order of the include paths. Additionally remove the
unnecessary `include_directories` from the master project.
Signed-off-by: Stefan Herbrechtsmeier <stefan.herbrechtsmeier@weidmueller.com>
only if the library is found at a specific path
Solution: Search for libzmq.lib in ../bin/Win32/Debug/v120/dynamic, don't
know how to automatically search in correct path based on current build
configuration
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.
Solution: PR #1906 did not solve this problem properly; subsequent Travis CI
indicated that the issue happens with Clang/LLVM, so make sure to fix the
issue by detecting if Cmake CMake is using Clang for building the tests.
Solution: add macro in ZMQSourceRunChecks.cmake and optionally
include the TIPC sources if the support is available.
More importantly, only run the TIPC tests if the support is there.
Problem:
A per-test Linker search path was added in commit a911fa4 to CMakeLists.txt as
part of fixing Windows builds. Whilst this is silently ignored by ld(1) on
Linux, it doesn't settle well with OS X. Spurious warnings are generated about
missing directories leading to convoluted build logs.
Solution:
Make per-Test LINK_DIRECTORIES() conditional for non-Apple platforms.
Move tests specific to Linux under a platform conditional thereby eliminating
unnecessary builds and fixing "make test" on Mac OS X and possibly other
non-Linux systems.
Tests specific to Linux:
- abstract namespace support for AF_UNIX sockets
- TIPC support (AF_TIPC)
Test success rate jumps from 90% to 100% on Mac OS X after this change.
Solution: remove temporarily until proper message limits have been
implemented, then a more granular test case can be added without
such high requirements which are problematic in embedded environment,
build systems, VMs and CI systems
Solution: Add precompiled flags to CMakeList.txt for faster compiles
+ bonus - removed compilation warning on Windows by adding
add_definitions (-D_WINSOCK_DEPRECATED_NO_WARNINGS)
Solution: Modified CMakelist.txt to build correctly for Windows
- corrected CMake required version to make sure it builds in
Ubuntu 14.04 LTS with no warnings.
Solution: parse the value set by the ZMQ_PRE_ALLOCATED_FD sockopt
when creating a new TCP socket and use it if valid.
Add new tests/test_pre_allocated_fd_tcp.cpp unit test.
Solution: parse the value set by the ZMQ_PRE_ALLOCATED_FD sockopt
when creating a new IPC socket and use it if valid.
Add new tests/test_pre_allocated_fd_ipc.cpp unit test.
This commit fixes the author warnings reported below. These tests
have originally been introduced in zeromq/libzmq@5ebfd17 and
zeromq/libzmq@5fe75f0.
8<---8<---8<---8<---8<---8<---8<---8<---8<---8<---8<---
CMake Warning (dev) at tests/CMakeLists.txt:133 (message):
Test 'test_udp' is not known to CTest.
This warning is for project developers. Use -Wno-dev to suppress it.
CMake Warning (dev) at tests/CMakeLists.txt:133 (message):
Test 'test_large_msg' is not known to CTest.
This warning is for project developers. Use -Wno-dev to suppress it.
8<---8<---8<---8<---8<---8<---8<---8<---8<---8<---8<---
VMCI transport allows fast communication between the Host
and a virtual machine, between virtual machines on the same host,
and within a virtual machine (like IPC).
It requires VMware to be installed on the host and Guest Additions
to be installed on a guest.
Problem: zmq_setsockpt() returns success when changing the
HWM after a bind or connect() even though the call has no effect.
Solution: Introduce a failing test a reminder we need to patch it.
ZMQ_INVERT_MATCHING reverses the PUB/SUB prefix matching. The subscription
list becomes a rejection list. The PUB socket sends messages to all
connected (X)SUB sockets that do not have any matching subscription.
Whenever the option is used on a PUB/XPUB socket, any connecting SUB
sockets must also set it or they will reject everything the publisher
sends them. XSUB sockets are unaffected because they do not filter out
incoming messages.