Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
dms3
go-dms3
Commits
16f2a56f
Unverified
Commit
16f2a56f
authored
May 15, 2019
by
Steven Allen
Committed by
GitHub
May 15, 2019
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #6339 from ipfs/fix/fail-on-plugin-failure
fail start when loading a plugin fails
parents
3316dc12
30fc5299
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
34 additions
and
10 deletions
+34
-10
cmd/ipfs/main.go
cmd/ipfs/main.go
+3
-3
test/sharness/t0280-plugin-git.sh
test/sharness/t0280-plugin-git.sh
+0
-7
test/sharness/t0280-plugin.sh
test/sharness/t0280-plugin.sh
+31
-0
No files found.
cmd/ipfs/main.go
View file @
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
.
Error
f
(
"error loading plugins:
%s
"
,
err
)
}
if
err
:=
plugins
.
Initialize
();
err
!=
nil
{
log
.
Error
(
"error initializing plugins: "
,
err
)
return
nil
,
fmt
.
Error
f
(
"error initializing plugins:
%s
"
,
err
)
}
if
err
:=
plugins
.
Inject
();
err
!=
nil
{
log
.
Error
(
"error
runn
ing plugins: "
,
err
)
return
nil
,
fmt
.
Error
f
(
"error
initializ
ing plugins:
%s
"
,
err
)
}
return
plugins
,
nil
}
...
...
test/sharness/t0280-plugin-git.sh
View file @
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
View file @
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
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment