Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
G
go-ipfs
概览
概览
详情
活动
周期分析
版本库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
问题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程表
图表
维基
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
jihao
go-ipfs
Commits
16f2a56f
Unverified
提交
16f2a56f
authored
5月 15, 2019
作者:
Steven Allen
提交者:
GitHub
5月 15, 2019
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #6339 from ipfs/fix/fail-on-plugin-failure
fail start when loading a plugin fails
上级
3316dc12
30fc5299
隐藏空白字符变更
内嵌
并排
正在显示
3 个修改的文件
包含
34 行增加
和
10 行删除
+34
-10
main.go
cmd/ipfs/main.go
+3
-3
t0280-plugin-git.sh
test/sharness/t0280-plugin-git.sh
+0
-7
t0280-plugin.sh
test/sharness/t0280-plugin.sh
+31
-0
没有找到文件。
cmd/ipfs/main.go
浏览文件 @
16f2a56f
...
...
@@ -60,15 +60,15 @@ func loadPlugins(repoPath string) (*loader.PluginLoader, error) {
}
plugins
,
err
=
loader
.
NewPluginLoader
(
pluginpath
)
if
err
!=
nil
{
log
.
Error
(
"error loading plugins:
"
,
err
)
return
nil
,
fmt
.
Errorf
(
"error loading plugins: %s
"
,
err
)
}
if
err
:=
plugins
.
Initialize
();
err
!=
nil
{
log
.
Error
(
"error initializing plugins:
"
,
err
)
return
nil
,
fmt
.
Errorf
(
"error initializing plugins: %s
"
,
err
)
}
if
err
:=
plugins
.
Inject
();
err
!=
nil
{
log
.
Error
(
"error running plugins:
"
,
err
)
return
nil
,
fmt
.
Errorf
(
"error initializing plugins: %s
"
,
err
)
}
return
plugins
,
nil
}
...
...
test/sharness/t0280-plugin-git.sh
浏览文件 @
16f2a56f
...
...
@@ -8,13 +8,6 @@ test_description="Test git plugin"
.
lib/test-lib.sh
# if in travis CI, dont test mount (no fuse)
if
!
test_have_prereq PLUGIN
;
then
skip_all
=
'skipping git plugin tests, plugins not available'
test_done
fi
test_init_ipfs
# from https://github.com/ipfs/go-ipld-git/blob/master/make-test-repo.sh
...
...
test/sharness/t0280-plugin.sh
0 → 100755
浏览文件 @
16f2a56f
#!/usr/bin/env bash
#
# Copyright (c) 2019 Protocol Labs
# MIT Licensed; see the LICENSE file in this repository.
#
test_description
=
"Test plugin loading"
.
lib/test-lib.sh
test_init_ipfs
test_expect_success
"ipfs id succeeds"
'
ipfs id
'
test_expect_success
"make a bad plugin"
'
mkdir -p "$IPFS_PATH/plugins" &&
echo foobar > "$IPFS_PATH/plugins/foo.so" &&
chmod +x "$IPFS_PATH/plugins/foo.so"
'
test_expect_success
"ipfs id fails due to a bad plugin"
'
test_expect_code 1 ipfs id
'
test_expect_success
"cleanup bad plugin"
'
rm "$IPFS_PATH/plugins/foo.so"
'
test_done
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论