Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
dms3
go-dms3
Commits
ad83b6fa
Unverified
Commit
ad83b6fa
authored
Jun 26, 2018
by
Whyrusleeping
Committed by
GitHub
Jun 26, 2018
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #5114 from ipfs/fix/fix-dht-tests
fixup DHT sharness tests
parents
ecf7d157
384e2c40
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
7 deletions
+15
-7
test/sharness/t0170-dht.sh
test/sharness/t0170-dht.sh
+15
-7
No files found.
test/sharness/t0170-dht.sh
View file @
ad83b6fa
...
...
@@ -4,8 +4,8 @@ test_description="Test dht command"
.
lib/test-lib.sh
TEST_DHT_VALUE
=
"
CAASpgIwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQC8hSwYY1FXqjT5M36O/Q5fBeDhXE5ePvGAeN3MIibfChqQpgqBbXQi1gAp4TQypSTKl/AMy7hfzsKauieim7jHMgIYAB4pLoBQD1qGVn/n7CqzAR3gDg9umIGuAy15oT0uaqMDqSepfnyxEyPDqfDklgvmS/MAwfBHjH2IPcMIaFgZ6d6gVlhmwuH8WVQ/geumDqyKuU9Jy+SUozmxEu2Baylg4fuqxaxoqOiPFZeWKSCFAngFj3NPmLApE0Fy48/eEZ+t7iP6s/raupP4+Jk/AFNDJNos4VxUnLJpZ1g6W5vYkkt1kXbMTaqxFVryCdCW2UEOwEzjGPGkcIE4RJrHAgMBAAE=
"
TEST_DHT_PATH
=
"/pk/Qm
epgFW7BHEtU4pZJdxaNiv75mKLLRQnPi1KaaXmQN4V1a
"
TEST_DHT_VALUE
=
"
foobar
"
TEST_DHT_PATH
=
"/pk/Qm
bWTwYGcmdyK9CYfNBcfs9nhZs17a6FQ4Y8oea278xx41
"
# start iptb + wait for peering
NUM_NODES
=
5
...
...
@@ -29,7 +29,7 @@ test_expect_success 'findpeer' '
# ipfs dht put <key> <value>
test_expect_success
'put with good keys'
'
echo "$TEST_DHT_VALUE" | b64decode |
ipfsi 0 dht put "$TEST_DHT_PATH" | sort >putted &&
ipfsi 0 dht put "$TEST_DHT_PATH"
"$TEST_DHT_VALUE"
| sort >putted &&
[ -s putted ] ||
test_fsh cat putted
'
...
...
@@ -41,7 +41,15 @@ test_expect_success 'get with good keys' '
ipfsi 1 dht get "/ipns/$PEERID_2" | grep -aq "/ipfs/$HASH"
'
test_expect_failure
'put with bad keys (issue #4611)'
'
test_expect_failure
'put with bad keys fails (issue #5113)'
'
ipfsi 0 dht put "foo" "bar" >putted
ipfsi 0 dht put "/pk/foo" "bar" >>putted
ipfsi 0 dht put "/ipns/foo" "bar" >>putted
[ ! -s putted ] ||
test_fsh cat putted
'
test_expect_failure
'put with bad keys returns error (issue #4611)'
'
! ipfsi 0 dht put "foo" "bar" &&
! ipfsi 0 dht put "/pk/foo" "bar" &&
! ipfsi 0 dht put "/ipns/foo" "bar"
...
...
@@ -70,9 +78,9 @@ test_expect_success 'findprovs' '
## turns out to be the closest to what a key hashes to.
# TODO: flaky. tracked by https://github.com/ipfs/go-ipfs/issues/2620
test_expect_success
'query'
'
ipfsi 3 dht query
banana
>actual &&
ipfsi 3 dht query
apple
>>actual &&
ipfsi 3 dht query
pear
>>actual &&
ipfsi 3 dht query
"$(echo banana | ipfsi 3 add -q)"
>actual &&
ipfsi 3 dht query
"$(echo apple | ipfsi 3 add -q)"
>>actual &&
ipfsi 3 dht query
"$(echo pear | ipfsi 3 add -q)"
>>actual &&
PEERS=$(wc -l actual | cut -d '
"'"
' '
"'"
' -f 1) &&
[ -s actual ] ||
test_might_fail test_fsh cat actual
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment