sharness: test loading a bad plugin
License: MIT Signed-off-by: Steven Allen <steven@stebalien.com>
Steven Allen committed
May 15, 2019 at 12:19 UTC
30fc529983705a21be073668b0f2d52222ee3d62
1 file changed
+31
test/sharness/t0280-plugin.sh
new
+31
@@ -0,0 +1,31 @@
1
+#!/usr/bin/env bash
2
+#
3
+# Copyright (c) 2019 Protocol Labs
4
+# MIT Licensed; see the LICENSE file in this repository.
5
+#
6
+
7
+test_description="Test plugin loading"
8
+
9
+. lib/test-lib.sh
10
+
11
+test_init_ipfs
12
+
13
+test_expect_success "ipfs id succeeds" '
14
+ ipfs id
15
+'
16
+
17
+test_expect_success "make a bad plugin" '
18
+ mkdir -p "$IPFS_PATH/plugins" &&
19
+ echo foobar > "$IPFS_PATH/plugins/foo.so" &&
20
+ chmod +x "$IPFS_PATH/plugins/foo.so"
21
+'
22
+
23
+test_expect_success "ipfs id fails due to a bad plugin" '
24
+ test_expect_code 1 ipfs id
25
+'
26
+
27
+test_expect_success "cleanup bad plugin" '
28
+ rm "$IPFS_PATH/plugins/foo.so"
29
+'
30
+
31
+test_done