Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
G
go-ipfs
概览
概览
详情
活动
周期分析
版本库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
问题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程表
图表
维基
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
jihao
go-ipfs
Commits
be96d8d7
提交
be96d8d7
authored
8月 27, 2015
作者:
rht
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Fix test cases for ipfs api check
License: MIT Signed-off-by:
rht
<
rhtbot@gmail.com
>
上级
e1d8200f
隐藏空白字符变更
内嵌
并排
正在显示
1 个修改的文件
包含
27 行增加
和
6 行删除
+27
-6
t0062-daemon-api.sh
test/sharness/t0062-daemon-api.sh
+27
-6
没有找到文件。
test/sharness/t0062-daemon-api.sh
浏览文件 @
be96d8d7
...
...
@@ -9,8 +9,23 @@ test_description="Test daemon command"
test_init_ipfs
test_expect_success
"client should work when there is no api file"
'
ipfs --api "$differentapi" id
differentport
=
$((
PORT_API
+
1
))
differentapi
=
"/ip4/127.0.0.1/tcp/
$differentport
"
peerid
=
$(
ipfs config Identity.PeerID
)
test_client
()
{
args
=
"
$@
"
printf
$peerid
>
expected
ipfs
$args
id
-f
=
"<id>"
>
actual
test_cmp expected actual
}
test_expect_success
"client should work when there is no api file and no --api is specified"
'
test_client
'
test_expect_success
"client should err when there is no api file and with --api is specified"
'
test_must_fail test_client --api "$differentapi"
'
test_launch_ipfs_daemon
...
...
@@ -19,8 +34,10 @@ test_expect_success "'ipfs daemon' creates api file" '
test -f ".ipfs/api"
'
differentport
=
$((
PORT_API
+
1
))
differentapi
=
"/ip4/127.0.0.1/tcp/
$differentport
"
test_expect_success
"api file looks good"
'
printf "$ADDR_API" >expected &&
test_cmp expected .ipfs/api
'
test_expect_success
"client should err if client api != api file while daemon is on"
'
echo "Error: api not running" >expected &&
...
...
@@ -42,12 +59,16 @@ ADDR_API=$differentapi
test_launch_ipfs_daemon
--api
"
$ADDR_API
"
test_expect_success
"'ipfs daemon' api option works"
'
printf "$differentapi" >
expected &&
printf "$differentapi" >expected &&
test_cmp expected .ipfs/api
'
test_expect_success
"client should work if client api == api file, != cfg api while daemon is on"
'
ipfs --api "$differentapi" id
test_client --api "$differentapi"
'
test_expect_success
"client should read the api file while daemon is on"
'
test_client
'
test_kill_ipfs_daemon
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论