1
0
mirror of https://github.com/ipfs/kubo.git synced 2025-06-28 00:39:31 +08:00

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

make repo verify work with running daemon
This commit is contained in:
Jeromy Johnson
2016-07-06 23:12:07 -07:00
committed by GitHub
2 changed files with 17 additions and 8 deletions

View File

@ -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{})

View File

@ -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_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_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