tests: Ensure the ssh session fd is read-/writeable in torture_proxycommand
Signed-off-by: Sanne Raymaekers <sraymaek@redhat.com> Reviewed-by: Andreas Schneider <asn@cryptomilk.org> Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
Этот коммит содержится в:
родитель
61cac32288
Коммит
03c30e9c8a
@ -9,6 +9,7 @@
|
|||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
#include <pwd.h>
|
#include <pwd.h>
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
|
#include <fcntl.h>
|
||||||
|
|
||||||
static int sshd_setup(void **state)
|
static int sshd_setup(void **state)
|
||||||
{
|
{
|
||||||
@ -61,11 +62,16 @@ static void torture_options_set_proxycommand(void **state) {
|
|||||||
struct torture_state *s = *state;
|
struct torture_state *s = *state;
|
||||||
ssh_session session = s->ssh.session;
|
ssh_session session = s->ssh.session;
|
||||||
int rc;
|
int rc;
|
||||||
|
socket_t fd;
|
||||||
|
|
||||||
rc = ssh_options_set(session, SSH_OPTIONS_PROXYCOMMAND, "nc 127.0.0.10 22");
|
rc = ssh_options_set(session, SSH_OPTIONS_PROXYCOMMAND, "nc 127.0.0.10 22");
|
||||||
assert_int_equal(rc, 0);
|
assert_int_equal(rc, 0);
|
||||||
rc = ssh_connect(session);
|
rc = ssh_connect(session);
|
||||||
assert_ssh_return_code(session, rc);
|
assert_ssh_return_code(session, rc);
|
||||||
|
fd = ssh_get_fd(session);
|
||||||
|
assert_true(fd != SSH_INVALID_SOCKET);
|
||||||
|
rc = fcntl(fd, F_GETFL);
|
||||||
|
assert_int_equal(rc & O_RDWR, O_RDWR);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void torture_options_set_proxycommand_notexist(void **state) {
|
static void torture_options_set_proxycommand_notexist(void **state) {
|
||||||
|
Загрузка…
x
Ссылка в новой задаче
Block a user