fake-sftp-server-rule icon indicating copy to clipboard operation
fake-sftp-server-rule copied to clipboard

How to simulate failure scenario ?

Open geranne opened this issue 3 years ago • 3 comments

The source code that I am creating unit tests has a lot of try catch block. How do I simulate failure scenario, so I can cover those catch blocks ? Is there I way we can customize the response or reply code of the different SFTP commands ?

geranne avatar Sep 23 '21 22:09 geranne

Can you give an example of such a failure scenario?

stefanbirkner avatar Nov 24 '21 18:11 stefanbirkner

Can you give an example of such a failure scenario?

Let"s say there is a network communication failure.

geranne avatar Nov 24 '21 19:11 geranne

For simulating network failures I suggest to use a proxy that can simulate network errors. For network errors you usually don't get an answer from the SFTP server at all and therefore this behaviour is not something I would like tom implement in the SFTP server. Does this answer help you?

stefanbirkner avatar Nov 27 '21 10:11 stefanbirkner