Skip to content

Commit 8b4d16f

Browse files
committed
update env
1 parent d99f40f commit 8b4d16f

File tree

2 files changed

+13
-9
lines changed

2 files changed

+13
-9
lines changed

.env

+8-8
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
ASYNC_SSH2_TEST_HOST_IP=10.10.10.2
22
ASYNC_SSH2_TEST_HOST_PW=root
33
ASYNC_SSH2_TEST_HOST_USER=root
4-
ASYNC_SSH2_TEST_KNOWN_HOSTS=/home/dex/rust/async-ssh2-tokio/tests/async-ssh2-tokio/known_hosts
5-
ASYNC_SSH2_TEST_CLIENT_PRIV=/home/dex/rust/async-ssh2-tokio/tests/client.ed25519
6-
ASYNC_SSH2_TEST_CLIENT_PUB=/home/dex/rust/async-ssh2-tokio/tests/client.ed25519.pub
7-
ASYNC_SSH2_TEST_CLIENT_PROT_PRIV=/home/dex/rust/async-ssh2-tokio/tests/client.prot.ed25519
8-
ASYNC_SSH2_TEST_CLIENT_PROT_PUB=/home/dex/rust/async-ssh2-tokio/tests/client.prot.ed25519.pub
4+
ASYNC_SSH2_TEST_KNOWN_HOSTS=./tests/async-ssh2-tokio/known_hosts
5+
ASYNC_SSH2_TEST_CLIENT_PRIV=./tests/client.ed25519
6+
ASYNC_SSH2_TEST_CLIENT_PUB=./tests/client.ed25519.pub
7+
ASYNC_SSH2_TEST_CLIENT_PROT_PRIV=./tests/client.prot.ed25519
8+
ASYNC_SSH2_TEST_CLIENT_PROT_PUB=./tests/client.prot.ed25519.pub
99
ASYNC_SSH2_TEST_CLIENT_PROT_PASS=test
1010
ASYNC_SSH2_TEST_HOST_PORT=22
11-
ASYNC_SSH2_TEST_SERVER_PUB=/home/dex/rust/async-ssh2-tokio/tests/sshd-test/ssh_host_ed25519_key.pub
12-
ASYNC_SSH2_TEST_UPLOAD_FILE=/home/dex/rust/async-ssh2-tokio/tests/async-ssh2-tokio/test-upload-file
11+
ASYNC_SSH2_TEST_SERVER_PUB=./tests/sshd-test/ssh_host_ed25519_key.pub
12+
ASYNC_SSH2_TEST_UPLOAD_FILE=./tests/async-ssh2-tokio/test-upload-file
1313
ASYNC_SSH2_TEST_HTTP_SERVER_IP=10.10.10.4
1414
ASYNC_SSH2_TEST_HTTP_SERVER_PORT=8000
15-
ASYNC_SSH2_TEST_HOST_NAME=ssh-server
15+
ASYNC_SSH2_TEST_HOST_NAME=localhost

src/client.rs

+5-1
Original file line numberDiff line numberDiff line change
@@ -1057,7 +1057,11 @@ mod tests {
10571057
ServerCheckMethod::with_known_hosts_file(&env("ASYNC_SSH2_TEST_KNOWN_HOSTS")),
10581058
)
10591059
.await;
1060-
assert!(client.is_ok());
1060+
if is_running_in_docker() {
1061+
assert!(client.is_ok());
1062+
} else {
1063+
assert!(client.is_err());// DNS can't find the docker hostname if the rust running without docker container
1064+
}
10611065
}
10621066

10631067
#[tokio::test]

0 commit comments

Comments
 (0)