mirror of
https://git.libssh.org/projects/libssh.git
synced 2026-02-09 09:54:25 +09:00
tests: Improve the torture_request_env test
This still doesn't work on FreeBSD Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
This commit is contained in:
@@ -84,10 +84,10 @@ static void torture_request_env(void **state)
|
|||||||
rc = ssh_channel_open_session(c);
|
rc = ssh_channel_open_session(c);
|
||||||
assert_int_equal(rc, SSH_OK);
|
assert_int_equal(rc, SSH_OK);
|
||||||
|
|
||||||
rc = ssh_channel_request_env(c, "LC_LIBSSH", "LIBSSH");
|
rc = ssh_channel_request_env(c, "LC_LIBSSH", "LIBSSH_EXPORTED_VARIABLE");
|
||||||
assert_int_equal(rc, SSH_OK);
|
assert_int_equal(rc, SSH_OK);
|
||||||
|
|
||||||
rc = ssh_channel_request_exec(c, "bash -c export");
|
rc = ssh_channel_request_exec(c, "echo $LC_LIBSSH");
|
||||||
assert_int_equal(rc, SSH_OK);
|
assert_int_equal(rc, SSH_OK);
|
||||||
|
|
||||||
nbytes = ssh_channel_read(c, buffer, sizeof(buffer) - 1, 0);
|
nbytes = ssh_channel_read(c, buffer, sizeof(buffer) - 1, 0);
|
||||||
@@ -98,7 +98,7 @@ static void torture_request_env(void **state)
|
|||||||
assert_int_equal(rc, nbytes);
|
assert_int_equal(rc, nbytes);
|
||||||
#endif
|
#endif
|
||||||
buffer[nbytes]='\0';
|
buffer[nbytes]='\0';
|
||||||
if (strstr(buffer, "LC_LIBSSH=\"LIBSSH\"")) {
|
if (strstr(buffer, "LIBSSH_EXPORTED_VARIABLE")) {
|
||||||
lang_found = 1;
|
lang_found = 1;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user