提交 30aa1c92 编写于 作者: aaronchen2k2k's avatar aaronchen2k2k

add service test scripts

上级 1cf7bd48
...@@ -90,7 +90,7 @@ class zendata ...@@ -90,7 +90,7 @@ class zendata
exec($cmdStr, $output); exec($cmdStr, $output);
} }
public function startService($port, $root) public function startService($port, $root="")
{ {
$this->stopService($port); $this->stopService($port);
...@@ -121,8 +121,8 @@ class zendata ...@@ -121,8 +121,8 @@ class zendata
$url = sprintf("http://127.0.0.1:%d/?d=%s/%s&c=%s/%s&lines=%d", $url = sprintf("http://127.0.0.1:%d/?d=%s/%s&c=%s/%s&lines=%d",
$port, $this->workDir, $default, $this->workDir, $conf, $lines); $port, $this->workDir, $default, $this->workDir, $conf, $lines);
if (array_key_exists("root", $options)) { if (array_key_exists("fields", $options)) {
$url .= "&root=" . $options["root"]; $url .= "&F=" . $options["fields"];
} }
print("$url\n"); print("$url\n");
......
...@@ -20,7 +20,7 @@ $zd = new zendata(); ...@@ -20,7 +20,7 @@ $zd = new zendata();
$port = 8848; $port = 8848;
$zd->startService($port); $zd->startService($port);
$resp = $zd->httpGet($port, "default.yaml", "test.yaml", 10); $resp = $zd->httpGet($port, "default.yaml", "test.yaml", 10, array("fields"=>"field_common"));
$jsonArr = json_decode($resp,TRUE); $jsonArr = json_decode($resp,TRUE);
......
...@@ -21,7 +21,7 @@ $port = 8848; ...@@ -21,7 +21,7 @@ $port = 8848;
$root = dirname(dirname(dirname(__FILE__))); $root = dirname(dirname(dirname(__FILE__)));
$zd->startService($port, $root); $zd->startService($port, $root);
$resp = $zd->httpGet($port, "default.yaml", "test.yaml", 10); $resp = $zd->httpGet($port, "default.yaml", "test.yaml", 10, array("fields"=>"field_common"));
$jsonArr = json_decode($resp,TRUE); $jsonArr = json_decode($resp,TRUE);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册