aboutsummaryrefslogtreecommitdiff
path: root/tests
Commit message (Collapse)AuthorAge
...
* Allocate AIOs dynamically.Garrett D'Amore2017-09-22
| | | | | | | | | | | | | | We allocate AIO structures dynamically, so that we can use them abstractly in more places without inlining them. This will be used for the ZeroTier transport to allow us to create operations consisting of just the AIO. Furthermore, we provide accessors for some of the aio members, in the hopes that we will be able to wrap these for "safe" version of the AIO capability to export to applications, and to protocol and transport implementors. While here we cleaned up the protocol details to use consistently shorter names (no nni_ prefix for static symbols needed), and we also fixed a bug in the surveyor code.
* Allow forcibly adding idhash values outside of the range.Garrett D'Amore2017-09-05
| | | | | This will allow us to use idhash to manage ephemeral ports (indexed by port), while also allowing us to insert managed ports.
* Add test for reconnection of disconnected client.Garrett D'Amore2017-09-05
|
* Reorganize reset so it only takes place after creating sockets.Garrett D'Amore2017-08-28
| | | | Eliminate a stupid delay.
* Flush output so we can get a better sense of when we hang/fail.Garrett D'Amore2017-08-28
|
* Fix leak in scalability test.Garrett D'Amore2017-08-24
|
* Pipeline can wind up establishing in reverse order.Garrett D'Amore2017-08-24
|
* A few more sleeps for connection establishment.Garrett D'Amore2017-08-24
|
* Fix a few warnings and subtle test races.Garrett D'Amore2017-08-24
|
* Eliminate legacy option settings, provide easier option IDs.Garrett D'Amore2017-08-24
| | | | | | | | | | | | | | | | | | This eliminates all the old #define's or enum values, making all option IDs now totally dynamic, and providing well-known string values for well-behaved applications. We have added tests of some of these options, including lookups, and so forth. We have also fixed a few problems; including at least one crasher bug when the timeouts on reconnect were zero. Protocol specific options are now handled in the protocol. We will be moving the initialization for a few of those well known entities to the protocol startup code, following the PAIRv1 pattern, later. Applications must therefore not depend on the value of the integer IDs, at least until the application has opened a socket of the appropriate type.
* The common endpoint code already ensures state is proper.Garrett D'Amore2017-08-23
| | | | | | | This eliminates tests for code that we cannot reach, because the upper layer endpoint code already ensures that we don't get called if we are closing, that the mode is correct, and that only one outstanding endpoint operation is in progress on any given endpoint.
* Implement dynamic option numbering.Garrett D'Amore2017-08-23
| | | | | | | This permits option numbers to be allocated based on string name. Eventually all the option values will be replaced with option names. This will facilitate transports (ZeroTier) that may need further options.
* Add support for 64-bit ids in idhash.Garrett D'Amore2017-08-22
| | | | | | | | | | | We intend to use this with transports where dynamic "port numbers" might be 32-bits. This would allow us to formulate a 64-bit number representing a conversation, and be able to find that conversation by the 64-bit value. Note that the hashed values are probably not perfectly optimal, as only the low order bits are particularly significant in the hash. We might want to consider XOR'ing in the upper bits to address that.
* fixes #41 Move DNS out of tcp transportGarrett D'Amore2017-08-21
| | | | | | | | | This moves the DNS related functionality into common code, and also removes all the URL parsing stuff out of the platform specific code and into the transports. Now the transports just take sockaddr's on initialization. (We may want to move this until later.) We also add UDP resolution as another separate API.
* Conditional platform inclusion cleanups.Garrett D'Amore2017-08-21
| | | | | | | | | | We only compile files that are appropriate for the platform. (We still have guards in place, to allow for a future single .C file to be built from all the sources.) We also remove the subsystem defines; if a new platform needs to deviate from POSIX in ways beyond what we intended here, then that platform should just copy those parts into a new platform directory, rather than cross including portions from POSIX.
* Updated convey test framework, and self tests for it.Garrett D'Amore2017-08-18
|
* Remove some dead code from scalability test.Garrett D'Amore2017-08-18
|
* Endpoint API completely implemented.Garrett D'Amore2017-08-18
| | | | | | This supports creating listeners and dialers, managing options on them (though only a few options are supported at present), starting them and closing them, all independently.
* fixes #39 Transport ops vector should be versionedGarrett D'Amore2017-08-17
| | | | | | This also includes tests for some of the edge cases surrounding pluggable transports, such as version mismatch, duplication registration, and failure to initialize.
* Provide versions of mutex, condvar, and aio init that never fail.Garrett D'Amore2017-08-16
| | | | | | | | | | | | | | | | | | | | | | | If the underlying platform fails (FreeBSD is the only one I'm aware of that does this!), we use a global lock or condition variable instead. This means that our lock initializers never ever fail. Probably we could eliminate most of this for Linux and Darwin, since on those platforms, mutex and condvar initialization reasonably never fails. Initial benchmarks show little difference either way -- so we can revisit (optimize) later. This removes a lot of otherwise untested code in error cases and so forth, improving coverage and resilience in the face of allocation failures. Platforms other than POSIX should follow a similar pattern if they need this. (VxWorks, I'm thinking of you.) Most sane platforms won't have an issue here, since normally these initializations do not need to allocate memory. (Reportedly, even FreeBSD has plans to "fix" this in libthr2.) While here, some bugs were fixed in initialization & teardown. The fallback code is properly tested with dedicated test cases.
* Convert duration to usec.Garrett D'Amore2017-08-14
|
* Added shutdown test from legacy nanomsg.Garrett D'Amore2017-08-14
|
* fixes #63 NNG_FLAG_SYNCH should be the defaultGarrett D'Amore2017-08-14
| | | | | Also enables creating endpoints that are idle (first part of endpoint options API) and shutting down endpoints.
* fixes #62 Endpoint close should be synchronous #62Garrett D'Amore2017-08-14
| | | | | | | | | | | fixes #66 Make pipe and endpoint structures private This changes a number of things, refactoring endpoints and supporting code to keep their internals private, and making endpoint close synchronous. This will allow us to add a consumer facing API for nng_ep_close(), as well as property APIs, etc. While here a bunch of convoluted and dead code was cleaned up.
* REP drops peers a little too aggressively.Garrett D'Amore2017-08-14
| | | | | | | | We noticed that certain failure modes were exposed in tests that were caused by us closing the underlying pipe when certain messaging errors occurred. Discarding the pipe is the wrong answer; instead we should discard the message and keep the pipe open (unless the message is so malformed that the remote party cannot be trusted.)
* Idempotent taskq finalizers.Garrett D'Amore2017-08-14
|
* Convenience option accesor functions.Garrett D'Amore2017-08-12
| | | | | | | | This adds functions that know about option sizes and make them easier to use. While here I added some validation of those, and cleaned up a few tests slightly. Note that we do not need to use the nng_impl.h for most tests. More of them need to be cleaned up.
* Moved a few private test items into test-specific header.Garrett D'Amore2017-08-12
|
* Fix leaks found in pairv1 test suite.Garrett D'Amore2017-08-11
|
* Add tests to validate backpressure vs best effort for pairv1.Garrett D'Amore2017-08-11
|
* Fail to another stream on default (no pipe requested).Garrett D'Amore2017-08-11
|
* Add a test for default pipe in polyamorous mode.Garrett D'Amore2017-08-11
|
* Fix TTL handling for pair1 protocol; more tests.Garrett D'Amore2017-08-11
|
* Windows fixes; especially idempotent init/fini.Garrett D'Amore2017-08-11
| | | | | | | This fixes one major problem, which was that if nni_fini() was called once on Windows, it would not be further possible to call nni_init(). While here fixed a few compilation issues.
* Test support for pairv1 including polyamorous mode.Garrett D'Amore2017-08-11
|
* Add 32-bit accessors for messages, and tests for them.Garrett D'Amore2017-08-11
|
* Leaking poll fds.Garrett D'Amore2017-08-11
| | | | | | | We never set the fd->sn_init member, causing new fds to be allocated on each request for a new pollfd, and causing old ones to leak, and worse may be even to not get notified. While here, we arrange for a bit richer testing against the various options.
* Verify errno handling works; use table driven approach.Garrett D'Amore2017-08-10
|
* Restore the device test.Garrett D'Amore2017-08-10
|
* Unify the msg API.Garrett D'Amore2017-08-10
| | | | | | | | | | | | | This makes the operations that work on headers start with nni_msg_header or nng_msg_header. It also renames _trunc to _chop (same strlen as _trim), and renames prepend to insert. We add a shorthand for clearing message content, and make better use of the endian safe 32-bit accessors too. This also fixes a bug in inserting large headers into messages. A test suite for message handling is included.
* Add new PAIR_V1 protocol.Garrett D'Amore2017-08-10
| | | | | | | | | | The PAIR_V1 protocol supports both raw and cooked modes, and has loop prevention included. It also has a polyamorous mode, wherein it allows multiple connections to be established. In polyamorous mode (set by an option), the sender requests a paritcular pipe by setting it on the message. We default to PAIR_V1 now.
* fixes #47 compat_reqttls fails sometimesGarrett D'Amore2017-08-09
| | | | fixes #23 Restore the old idhash logic for sockets
* Fix problems found in Windows build.Garrett D'Amore2017-08-09
|
* fixes #48 tcp sometimes fails to get a portGarrett D'Amore2017-08-09
|
* Undo header include reordering (clang, breaks windows).Garrett D'Amore2017-08-09
|
* fixes #44 open protocol by "name" (symbol) instead numberGarrett D'Amore2017-08-09
| | | | | | | | | | | | | | fixes #38 Make protocols "pluggable", or at least optional This is a breaking change, as we've done away with the central registered list of protocols, and instead demand the user call nng_xxx_open() where xxx is a protocol name. (We did keep a table around in the compat framework though.) There is a nice way for protocols to plug in via an nni_proto_open(), where they can use a generic constructor that they use to build a protocol specific constructor (passing their ops vector in.)
* fixes #37 Make transports pluggableGarrett D'Amore2017-08-08
| | | | | | | | | | | | We automatically register inproc, TCP, and IPC. We can add more now by just calling nni_tran_register(). (There is no unregister support.) This requires transports to have access to the AIO framework (so that needs to be something we consider), and a few nni_sock calls to get socket options. Going forward we should version the ops vectors, and move to pushing down transport options from the framework via setopt calls -- there is no reason really that transports need to know all these.
* Use inproc to minimize timeouts on TCP (Windows).Garrett D'Amore2017-08-08
|
* Increase the timeouts for compat_reqttl (context switches?)Garrett D'Amore2017-08-08
| | | | | Also, we need to nn_close(), because the close can reasonably race against nn_term(), causing false test failures.
* Added nn_compat code for option handling, fixed other bugs.Garrett D'Amore2017-08-08
| | | | | | | Hop counts for REQ were busted (bad TTL), and imported the compat_reqtll test. At the same time, added code to nn_term to shut down completely, discarding sockets. (Note that some things, such as globals, may still be left around; that's ok.)