提交 a14f2033 作者: Steven Allen

Merge branch 'fix/3415'

License: MIT
Signed-off-by: 's avatarSteven Allen <steven@stebalien.com>
......@@ -141,7 +141,7 @@ var findProvidersDhtCmd = &cmds.Command{
return err
}
if n.Routing == nil {
if !n.OnlineMode() {
return ErrNotOnline
}
......@@ -235,7 +235,7 @@ var provideRefDhtCmd = &cmds.Command{
return err
}
if nd.Routing == nil {
if !nd.OnlineMode() {
return ErrNotOnline
}
......@@ -364,7 +364,7 @@ var findPeerDhtCmd = &cmds.Command{
return err
}
if nd.Routing == nil {
if !nd.OnlineMode() {
return ErrNotOnline
}
......@@ -446,7 +446,7 @@ Different key types can specify other 'best' rules.
return err
}
if nd.Routing == nil {
if !nd.OnlineMode() {
return ErrNotOnline
}
......@@ -538,7 +538,7 @@ NOTE: A value may not exceed 2048 bytes.
return err
}
if nd.Routing == nil {
if !nd.OnlineMode() {
return ErrNotOnline
}
......
......@@ -91,6 +91,15 @@ test_dht() {
test_expect_success 'stop iptb' '
iptb stop
'
test_expect_success "dht commands fail when offline" '
test_must_fail ipfsi 0 dht findprovs "$HASH" 2>err_findprovs &&
test_must_fail ipfsi 0 dht findpeer "$HASH" 2>err_findpeer &&
test_must_fail ipfsi 0 dht put "$TEST_DHT_PATH" "$TEST_DHT_VALUE" 2>err_put &&
test_should_contain "this command must be run in online mode" err_findprovs &&
test_should_contain "this command must be run in online mode" err_findpeer &&
test_should_contain "this command must be run in online mode" err_put
'
}
test_dht
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论