1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53
|
--TEST--
Check setting a timeout for operations
--CREDITS--
Russ Allbery
# Copyright 2012
# The Board of Trustees of the Leland Stanford Junior University
#
# SPDX-License-Identifier: MIT
--ENV--
KRB5CCNAME=remctl-test.cache
LD_LIBRARY_PATH=../client/.libs
--SKIPIF--
<?php
if (!file_exists("remctl-test.pid"))
echo "skip remctld not running";
?>
--FILE--
<?php
$fh = fopen("remctl-test.princ", "r");
$principal = rtrim(fread($fh, filesize("remctl-test.princ")));
$r = remctl_new();
if ($r == null) {
echo "remctl_new failed\n";
exit(2);
}
echo "Created object\n";
if (!remctl_set_timeout($r, 1)) {
echo "remctl_set_timeout failed\n";
exit(2);
}
if (!remctl_open($r, "127.0.0.1", 14373, $principal)) {
echo "remctl_open failed\n";
exit(2);
}
$args = array("test", "sleep");
if (!remctl_command($r, $args)) {
echo "remctl_command failed\n";
exit(2);
}
echo "Sent sleep command\n";
$output = remctl_output($r);
if (!$output) {
echo "output is correctly empty\n";
}
$error = remctl_error($r);
echo "Error: $error\n";
remctl_close($r);
?>
--EXPECT--
Created object
Sent sleep command
output is correctly empty
Error: error receiving token: timed out
|