Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 8 additions & 7 deletions tests/ssh2_send_signal.phpt
Original file line number Diff line number Diff line change
@@ -1,26 +1,27 @@
--TEST--
ssh2_send_signal() - Tests sending signal to process
--SKIPIF--
<?php require('ssh2_skip.inc'); ssh2t_needs_auth();
echo "skip This test is not working";
?>
<?php require('ssh2_skip.inc'); ssh2t_needs_auth(); ?>
--FILE--
<?php require('ssh2_test.inc');

$ssh = ssh2_connect(TEST_SSH2_HOSTNAME, TEST_SSH2_PORT);
var_dump(ssh2t_auth($ssh));

$cmd = ssh2_exec($ssh, 'bash -c \'trap "echo success" SIGINT; sleep infinity\'');
$cmd = ssh2_exec($ssh, 'bash -c \'trap "echo success; exit 0" INT; echo ready; sleep 10; echo timeout\'');
var_dump($cmd);
stream_set_blocking($cmd, true);

echo fgets($cmd);

$result = ssh2_send_signal($cmd, 'INT');
var_dump($result);

$stdout = stream_get_contents($cmd);
echo $stdout;
echo stream_get_contents($cmd);

--EXPECTF--
bool(true)
resource(%d) of type (stream)
ready
bool(true)
success
success
Loading