From 0eb8532541d18f818b24e98fa795313aff92df48 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9E=97=E5=BF=97=E5=AE=87?= Date: Thu, 13 Jun 2019 13:23:50 +0800 Subject: [PATCH] Begin working on testing document for dmsg. --- pkg/dmsg/testing.md | 45 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 pkg/dmsg/testing.md diff --git a/pkg/dmsg/testing.md b/pkg/dmsg/testing.md new file mode 100644 index 0000000000..1af1a08bdd --- /dev/null +++ b/pkg/dmsg/testing.md @@ -0,0 +1,45 @@ +# Testing + +This document is to specify the tests currently missing within `dmsg` (and that should be tested). + +## Integration Tests + +### Fault Injection testing + +The individual entities of `dmsg` (`dmsg.Client` and `dmsg.Server`), should be capable of dealing with erroneous (and in the future, malicious) behaviour of remote entities. + +Note that even though `messaging-discovery` is also considered to be an entity of `dmsg`, however it's mechanics are simple and will not be tested here. + +#### Ensure that `Client.Serve()` does not hang + +**`failed_accepts_should_not_result_in_hang`** + +- Given: + - clientA is connected to clientB via a server. + - clientB is NOT calling `.Accept()`. + - clientA dials transports to clientB until failure. +- When: + - clientA tries to dial to clientC. + - clientC tries to dial to clientA. +- Then: + - Transports established should still read/write as expected. + +**`failed_accepts_should_not_result_in_hang_2`** + +- Given: + - clientA has transports established with various remotes. + - The transports are being written/read to in a continuous loop. +- When: + - clientA dials to clientB (which is not calling `.Accept()`) until failure. +- Then: + - read/writes to existing transports should not hang. + +**`capped_transport_buffer_should_not_result_in_hang`** + +- Given: + - A transport is establised between clientA and clientB. + - clientA writes to clientB until clientB's buffer is capped + +### Fuzz testing + +We should test the robustness of the system under different conditions and random order of events. Integration-based tests should be written consisiting of x-number of servers, clients and a single \ No newline at end of file