source: web/old/remctl-2.14/php/tests/002.phpt @ f6f3e91

web
Last change on this file since f6f3e91 was f6f3e91, checked in by Jessica B. Hamrick <jhamrick@…>, 15 years ago

Preserve directory hierarchy (not sure what happened to it)

  • Property mode set to 100644
File size: 1.2 KB
Line 
1--TEST--
2Check simplified remctl API
3--SKIPIF--
4<?php
5    if (!file_exists("remctl-test.pid"))
6        echo "skip remctld not running";
7?>
8--FILE--
9<?php
10    $fh = fopen("remctl-test.princ", "r");
11    $principal = rtrim(fread($fh, filesize("remctl-test.princ")));
12    $command = array("test", "test");
13    $result = remctl("localhost", 14373, $principal, $command);
14    echo "stdout_len: $result->stdout_len\n";
15    echo "stdout: $result->stdout\n";
16    echo "stderr_len: $result->stderr_len\n";
17    echo "status: $result->status\n";
18    flush();
19
20    $command = array("test", "status", "2");
21    $result = remctl("localhost", 14373, $principal, $command);
22    echo "stdout_len: $result->stdout_len\n";
23    echo "stderr_len: $result->stderr_len\n";
24    echo "status: $result->status\n";
25    flush();
26
27    $command = array("test", "bad-command");
28    $result = remctl("localhost", 14373, $principal, $command);
29    echo "stdout_len: $result->stdout_len\n";
30    echo "stderr_len: $result->stderr_len\n";
31    echo "error: $result->error\n";
32    echo "status: $result->status\n";
33    flush();
34?>
35--EXPECT--
36stdout_len: 12
37stdout: hello world
38
39stderr_len: 0
40status: 0
41stdout_len: 0
42stderr_len: 0
43status: 2
44stdout_len: 0
45stderr_len: 0
46error: Unknown command
47status: 0
Note: See TracBrowser for help on using the repository browser.