make repo verify work with running daemon
License: MIT Signed-off-by: Jeromy <why@ipfs.io>
Jeromy committed
Jul 6, 2016 at 22:12 UTC
a98dff62756d5d7c295d610d152343c655dacf3b
2 files changed
+18
-9
core/commands/repo.go
+1
@@ -271,6 +271,7 @@ var repoVerifyCmd = &cmds.Command{
271
272
res.SetOutput((<-chan interface{})(out))
273
},
274
+ Type: VerifyProgress{},
275
Marshalers: cmds.MarshalerMap{
276
cmds.Text: func(res cmds.Response) (io.Reader, error) {
277
out := res.Output().(<-chan interface{})
test/sharness/t0084-repo-read-rehash.sh
+17
-9
@@ -29,14 +29,22 @@ test_expect_success 'blocks are swapped' '
29
30
ipfs config --bool Datastore.HashOnRead true
31
32
-test_expect_success 'getting modified block fails' '
33
- (test_must_fail ipfs cat $H_BLOCK2 2> err_msg) &&
34
- grep "block in storage has different hash than requested" err_msg
35
-'
36
-
37
-test_expect_success "block shows up in repo verify" '
38
- test_expect_code 1 ipfs repo verify > verify_out &&
39
- grep "$H_BLOCK2" verify_out
40
-'
32
+test_check_bad_blocks() {
33
+ test_expect_success 'getting modified block fails' '
34
+ (test_must_fail ipfs cat $H_BLOCK2 2> err_msg) &&
35
+ grep "block in storage has different hash than requested" err_msg
36
+ '
37
+
38
+ test_expect_success "block shows up in repo verify" '
39
+ test_expect_code 1 ipfs repo verify > verify_out &&
40
+ grep "$H_BLOCK2" verify_out
41
+ '
42
+}
43
+
44
+test_check_bad_blocks
45
+
46
+test_launch_ipfs_daemon
47
+test_check_bad_blocks
48
+test_kill_ipfs_daemon
49
50
test_done