提交 a8d90029 作者: Jeromy Johnson 提交者: GitHub

Merge pull request #2951 from ipfs/fix/repo-verify-live

make repo verify work with running daemon
......@@ -271,6 +271,7 @@ var repoVerifyCmd = &cmds.Command{
res.SetOutput((<-chan interface{})(out))
},
Type: VerifyProgress{},
Marshalers: cmds.MarshalerMap{
cmds.Text: func(res cmds.Response) (io.Reader, error) {
out := res.Output().(<-chan interface{})
......
......@@ -29,14 +29,22 @@ test_expect_success 'blocks are swapped' '
ipfs config --bool Datastore.HashOnRead true
test_expect_success 'getting modified block fails' '
(test_must_fail ipfs cat $H_BLOCK2 2> err_msg) &&
grep "block in storage has different hash than requested" err_msg
'
test_expect_success "block shows up in repo verify" '
test_expect_code 1 ipfs repo verify > verify_out &&
grep "$H_BLOCK2" verify_out
'
test_check_bad_blocks() {
test_expect_success 'getting modified block fails' '
(test_must_fail ipfs cat $H_BLOCK2 2> err_msg) &&
grep "block in storage has different hash than requested" err_msg
'
test_expect_success "block shows up in repo verify" '
test_expect_code 1 ipfs repo verify > verify_out &&
grep "$H_BLOCK2" verify_out
'
}
test_check_bad_blocks
test_launch_ipfs_daemon
test_check_bad_blocks
test_kill_ipfs_daemon
test_done
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论