fix dht sharness tests
We can't currently put binary values due to API limitations. This worked before because the DHT wasn't checking values on local put. License: MIT Signed-off-by: Steven Allen <steven@stebalien.com>
Steven Allen committed
Jun 13, 2018 at 17:46 UTC
6112150d04f73bc840acfe0435b2f33a17f49fbc
1 file changed
+6
-6
test/sharness/t0170-dht.sh
+6
-6
@@ -4,8 +4,8 @@ test_description="Test dht command"
4
5
. lib/test-lib.sh
6
7
-TEST_DHT_VALUE="CAASpgIwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQC8hSwYY1FXqjT5M36O/Q5fBeDhXE5ePvGAeN3MIibfChqQpgqBbXQi1gAp4TQypSTKl/AMy7hfzsKauieim7jHMgIYAB4pLoBQD1qGVn/n7CqzAR3gDg9umIGuAy15oT0uaqMDqSepfnyxEyPDqfDklgvmS/MAwfBHjH2IPcMIaFgZ6d6gVlhmwuH8WVQ/geumDqyKuU9Jy+SUozmxEu2Baylg4fuqxaxoqOiPFZeWKSCFAngFj3NPmLApE0Fy48/eEZ+t7iP6s/raupP4+Jk/AFNDJNos4VxUnLJpZ1g6W5vYkkt1kXbMTaqxFVryCdCW2UEOwEzjGPGkcIE4RJrHAgMBAAE="
8
-TEST_DHT_PATH="/pk/QmepgFW7BHEtU4pZJdxaNiv75mKLLRQnPi1KaaXmQN4V1a"
7
+TEST_DHT_VALUE="foobar"
8
+TEST_DHT_PATH="/pk/QmbWTwYGcmdyK9CYfNBcfs9nhZs17a6FQ4Y8oea278xx41"
9
10
# start iptb + wait for peering
11
NUM_NODES=5
@@ -29,7 +29,7 @@ test_expect_success 'findpeer' '
29
30
# ipfs dht put <key> <value>
31
test_expect_success 'put with good keys' '
32
- echo "$TEST_DHT_VALUE" | b64decode | ipfsi 0 dht put "$TEST_DHT_PATH" | sort >putted &&
32
+ ipfsi 0 dht put "$TEST_DHT_PATH" "$TEST_DHT_VALUE" | sort >putted &&
33
[ -s putted ] ||
34
test_fsh cat putted
35
'
@@ -70,9 +70,9 @@ test_expect_success 'findprovs' '
70
## turns out to be the closest to what a key hashes to.
71
# TODO: flaky. tracked by https://github.com/ipfs/go-ipfs/issues/2620
72
test_expect_success 'query' '
73
- ipfsi 3 dht query banana >actual &&
74
- ipfsi 3 dht query apple >>actual &&
75
- ipfsi 3 dht query pear >>actual &&
73
+ ipfsi 3 dht query "$(echo banana | ipfsi 3 add -q)" >actual &&
74
+ ipfsi 3 dht query "$(echo apple | ipfsi 3 add -q)" >>actual &&
75
+ ipfsi 3 dht query "$(echo pear | ipfsi 3 add -q)" >>actual &&
76
PEERS=$(wc -l actual | cut -d '"'"' '"'"' -f 1) &&
77
[ -s actual ] ||
78
test_might_fail test_fsh cat actual