summaryrefslogtreecommitdiff
path: root/tests
AgeCommit message (Collapse)Author
2020-02-22Add Channel::request_auth_agent_forwardingWez Furlong
This method enables agent forwarding
2020-01-18ChannelInner is Send + SyncWez Furlong
This allows Channel and Stream to be Send
2020-01-18Make properly Send safeWez Furlong
In earlier iterations I accidentally removed Send from Session and then later restored it in an unsafe way. This commit restructures the bindings so that each of the objects holds a reference to the appropriate thing to keep everything alive safely, without awkward lifetimes to deal with. The key to this is that the underlying Session is tracked by an Arc<Mutex<>>, with the related objects ensuring that they lock this before they call into the underlying API. In order to make this work, I've had to adjust the API around iterating both known hosts and agent identities: previously these would iterate over internal references but with this shift there isn't a reasonable way to make that safe. The strategy is instead to return a copy of the host/identity data and then later look up the associated raw pointer when needed. The purist in me feels that the copy feels slightly wasteful, but the realist justifies this with the observation that the cardinality of both known hosts and identities is typically small enough that the cost of this is in the noise compared to actually doing the crypto+network ops. I've removed a couple of error code related helpers from some of the objects: those were really internal APIs and were redundant with methods exported by the Error type anyway. Fixes: https://github.com/alexcrichton/ssh2-rs/issues/154 Refs: https://github.com/alexcrichton/ssh2-rs/issues/137
2020-01-03cargo fmtbold
2020-01-03export block directionsbold
2019-12-21use internal-sftp in sshd for testsbold
2019-12-08A PtyModes helper for specifying terminal modesWez Furlong
Closes: https://github.com/alexcrichton/ssh2-rs/issues/145
2019-10-20tests: disable UsePrivilegeSeparation for ubuntu 16Wez Furlong
2019-10-20dump server logWez Furlong
2019-10-20increase debugability of integration testsWez Furlong
2019-10-20Make Session be `Send` againWez Furlong
Refs: https://github.com/alexcrichton/ssh2-rs/issues/137
2019-10-08tests explain why they are failingChris West (Faux)
2019-08-02work around broken travis macos configurationWez Furlong
2019-08-02more diagnostics for travis/macosWez Furlong
Debugging a test failure/hang on travis for macos
2019-08-02handle_extended_dataWez Furlong
Add a function to configure how extended data streams are to be handled. This allows for merging stderr to stdout, or discarding it.
2019-08-01move tcpstream assignment to its own functionWez Furlong
The recent move to take ownership of TcpStream exposed an issue with the `handshake` method: if the stream is non-blocking then it may take several attempts to handshake, but only the first one is able to transfer ownership. My initial thought was just to make the TcpStream a required parameter to `new`, but we have some tests that work with known hosts and the ssh agent that don't require a tcpstream. I'm going to review those and see if there is a cleaner overall solution, but that will likely require more substantial API changes. For now, the simplest change is to add a separate `set_tcp_stream` function to make the stream ownership transfer explicit and distinct from the handshake. Refs: https://github.com/alexcrichton/ssh2-rs/issues/17
2019-07-31troubleshoot macos test failureWez Furlong
Increase the level of diagnostics in the hope that we learn more about what's happening with the failure on travis: https://travis-ci.com/alexcrichton/ssh2-rs/jobs/221391881
2019-07-31Support keyboard-interactive authenticationWez Furlong
Refs: https://github.com/alexcrichton/ssh2-rs/issues/65
2019-07-29Add script for running integration testsWez Furlong
This makes it possible to run the integration tests without requiring that the user change their local ssh configuration. This is desirable because some sites have strict controls over the local ssh configuration files. This commit adds a script that spawns a local copy of the ssh daemon running on an alternate port with a specific configuration that is known to successfully pass the test suite. This has only been tested on my local macos machine so far.
2019-07-29Make channel tests more robust to stderr outputWez Furlong
At the start of feb 2019 the tests started to fail on macos on Travis. No changes were made to the repo, so the problem must be environmental. It turns out that the server was emitting stderr output, and since the tests were not consuming stderr, this made `channel.eof()` always return false. The resolution is to drain both stdout and stderr in the tests before making assertions with `channel.eof()`. I've also updated the doc comment on `channel.eof()` to reflect this, as it is a bit of a sharp edge.
2019-07-29Session::handshake now takes ownership of TcpStreamWez Furlong
Refs: https://github.com/alexcrichton/ssh2-rs/issues/17
2019-07-29cargo fmtWez Furlong
No functional changes, just formatting
2018-07-13Use modern Cargo conventions for testsAlex Crichton
2017-08-28Remove unused crate in testsAlex Crichton
2017-05-23Fix exit_status exampleBrian Olsen
In the example in the documentation that calls exit_status and in the smoke integration test exit_status is called before the channel is closed and it will therefore always return Ok(0). I have fixed this by calling wait_close() first and by adding a bad_smoke test that calls false and checks that the exit_status is 1.
2016-10-05Remove unused constantAlex Crichton
2016-10-05Remove what appears to be a bogus assertAlex Crichton
2016-10-05Don't wait for a thread that will probably never finishAlex Crichton
2016-10-04Fix sftp::ops testAlex Crichton
2016-04-28Add tests for errors before exit_status()Aidan Hobson Sayers
2016-02-06Don't assert free returns 0 in a dtorAlex Crichton
This may return EAGAIN, but we'll just make things worse by aborting. Instead just unfortunately leak the memory as there's not much more that can be done.
2015-11-01Add +1 reservation for trailing zero in write_stringAlex Crichton
2015-10-07Add automated testing of FFI bindingsAlex Crichton
2015-07-22Make a test less flakyAlex Crichton
2015-04-29Fix a compile-error for beta on windowsAlex Crichton
2015-04-15Update to rust masterAlex Crichton
2015-04-02Update to rust masterAlex Crichton
2015-03-25Update to rust masterAlex Crichton
2015-03-19Use new metadata format for CargoAlex Crichton
2015-03-15Update to rust masterAlex Crichton
2015-03-07Update to rust masterAlex Crichton
2015-03-01Update to rust masterAlex Crichton
2015-02-26Bump libssh2-sys to 0.1.10Alex Crichton
2015-02-23Slim down custom TempDirAlex Crichton
2015-02-23Update to std::ioAlex Crichton
2015-02-19Update to rust masterAlex Crichton
2015-02-12Update to rust masterAlex Crichton
2015-02-05Update to rust masterAlex Crichton
2015-02-03Update to rust masterAlex Crichton
2015-01-28Update to rust masterAlex Crichton