Closed public closed 13 years ago
No, there are already unit tests for timeout/bad queries (see tests directory) and I've recently created new functions to submit raw requests in this goal (see github log).
Which tests do this exactly? I can't identify which test suite checks timeout and invalid CRC behavior.
tests/unit-test-{client|server].c, the filename is clear, isn't it? If you want to add something just send an email or issue a pull request on github. The issue tracker is dedicated to bugs.
Sorry if this is the wrong place for this discussion. It just seems better to record this stuff in public and there's no official mailing list.
I can't see how the unit tests are testing the CRC paths. It seems that it requests a bad response from the server using UT_REGISTERS_NB_SPECIAL, and that mangles the number of records returned in the response so it doesn't match what the client expects. This doesn't test for random single bit corruption in messages, or other types of invalid data that can be caused by EMC or buggy hardware.
Yes it is, Please take time to consult the website first! http://libmodbus.org/reportbug/
I've already think about using a fuzzer to generate random and invalid data so it 's why I've created modbus_send_raw_request (http://hachoir.org/). Feel free to submit patches.
CRC is only used in RTU framing and the algo is already bullet proof and used for real on many applications every day so I don't care about this specific test.
Ah sorry about that, I'm subscribed now!
There's currently no tests covering data corruption, timeouts etc.
There should be some. I intend to write some at some point in the near future but if someone get's there before me I'll help out.