mirror of
https://github.com/ipfs/kubo.git
synced 2026-02-21 18:37:45 +08:00
Fix name resolve --offline
License: MIT Signed-off-by: Łukasz Magiera <magik6k@gmail.com>
This commit is contained in:
parent
1652148cae
commit
85772fcd54
@ -209,7 +209,6 @@ func (api *CoreAPI) WithOptions(opts ...options.ApiOption) (coreiface.CoreAPI, e
|
||||
|
||||
subApi.peerstore = nil
|
||||
subApi.peerHost = nil
|
||||
subApi.namesys = nil
|
||||
subApi.recordValidator = nil
|
||||
|
||||
subApi.exchange = offlinexch.Exchange(subApi.blockstore)
|
||||
|
||||
@ -158,8 +158,42 @@ test_expect_success "'ipfs name publish --help' succeeds" '
|
||||
ipfs name publish --help
|
||||
'
|
||||
|
||||
# test offline resolve
|
||||
|
||||
test_expect_success "'ipfs name resolve --offline' succeeds" '
|
||||
ipfs name resolve --offline "$PEERID" >output
|
||||
'
|
||||
test_expect_success "resolve output looks good" '
|
||||
printf "/ipld/%s/thing\n" "$OBJECT_HASH" >expected4 &&
|
||||
test_cmp expected4 output
|
||||
'
|
||||
|
||||
test_expect_success "'ipfs name resolve --offline -n' succeeds" '
|
||||
ipfs name resolve --offline -n "$PEERID" >output
|
||||
'
|
||||
test_expect_success "resolve output looks good" '
|
||||
printf "/ipld/%s/thing\n" "$OBJECT_HASH" >expected4 &&
|
||||
test_cmp expected4 output
|
||||
'
|
||||
|
||||
test_launch_ipfs_daemon
|
||||
|
||||
test_expect_success "'ipfs name resolve --offline' succeeds" '
|
||||
ipfs name resolve --offline "$PEERID" >output
|
||||
'
|
||||
test_expect_success "resolve output looks good" '
|
||||
printf "/ipld/%s/thing\n" "$OBJECT_HASH" >expected4 &&
|
||||
test_cmp expected4 output
|
||||
'
|
||||
|
||||
test_expect_success "'ipfs name resolve --offline -n' succeeds" '
|
||||
ipfs name resolve --offline -n "$PEERID" >output
|
||||
'
|
||||
test_expect_success "resolve output looks good" '
|
||||
printf "/ipld/%s/thing\n" "$OBJECT_HASH" >expected4 &&
|
||||
test_cmp expected4 output
|
||||
'
|
||||
|
||||
test_expect_success "empty request to name publish doesn't panic and returns error" '
|
||||
curl "http://$API_ADDR/api/v0/name/publish" > curl_out || true &&
|
||||
grep "argument \"ipfs-path\" is required" curl_out
|
||||
|
||||
Loading…
Reference in New Issue
Block a user