Orion Context Broker 功能测试失败

Orion Context Broker functional test failure

我已经在 CentOS 6.9 VM 上成功地分叉并构建了 Context Broker 源代码,现在我正在尝试 运行 按照 official documentation 的建议进行功能测试。首先,我安装了 accumulator-server.py 脚本:

$ make install_scripts INSTALL_DIR=~

确认已安装:

$ accumulator-server.py -u

Usage: accumulator-server.py --host <host> --port <port> --url <server url> --pretty-print -v -u

Parameters:
  --host <host>: host to use database to use (default is '0.0.0.0')
  --port <port>: port to use (default is 1028)
  --url <server url>: server URL to use (default is /accumulate)
  --pretty-print: pretty print mode
  --https: start in https
  --key: key file (only used if https is enabled)
  --cert: cert file (only used if https is enabled)
  -v: verbose mode
  -u: print this usage message

然后 运行 功能测试:

$ make functional_test INSTALL_DIR=~

但测试失败并退出并显示以下消息:

024/927: 0000_ipv6_support/ipv4_ipv6_both.test ........................................................................  (FAIL 11 - SHELL-INIT exited with code 1) testHarness.sh/IPv6 IPv4 Both : (0000_ipv6_support/ipv4_ipv6_both.test) 
make: *** [functional_test] Error 11
$

我检查了文件 ../0000_ipv6_support/ipv4_ipv6_both.shellInit.stdout 是否有任何关于可能出错的提示,但错误日志没有引导我到任何地方:

{ "dropped" : "ftest", "ok" : 1 }
accumulator running as PID 6404
Unable to start listening application after waiting 30

有人知道这里可能出了什么问题吗?

我检查了打印错误行 Unable to start listening application after waiting 30 的脚本,并注意到 accumulator-server.py 的标准错误已登录到 /tmp 文件夹中。

accumulator_9977_stderr 文件有这个日志:0000_ipv6_support/ipv4_ipv6_both.shellInit: line 27: accumulator-server.py: command not found

看到这个日志后,我明白了我犯的错误。我是 运行 使用 sudo 和 secure_path 代替我的 PATH 变量进行功能测试。

所以最后,运行 使用以下命令进行的功能测试为我解决了这个问题。

$ sudo "PATH=$PATH" make functional_test INSTALL_DIR=~

这也可以通过以下方式编辑 /etc/sudoers 文件来解决:

$ sudo visudo

并修改 secure_path 值。